# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286142627 -10800 # Node ID 92dbd2a406d9bc2cfff847b431a83a6a715cc73f # Parent 3b098142db8376f35f1e26e1970ec5476c80bed0 Revision: 201037 Kit: 201039 diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/collectionhelper/inc/mpxcollectionuihelperimp.h --- a/mmappcomponents/collectionhelper/inc/mpxcollectionuihelperimp.h Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappcomponents/collectionhelper/inc/mpxcollectionuihelperimp.h Mon Oct 04 00:50:27 2010 +0300 @@ -859,6 +859,7 @@ TBool iInitialized; // collection db merging TBool iIncAdding; // Incremental adding guard TInt iRefCount; + TUid iModeId; }; #endif // CMPX_COLLECTION_UI_HELPER_H diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/collectionhelper/src/mpxcollectionuihelperimp.cpp --- a/mmappcomponents/collectionhelper/src/mpxcollectionuihelperimp.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappcomponents/collectionhelper/src/mpxcollectionuihelperimp.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -84,7 +84,7 @@ iChunkSize = 0; iArrayIndex = 0; iRefCount = 1; - + iModeId = aModeId; } @@ -1049,21 +1049,24 @@ // void CMPXCollectionUiHelperImp::Close() { - - ASSERT( iRefCount > 0 ); - if ( --iRefCount == 0 ) + if ( iModeId == KMcModeDefault ) { - // last client released - CMPXCollectionUiHelperImp* s = reinterpret_cast( Dll::Tls() ); - if ( s ) + ASSERT( iRefCount > 0 ); + if ( --iRefCount == 0 ) { - if ( s == this ) + // last client released + CMPXCollectionUiHelperImp* s = reinterpret_cast( Dll::Tls() ); + if ( s && s == this ) { delete this; Dll::SetTls( NULL ); } } } + else + { + delete this; + } } // --------------------------------------------------------------------------- diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/mmmtpdataprovider/inc/mmmtpdputility.h --- a/mmappcomponents/mmmtpdataprovider/inc/mmmtpdputility.h Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappcomponents/mmmtpdataprovider/inc/mmmtpdputility.h Mon Oct 04 00:50:27 2010 +0300 @@ -63,7 +63,7 @@ /** * Check the file size, if file doesn't exist, leave * @param aFs, handle of file server session - * @param aFileName, fine name + * @param aFileName, file name * @return TUint64 size for specified file */ static TUint64 GetObjectSizeL( RFs& aFs, const TDesC& aFileName ); @@ -71,11 +71,21 @@ /** * Get file date modified info * @param aFs , handle of file server session - * @param aFullFileName, fine name - * @return TTime for specified file + * @param aFullFileName, file name + * @param aDateModified, MTP time format (YYYYMMDDTHHMMSS) for the file */ static void GetObjectDateModifiedL( RFs& aFs, const TDesC& aFullFileName, TDes& aDateModified ); + + /** + * Converts a date time string in the internal MTP format (YYYYMMDDTHHMMSS) + * to a TTime. + * @param aDateTime string, containing date and time + * @param aTime, the TTime objec if the date time string is parsed correctly + * @return error code + */ + static TInt DesToTTime( const TDesC& aDateTime, TTime& aTime ); + /** * Check if file is read-only, if file doesn't exist, leave * @param aFs , handle of file server session diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csendobject.h --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csendobject.h Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/inc/csendobject.h Mon Oct 04 00:50:27 2010 +0300 @@ -205,9 +205,9 @@ TInt ReserveObjectL(); /** - * Set protection status of object which could be read/write-only + * Set file properties of object */ - void SetProtectionStatus(); + void SetFileProperties(); /** * Save object information of object whose size is zero @@ -266,8 +266,7 @@ TUint16 iObjectFormat; TUint64 iObjectSize; - // S60 feature doesn't include this. - // Reserve for future + // cache info during SendObjectInfo/SendObjectProplist for file properties TUint16 iProtectionStatus; HBufC* iDateMod; diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csendobject.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csendobject.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csendobject.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -451,7 +451,6 @@ iWidth, iHeight ); - // TODO: dateModified is reserved for extention usage. delete iDateMod; iDateMod = NULL; iDateMod = iObjectInfo->StringCharsL( CMTPTypeObjectInfo::EDateModified ).AllocL(); @@ -911,7 +910,6 @@ case EMTPObjectPropCodeDateAdded: case EMTPObjectPropCodeDateCreated: - case EMTPObjectPropCodeDateModified: case EMTPObjectPropCodeObjectFileName: // Do nothing for read-only properties /* spec: @@ -921,9 +919,9 @@ */ break; + case EMTPObjectPropCodeDateModified: case EMTPObjectPropCodeProtectionStatus: // Already done in AddMediaToStore, it's not necessary to set it again. - // SetProtectionStatus(); break; case EMTPObjectPropCodeName: @@ -1226,12 +1224,12 @@ } // ----------------------------------------------------------------------------- -// CSendObject::SetProtectionStatus +// CSendObject::SetFileProperties // ----------------------------------------------------------------------------- // -void CSendObject::SetProtectionStatus() +void CSendObject::SetFileProperties() { - PRINT1( _L( "MM MTP => CSendObject::SetProtectionStatus iProtectionStatus = %d" ), iProtectionStatus ); + PRINT1( _L( "MM MTP => CSendObject::SetFileProperties iProtectionStatus = %d" ), iProtectionStatus ); if ( iFileReceived != NULL ) { @@ -1250,10 +1248,22 @@ if ( err != KErrNone ) { - PRINT1( _L("MM MTP <> CSendObject::SetProtectionStatus err = %d" ), err ); + PRINT1( _L( "MM MTP <> CSendObject::SetFileProperties SetAtt err = %d" ), err ); } } - // Close the file after SetProtectionStatus to make sure other process won't open + + if( iDateMod != NULL ) + { + TTime modTime( 0 ); + TInt err = MmMtpDpUtility::DesToTTime( *iDateMod, modTime ); + if( err == KErrNone ) + { + err = iFileReceived->File().SetModified( modTime ); + PRINT1( _L( "MM MTP <> CSendObject::SetFileProperties SetModified err = %d" ), err ); + } + } + + // Close the file after SetFileProperties to make sure other process won't open // the file successfully right at the time calling RFile::SetAtt. if ( iObjectSize > 0 ) { @@ -1264,7 +1274,7 @@ iFileReceived->File().Close(); } - PRINT( _L( "MM MTP <= CSendObject::SetProtectionStatus" ) ); + PRINT( _L( "MM MTP <= CSendObject::SetFileProperties" ) ); } // ----------------------------------------------------------------------------- @@ -1309,10 +1319,10 @@ { PRINT( _L( "MM MTP => CSendObject::AddMediaToStoreL" ) ); - // SetProtectionStatus here make sure no matter the previous operation is SendObjectInfo + // SetFileProperties here make sure no matter the previous operation is SendObjectInfo // or SendObjectPropList - // Might need to set dateadded and datemodify for further extension. - SetProtectionStatus(); + // Might need to set dateadded for further extension. + SetFileProperties(); PRINT1( _L( "MM MTP <> CSendObject::AddMediaToStoreL iFullPath = %S" ), &iFullPath ); iDpConfig.GetWrapperL().AddObjectL( *iReceivedObjectInfo ); diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp --- a/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -212,6 +212,69 @@ } // ----------------------------------------------------------------------------- +// MmMtpDpUtility::DesToTTimeL +// Converts a MTP format (YYYYMMDDTHHMMSS) date time string to a TTime. +// ----------------------------------------------------------------------------- +// +TInt MmMtpDpUtility::DesToTTime( const TDesC& aDateTime, TTime& aTime ) + { + PRINT1( _L ( "MM MTP => MmMtpDpUtility::DesToTTime aDateTime=%S" ), &aDateTime ); + + TInt err = KErrNone; + if ( aDateTime.Length() < KMtpMaxDateTimeStringLength ) + { + err = KErrGeneral; + } + else + { + TLex dateBuf( aDateTime.Left( 4 ) ); + TInt year; + dateBuf.Val( year ); + + dateBuf = aDateTime.Mid( 4, 2 ); + TInt month; + dateBuf.Val( month ); + + dateBuf = aDateTime.Mid( 6, 2 ); + TInt day; + dateBuf.Val( day ); + + dateBuf = aDateTime.Mid( 9, 2 ); + TInt hour; + dateBuf.Val( hour ); + + dateBuf = aDateTime.Mid( 11, 2 ); + TInt minute; + dateBuf.Val( minute ); + + dateBuf = aDateTime.Mid( 13, 2 ); + TInt second; + dateBuf.Val( second ); + + PRINT3( _L ( "MM MTP <> MmMtpDpUtility::DesToTTime Year = %d, Month = %d, Day = %d" ), year, month, day ); + PRINT3( _L ( "MM MTP <> MmMtpDpUtility::DesToTTime Hour = %d, Minute = %d, Second = %d" ), hour, minute, second ); + + if ( ( month > 0 && month < 13 ) + && ( day > 0 && day < 32 ) + && ( hour >= 0 && hour < 60 ) + && ( minute >= 0 && minute < 60 ) + && ( second >= 0 && second < 60 ) ) + { + // microsecond is ignored because MPX doesn't support it, following s60 + TDateTime dateTime( year, TMonth( --month ), --day, hour, minute, second, 0 ); + aTime = dateTime; + } + else + { + // date string syntax is wrong + err = KErrGeneral; + } + } + PRINT1( _L ( "MM MTP <= MmMtpDpUtility::DesToTTime err = %d" ), err ); + return err; + } + +// ----------------------------------------------------------------------------- // MmMtpDpUtility::GetProtectionStatusL // Get the file protection status. // ----------------------------------------------------------------------------- diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/mmmtpdataprovider/tsrc/mtpdataprovidertestmodule/data/mmc/PLAYLIST.m3u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappcomponents/mmmtpdataprovider/tsrc/mtpdataprovidertestmodule/data/mmc/PLAYLIST.m3u Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,1 @@ +TESTDIR\TEST1.MP3TESTDIR\TEST2.MP3 \ No newline at end of file diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/mmmtpdataprovider/tsrc/mtpdataprovidertestmodule/data/mmc/SENDTEST.MP3 Binary file mmappcomponents/mmmtpdataprovider/tsrc/mtpdataprovidertestmodule/data/mmc/SENDTEST.MP3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/mmmtpdataprovider/tsrc/mtpdataprovidertestmodule/data/mmc/TEST.MP3 Binary file mmappcomponents/mmmtpdataprovider/tsrc/mtpdataprovidertestmodule/data/mmc/TEST.MP3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/mmmtpdataprovider/tsrc/mtpdataprovidertestmodule/data/mmc/TEST1.MP3 Binary file mmappcomponents/mmmtpdataprovider/tsrc/mtpdataprovidertestmodule/data/mmc/TEST1.MP3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappcomponents/mmmtpdataprovider/tsrc/mtpdataprovidertestmodule/data/mmc/TEST2.MP3 Binary file mmappcomponents/mmmtpdataprovider/tsrc/mtpdataprovidertestmodule/data/mmc/TEST2.MP3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/harvester_collection_mediator_api/tsrc/data/mmc/allmetadata.mp3 Binary file mmappfw_plat/harvester_collection_mediator_api/tsrc/data/mmc/allmetadata.mp3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/harvester_collection_mediator_api/tsrc/data/mmc/test0000.mp3 Binary file mmappfw_plat/harvester_collection_mediator_api/tsrc/data/mmc/test0000.mp3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/harvester_collection_mediator_api/tsrc/data/mmc/test0001.mp3 Binary file mmappfw_plat/harvester_collection_mediator_api/tsrc/data/mmc/test0001.mp3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/harvester_collection_mediator_api/tsrc/data/mmc/test0002.mp3 Binary file mmappfw_plat/harvester_collection_mediator_api/tsrc/data/mmc/test0002.mp3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/harvester_metadata_extractor_api/tsrc/data/mmc/mpxtest1.mp3 Binary file mmappfw_plat/harvester_metadata_extractor_api/tsrc/data/mmc/mpxtest1.mp3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/harvester_utility_api/tsrc/data/mmc/mpxtest1.mp3 Binary file mmappfw_plat/harvester_utility_api/tsrc/data/mmc/mpxtest1.mp3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/harvester_utility_api/tsrc/data/mmc/mpxtest2.mp3 Binary file mmappfw_plat/harvester_utility_api/tsrc/data/mmc/mpxtest2.mp3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/harvester_utility_api/tsrc/data/mmc/mpxtestplaylist.m3u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/harvester_utility_api/tsrc/data/mmc/mpxtestplaylist.m3u Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +#EXTM3U +Sounds\Digital\mpxtest1.mp3 +Sounds\Digital\mpxtest2.mp3 \ No newline at end of file diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_albumart_utility_api/tsrc/data/mmc/Waterlilies.jpg Binary file mmappfw_plat/mpx_albumart_utility_api/tsrc/data/mmc/Waterlilies.jpg has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_albumart_utility_api/tsrc/data/mmc/qgn_graf_mup2_visualizer_bg_image2.bmp Binary file mmappfw_plat/mpx_albumart_utility_api/tsrc/data/mmc/qgn_graf_mup2_visualizer_bg_image2.bmp has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_albumart_utility_api/tsrc/data/mmc/test.bmp Binary file mmappfw_plat/mpx_albumart_utility_api/tsrc/data/mmc/test.bmp has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_albumart_utility_api/tsrc/data/mmc/test.mbm Binary file mmappfw_plat/mpx_albumart_utility_api/tsrc/data/mmc/test.mbm has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_albumart_utility_api/tsrc/mpxalbumartutilitytest/src/mpxalbumartutilitytestBlocks.cpp --- a/mmappfw_plat/mpx_albumart_utility_api/tsrc/mpxalbumartutilitytest/src/mpxalbumartutilitytestBlocks.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappfw_plat/mpx_albumart_utility_api/tsrc/mpxalbumartutilitytest/src/mpxalbumartutilitytestBlocks.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -260,7 +260,7 @@ KTestStr.Append(string); TRequestStatus iStatus(0); TBufC<50> path(KTestStr); - CFbsBitmap* iDestBMP; + CFbsBitmap* iDestBMP( NULL ); TRAP( err , iDestBMP = new(ELeave) CFbsBitmap()); iLog->Log(_L("Cmpxalbumartutilitytest::CMPXAlbumArtUtilityDecode")); TRAP( err , iAlbumArtUtility = CMPXAlbumArtUtility::NewL()); @@ -303,7 +303,7 @@ TBufC<50> descriptor16(KTestStr); TPtrC8 sourcepath = MPXUser::Ptr(descriptor16); - CFbsBitmap* iDestBMP; + CFbsBitmap* iDestBMP( NULL ); TRAP(err,iDestBMP = new(ELeave) CFbsBitmap()); iLog->Log(_L("Cmpxalbumartutilitytest::CMPXAlbumArtUtilityDecodeASourceJPG")); iAlbumArtUtility->Decode(iStatus,sourcepath,*iDestBMP,TSize(1,1)); @@ -364,9 +364,9 @@ { TInt err=KErrNone; TRequestStatus iStatus(0); - CFbsBitmap* iSourceBMP; + CFbsBitmap* iSourceBMP( NULL ); TRAP(err,iSourceBMP=new(ELeave) CFbsBitmap()); - CFbsBitmap* iDestBMP; + CFbsBitmap* iDestBMP( NULL ); TRAP(err,iDestBMP=new(ELeave) CFbsBitmap()); iLog->Log(_L("Cmpxalbumartutilitytest::CMPXAlbumArtUtilityScale")); @@ -440,7 +440,7 @@ TBuf<50> KTestStr; KTestStr.Append(Kmpxalbumartutilitytest_testPath); KTestStr.Append(string); - CFbsBitmap* iSourceBMP; + CFbsBitmap* iSourceBMP( NULL ); TRAP(err , iSourceBMP = new(ELeave) CFbsBitmap()); iSourceBMP->Load(KTestStr); iLog->Log(_L("Cmpxalbumartutilitytest::CMPXAlbumArtUtilityEncodeL")); diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_collection_utility_api/tsrc/collectionplaylisttest/src/mpxcollectionplaylisttestBlocks.cpp --- a/mmappfw_plat/mpx_collection_utility_api/tsrc/collectionplaylisttest/src/mpxcollectionplaylisttestBlocks.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappfw_plat/mpx_collection_utility_api/tsrc/collectionplaylisttest/src/mpxcollectionplaylisttestBlocks.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -353,7 +353,7 @@ if ((err == KErrNone) && firstPlaylist) { // Pass stream to create another instance of playlist - CBufBase* buffer; + CBufBase* buffer( NULL ); TRAP(err,buffer = CBufFlat::NewL( 200 )); CleanupStack::PushL( buffer ); RBufWriteStream writeStream( *buffer ); @@ -1072,7 +1072,7 @@ aAttrs.AppendL(attribut); TInt aChunkSize=0; TRAP( err , iCollectionPlaylist = CMPXCollectionPlaylist::NewL()); - CMPXCollectionOpenUtility* utility; + CMPXCollectionOpenUtility* utility( NULL ); TRAP( err , utility = CMPXCollectionOpenUtility::NewL(iCollectionPlaylist,KMcModeDefault)); TRAP( err , utility->StartL(aAttrs.Array(),aChunkSize)); delete utility; @@ -1093,7 +1093,7 @@ iLog->Log(_L("CMPXCollectionPlaylistTest::CMPXCollectionOpenUtilityPathL")); TInt err = KErrNone; TRAP( err , iCollectionPlaylist = CMPXCollectionPlaylist::NewL()); - CMPXCollectionOpenUtility* utility; + CMPXCollectionOpenUtility* utility( NULL ); TRAP( err , utility = CMPXCollectionOpenUtility::NewL(iCollectionPlaylist,KMcModeDefault)); TRAP( err ,iCollectionPath = utility->PathL()); @@ -1119,7 +1119,7 @@ iLog->Log(_L("CMPXCollectionPlaylistTest::CMPXCollectionOpenUtilityStop")); TInt err = KErrNone; TRAP( err , iCollectionPlaylist = CMPXCollectionPlaylist::NewL()); - CMPXCollectionOpenUtility* utility; + CMPXCollectionOpenUtility* utility( NULL ); TRAP( err , utility = CMPXCollectionOpenUtility::NewL(iCollectionPlaylist,KMcModeDefault)); TRAP( err , utility->Stop()); @@ -1146,7 +1146,7 @@ iLog->Log(_L("CMPXCollectionPlaylistTest::CMPXCollectionOpenUtilitySetDelay")); TInt err = KErrNone; TRAP( err , iCollectionPlaylist = CMPXCollectionPlaylist::NewL()); - CMPXCollectionOpenUtility* utility; + CMPXCollectionOpenUtility* utility( NULL ); TRAP( err , utility = CMPXCollectionOpenUtility::NewL(iCollectionPlaylist,KMcModeDefault)); TInt delay = 10; @@ -1207,7 +1207,7 @@ itemIdArray.Close(); - CMPXCollectionPath* path; + CMPXCollectionPath* path( NULL ); TRAP( err , path = CMPXCollectionPath::NewL(*iCollectionPath)); RArray aAttrs; @@ -1219,7 +1219,7 @@ TMPXAttribute aKeyAttribute = KMPXMediaNullAttribute ; TRAP( err , iCollectionPlaylist = CMPXCollectionPlaylist::NewL()); - CMPXCollectionOpenUtility* utility; + CMPXCollectionOpenUtility* utility( NULL ); TRAP( err , utility = CMPXCollectionOpenUtility::NewL(iCollectionPlaylist,KMcModeIsolated/*KMcModeDefault*/)); TRAP( err , utility->StartL(*path,aAttrs.Array(),aChunkSize,aOffset,direction,aKeyAttribute)); delete utility; @@ -1242,7 +1242,7 @@ iLog->Log(_L("CMPXCollectionPlaylistTest::CMPXCollectionOpenUtilitySetDirection")); TInt err = KErrNone; TRAP( err , iCollectionPlaylist = CMPXCollectionPlaylist::NewL()); - CMPXCollectionOpenUtility* utility; + CMPXCollectionOpenUtility* utility( NULL ); TRAP( err , utility = CMPXCollectionOpenUtility::NewL(iCollectionPlaylist,KMcModeDefault)); CMPXCollectionOpenUtility::TDirection direction = CMPXCollectionOpenUtility::EFetchNormal; TRAP( err , utility->SetDirection(direction)); @@ -1271,7 +1271,7 @@ iLog->Log(_L("CMPXCollectionPlaylistTest::NewLMMPXCollectionUtility")); TInt err = KErrNone; TRAP( err,iCollectionPlaylist = CMPXCollectionPlaylist::NewL()); - MMPXCollectionUtility* collectionUtility; + MMPXCollectionUtility* collectionUtility( NULL ); TRAP( err , collectionUtility = MMPXCollectionUtility::NewL(iCollectionPlaylist,KMcModeDefault)); collectionUtility->Close(); iLog->Log(_L("CMPXCollectionPlaylist::NewLMMPXCollectionUtility OK")); diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_common_api/tsrc/data/mmc/mpxtest1.mp3 Binary file mmappfw_plat/mpx_common_api/tsrc/data/mmc/mpxtest1.mp3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_common_api/tsrc/data/mmc/mpxtest2.mp3 Binary file mmappfw_plat/mpx_common_api/tsrc/data/mmc/mpxtest2.mp3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_common_api/tsrc/data/mmc/testdrm.cm Binary file mmappfw_plat/mpx_common_api/tsrc/data/mmc/testdrm.cm has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testmpxmedia.cpp --- a/mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testmpxmedia.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testmpxmedia.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -227,7 +227,7 @@ return KErrBadTestParameter; } - CMPXMedia* media; + CMPXMedia* media( NULL ); TRAP(err , media= CMPXMedia::NewL()); CleanupStack::PushL(media); media->operator =(*(*iMPXMediaArray)[index]); @@ -1655,7 +1655,7 @@ return KErrBadTestParameter; } - CMPXMedia* media; + CMPXMedia* media( NULL ); TRAP(err,media = CMPXMedia::NewL()); err = iMPXMediaArray->Insert(media, index); if ( err ) @@ -1690,7 +1690,7 @@ return KErrBadTestParameter; } - CMPXMedia* media; + CMPXMedia* media( NULL ); TRAP(err , media= CMPXMedia::NewL()); err = iMPXMediaArray->Insert(*media, index); if ( err ) @@ -1725,7 +1725,7 @@ return KErrBadTestParameter; } - CMPXMedia* media; + CMPXMedia* media( NULL ); TRAP(err , media= CMPXMedia::NewL()); CleanupStack::PushL(media); TRAP(err , iMPXMediaArray->InsertL(media, index)); @@ -1757,7 +1757,7 @@ return KErrBadTestParameter; } - CMPXMedia* media; + CMPXMedia* media( NULL ); TRAP(err , media= CMPXMedia::NewL()); CleanupStack::PushL(media); TRAP(err , iMPXMediaArray->InsertL(*media, index)); @@ -1789,7 +1789,7 @@ return KErrBadTestParameter; } - CMPXMedia* media; + CMPXMedia* media( NULL ); TRAP(err , media= CMPXMedia::NewL()); CleanupStack::PushL(media); iMPXMediaArray->Set(*media, index); @@ -1864,7 +1864,7 @@ return KErrBadTestParameter; } - CMPXMedia* media; + CMPXMedia* media( NULL ); TRAP(err , media= CMPXMedia::NewL()); CleanupStack::PushL(media); TRAP(err,iMPXMediaArray->AppendL(media)); @@ -1907,7 +1907,7 @@ TInt& aTotal=total; TInt& aUsed=used; - CMPXMedia* media; + CMPXMedia* media( NULL ); TRAP(err , media= CMPXMedia::NewL()); CleanupStack::PushL(media); TRAP(err,iMPXMediaArray->AppendL(media)); @@ -1932,7 +1932,7 @@ TInt err = KErrNone; TUint index=0; - CMPXMedia* media; + CMPXMedia* media( NULL ); TRAP(err , media= CMPXMedia::NewL()); CleanupStack::PushL(media); TRAP(err,iMPXMediaArray->AppendL(media)); @@ -1956,7 +1956,7 @@ TInt err = KErrNone; TUint index=0; - CMPXMedia* media; + CMPXMedia* media( NULL ); TRAP(err , media= CMPXMedia::NewL()); CleanupStack::PushL(media); TRAP(err ,iMPXMediaArray->AppendL(media)); diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testmpxmessagequeue.cpp --- a/mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testmpxmessagequeue.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testmpxmessagequeue.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -101,7 +101,7 @@ FTRACE(FPrint(_L("CCommonTestClass::AddCMPXMessageQueue testing CMPXMessageQueue::Add begin"))); iLog->Log(_L("CCommonTestClass::AddCMPXMessageQueue testing CMPXMessageQueue::Add begin")); TInt err = KErrNone; - CMPXMessage *message; + CMPXMessage *message( NULL ); TRAP(err , message = CMPXMessage::NewL()); iMessageQueue->Add(message, err); delete message; diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testmpxuser.cpp --- a/mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testmpxuser.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testmpxuser.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -376,9 +376,9 @@ iLog->Log(_L("CCommonTestClass::MergeArray testing MPXUser::MergeArray() begin")); TInt err = KErrNone; - CDesCArray* src; + CDesCArray* src( NULL ); TRAP(err,src = new(ELeave)CDesCArrayFlat(10)); - CDesCArray* dest; + CDesCArray* dest( NULL ); TRAP(err,dest = new(ELeave)CDesCArrayFlat(20)); TRAP(err , src->AppendL(_L("test"))); MPXUser::MergeArray( *src, *dest ); diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/playback_helper_api/tsrc/data/mmc/asx_seek_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/playback_helper_api/tsrc/data/mmc/asx_seek_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,44 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest Content + + + + + Link 2 + 2008 NokiaTest Content + + + + + Link 3 + 2008 NokiaTest Content + + + + + Link 4 + 2008 NokiaTest Content + + + + + Link 5 + 2008 NokiaTest Content + + + + + Link 6 + 2008 NokiaTest Content + + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/playback_helper_api/tsrc/data/mmc/asx_v2.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/playback_helper_api/tsrc/data/mmc/asx_v2.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,5 @@ +[Reference] +Ref1=http://10.48.2.56:443/WMTest/256k_WMV9_QCIF_WMA9_30fps.wmv?MSWMExt=.asf +Ref2=http://10.48.2.56:443/WMTest/KennyRogers-LoveLiftedMe.wma?MSWMExt=.asf + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/playback_helper_api/tsrc/data/mmc/asx_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/playback_helper_api/tsrc/data/mmc/asx_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,80 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest Content + + + + + Link 2 + 2008 NokiaTest Content + + + + + Link 3 + 2008 NokiaTest Content + + + + + Link 4 + 2008 NokiaTest Content + + + + + Link 5 + 2008 NokiaTest Content + + + + + Link 6 + 2008 NokiaTest Content + + + + + Link 7 + 2008 NokiaTest Content + + + + + Link 8 + 2008 NokiaTest Content + + + + + Link 9 + 2008 NokiaTest Content + + + + + Link 10 + 2008 NokiaTest Content + + + + + Link 11 + 2008 NokiaTest Content + + + + + Link 12 + 2008 NokiaTest Content + + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/playback_helper_api/tsrc/data/mmc/multiple_streaming_link.ram --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/playback_helper_api/tsrc/data/mmc/multiple_streaming_link.ram Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,6 @@ +rtsp://1.1.1.1/1.3gp +rtsp://1.1.1.1/2.rm +rtsp://1.1.1.1/3.3gp +rtsp://1.1.1.1/4.rm +rtsp://1.1.1.1/5.3gp +rtsp://1.1.1.1/6.rm diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/playback_helper_api/tsrc/data/mmc/test.3gp Binary file mmappfw_plat/playback_helper_api/tsrc/data/mmc/test.3gp has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/playlist_engine_api/tsrc/data/mmc/mpxtest1.mp3 Binary file mmappfw_plat/playlist_engine_api/tsrc/data/mmc/mpxtest1.mp3 has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/playlist_engine_api/tsrc/data/mmc/mpxtestplaylist.m3u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/playlist_engine_api/tsrc/data/mmc/mpxtestplaylist.m3u Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +#EXTM3U +Sounds\Digital\mpxtest1.mp3 +Sounds\Digital\mpxtest2.mp3 \ No newline at end of file diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/playlist_engine_api/tsrc/playlistenginetest/src/playlistenginetestBlocks.cpp --- a/mmappfw_plat/playlist_engine_api/tsrc/playlistenginetest/src/playlistenginetestBlocks.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappfw_plat/playlist_engine_api/tsrc/playlistenginetest/src/playlistenginetestBlocks.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -382,8 +382,8 @@ RFs fs=RFs(); User::LeaveIfError(fs.Connect()); - CArrayFix* iTopCharacterSet; - CArrayFix* iAvailableCharacterSet; + CArrayFix* iTopCharacterSet( NULL ); + CArrayFix* iAvailableCharacterSet( NULL ); TRAP( err , iAvailableCharacterSet = new (ELeave)CArrayFixFlat(12)); TRAP( err , iTopCharacterSet = new (ELeave)CArrayFixFlat(12)); diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/qt_telephony_multimedia_service_api/group/bld.inf --- a/mmappfw_plat/qt_telephony_multimedia_service_api/group/bld.inf Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappfw_plat/qt_telephony_multimedia_service_api/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -23,6 +23,7 @@ PRJ_EXPORTS ../inc/qtms.h MW_LAYER_PLATFORM_EXPORT_PATH(qtms.h) +../inc/qtmsver.h MW_LAYER_PLATFORM_EXPORT_PATH(qtmsver.h) ../inc/qtmsamrformat.h MW_LAYER_PLATFORM_EXPORT_PATH(qtmsamrformat.h) ../inc/qtmsbuffer.h MW_LAYER_PLATFORM_EXPORT_PATH(qtmsbuffer.h) ../inc/qtmscall.h MW_LAYER_PLATFORM_EXPORT_PATH(qtmscall.h) diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/qt_telephony_multimedia_service_api/inc/qtmsfactory.h --- a/mmappfw_plat/qt_telephony_multimedia_service_api/inc/qtmsfactory.h Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappfw_plat/qt_telephony_multimedia_service_api/inc/qtmsfactory.h Mon Oct 04 00:50:27 2010 +0300 @@ -34,7 +34,7 @@ class QTMSSource; class QTMSSink; class QTMSFactoryImpl; -class QTMSVer; // QTMS version definition +class QTMSVer; class QTMSGlobalRouting; class QTMSDTMF; class QTMSRingTone; @@ -448,7 +448,7 @@ /** * Constructor */ - QTMSFactory(); + QTMSFactory(QTMSVer& ver); private: QTMSFactoryImpl* impl; diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/qt_telephony_multimedia_service_api/inc/qtmsver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/qt_telephony_multimedia_service_api/inc/qtmsver.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: QT Bindings for TMS + * + */ + +#ifndef QTMSVER_H +#define QTMSVER_H + +// Include files +#include + +namespace QTMS { + +/** + * TMSVer class + * + * Contains TMS version information. + * + */ +class QTMSVer + { +public: + + /* + * Constructor + */ + QTMSVer(); + + /* + * Constructor + * + * @param mjr + * Major version number. + * + * @param mnr + * Minor version number. + * + * @param bld + * Build version number. + * + */ + QTMSVer(guint mjr, guint mnr, guint bld) : + ver_major(mjr), + ver_minor(mnr), + ver_build(bld) {} + +public: + guint ver_major; + guint ver_minor; + guint ver_build; + }; + +} //namespace QTMS + +#endif //QTMSVER_H + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/qt_telephony_multimedia_service_api/tsrc/qtmsvoiptest/qtmsvoiptest.cpp --- a/mmappfw_plat/qt_telephony_multimedia_service_api/tsrc/qtmsvoiptest/qtmsvoiptest.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/mmappfw_plat/qt_telephony_multimedia_service_api/tsrc/qtmsvoiptest/qtmsvoiptest.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -778,7 +778,7 @@ QTest::newRow("G729")< (buffer); if (m_ClientSink) { diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/local.3gp Binary file mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/local.3gp has changed diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridMultiple_hw_v2.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridMultiple_hw_v2.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +[Reference] +Ref1=file://e:/testing/data/local.3gp +Ref2=http://10.48.2.56:443/stream.wmv \ No newline at end of file diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridMultiple_hw_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridMultiple_hw_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,19 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest + + + + + Link 2 + 2008 NokiaTest + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridMultiple_v2.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridMultiple_v2.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +[Reference] +Ref1=file://c:/data/videos/local1.3gp +Ref2=http://10.48.2.56:443/stream.wmv \ No newline at end of file diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridMultiple_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridMultiple_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,19 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest + + + + + Link 2 + 2008 NokiaTest + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridlink.ram --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridlink.ram Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,4 @@ +rtsp://stream.3gp +file://c:/data/videos/local.3gp +rtsp://stream1.3gp +file://c:/data/videos/local1.3gp diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridlink_hw.ram --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_hybridlink_hw.ram Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,4 @@ +rtsp://stream.3gp +file://e:/testing/data/local.3gp +rtsp://stream1.3gp +file://e:/testing/data/local1.3gp diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultilink.ram --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultilink.ram Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +file://c:/data/videos/local.3gp +file://c:/data/videos/local1.3gp +file://c:/data/videos/local2.3gp diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultilink_hw.ram --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultilink_hw.ram Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +file://e:/testing/data/local.3gp +file://e:/testing/data/local1.3gp +file://e:/testing/data/local2.3gp diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultiple_hw_v2.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultiple_hw_v2.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +[Reference] +Ref1=file://e:/testing/data/local.3gp +Ref2=file://e:/testing/data/local1.3gp diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultiple_hw_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultiple_hw_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,19 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest + + + + + Link 2 + 2008 NokiaTest + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultiple_v2.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultiple_v2.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +[Reference] +Ref1=file://c:/data/videos/local.3gp +Ref2=file://c:/data/videos/local1.3gp diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultiple_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localMultiple_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,19 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest + + + + + Link 2 + 2008 NokiaTest + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingleLink.ram --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingleLink.ram Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,2 @@ +file://c:/data/videos/local.3gp + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingleLink_hw.ram --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingleLink_hw.ram Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,2 @@ +file://e:/testing/data/local.3gp + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingle_hw_v2.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingle_hw_v2.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +[Reference] +Ref1=file://e:/testing/data/local.3gp + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingle_hw_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingle_hw_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,14 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest Conten + + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingle_v2.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingle_v2.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +[Reference] +Ref1=file://c:/data/videos/local.3gp + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingle_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_localSingle_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,14 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest Conten + + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_multiLink.ram --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_multiLink.ram Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +rtsp://stream1.3gp +rtsp://stream2.3gp +rtsp://stream3.3gp diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_noSeekInfoEmbedded_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_noSeekInfoEmbedded_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,13 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_seekSingle_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_seekSingle_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,13 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_seek_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_seek_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,37 @@ + + Advanced Playlist Demo + More Information at this Web site + + + MSN Web site + + + + + Link 1 + 2008 NokiaTest + + + + + + Visit Our Web site + + + + + Visit the YourImage Web site + The first entry in an advanced playlist + YourImage + (c)2000 YourImage + + + + + Link 3 + 2008 NokiaTest + + + + \ No newline at end of file diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_singleLink.ram --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_singleLink.ram Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,2 @@ +rtsp://stream.3gp + diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_streamingSingle_v2.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_streamingSingle_v2.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,2 @@ +[Reference] +Ref1=http://10.48.2.56:443/stream.wmv \ No newline at end of file diff -r 3b098142db83 -r 92dbd2a406d9 mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_streamingSingle_v3.asx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mmappfw_plat/videoplaylist_utility_api/tsrc/data/mmc/test_streamingSingle_v3.asx Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,13 @@ + + Unknown Abstract Info + Unknown Title + Unknown Author + 2008 by NokiaTest + + + Link 1 + 2008 NokiaTest + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/inc/qtracker.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/inc/qtracker.h Mon Oct 04 00:50:27 2010 +0300 @@ -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: +* +*/ + +#ifndef QTRACKER_H_ +#define QTRACKER_H_ + +class QString; +class QTracker +{ +public: + static void log( const QString& ); +}; + +#endif /*QTRACKER_H_*/ diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/inc/toolbarview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/inc/toolbarview.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,61 @@ +/* +* 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 TOOLBARVIEW_H +#define TOOLBARVIEW_H + +#include + +#include + +class HbAction; +class HbLineEdit; +class HbMenu; +class HbMenuItem; +class HbMainWindow; + +class ToolbarView : public HbView +{ + Q_OBJECT + +public: + ToolbarView(); + ~ToolbarView(); + +private: + int selectedIndex(bool& ok); + +private slots: + void toolbarDemoSlot(); + void toolButtonTriggered(); + void changeOrientation(); + void changeMirroring(); + void setOrientation( HbAction* action ); + void unsetOrientation(); + +private: + bool portraitOrientation; + bool mirrored; + + HbAction *orientationChangeAction; + HbAction *mirroringChangeAction; + HbLineEdit *tooltipLineEdit; + HbLineEdit *textLineEdit; + HbLineEdit *indexLineEdit; +}; + +#endif // TOOLBARVIEW_H diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/inc/welcomeview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/inc/welcomeview.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,52 @@ +/* +* 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 WELCOMEVIEW_H_ +#define WELCOMEVIEW_H_ + +#include +#include + +class HbLabel; +class HbPushButton; +class QSignalMapper; + +class WelcomeView : public HbView + { + + Q_OBJECT + +public: + + WelcomeView(const QString &name = "Welcome!"); + + virtual ~WelcomeView(); + +public slots: + + void setLabelText(int commandId); + +private: + + bool connectButton(HbPushButton *button, int commandId); + + HbLabel *label; + QSignalMapper *mapper; + + }; + +#endif /* WELCOMEVIEW_H_ */ diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/pluginresolvingapp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/pluginresolvingapp.pro Mon Oct 04 00:50:27 2010 +0300 @@ -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: +# +# + +TEMPLATE = app +TARGET = +TARGET.UID3 = +CONFIG += hb qt + +DEPENDPATH += . +INCLUDEPATH += . +INCLUDEPATH += /epoc32/include/domain \ + /epoc32/include/domain/middleware \ + /epoc32/include/domain/applications \ + /orbit/include \ + /epoc32/include/mw + +TARGET.CAPABILITY = ALL -TCB +TARGET.EPOCHEAPSIZE = 0x20000 0x1600000 + +LIBS += -lxqplugins -lmpxviewframeworkqt + +SOURCES += \ + src/main.cpp \ + src/qtracker.cpp \ + src/welcomeview.cpp + +HEADERS += \ + inc/qtracker.h \ + inc/welcomeview.h + + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/src/main.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,97 @@ +/* +* 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 + +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include + +#include + +int main(int argc, char *argv[]) +{ + HbApplication app(argc, argv); + QTracker::log("--- Start ---"); + MpxViewFramework mainWindow; + + HbView *view = new WelcomeView(); + + mainWindow.viewCount(); + + mainWindow.addView(view); + mainWindow.addView(); + + /* LOADING PLUGINS DIRECTLY */ + XQPluginLoader pLoader(0xE1253164); + + QList info; + pLoader.listImplementations("org.nokia.mmdt.TestPlugin/1.0", info); +// QObject *instance = pLoader.instance(); +// PluginViewInterface *viewInterface = qobject_cast(pLoader.instance()); + +// mainWindow.addView(viewInterface->getView()); +// viewInterface->setParent(viewInterface->getView()); + +// HbAction *backAction = new HbAction("Back", &mainWindow); +// mainWindow.addSoftKeyAction( Hb::SecondarySoftKey, backAction ); +// ---- 8< ---- +// mainWindow.addView(new ExampleResolver("welcomeviewplugin.dll")); + + QTracker::log(QString("List available plugins:")); + + for (int i=0; i(obj))); + + MpxPluginViewInterface *interf = qobject_cast(obj); + QTracker::log(QString("casting to PluginViewInterface 0xE1253164: %1").arg(reinterpret_cast(interf))); + + MpxViewPlugin *plugView = interf->viewPlugin(); + QTracker::log(QString("returning QViewPlugin: %1").arg(reinterpret_cast(plugView))); + + QList uids; + uids.append(0x10000000); + uids.append(0xE419BEEE); + + MpxViewPlugin *pluginView2 = mainWindow.resolvePlugin(uids); + QTracker::log(QString("Using MPX resolver: %1").arg(reinterpret_cast(pluginView2))); + +// ---- 8< ---- + + + mainWindow.show(); + return app.exec(); +} + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/src/qtracker.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/src/qtracker.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,29 @@ +/* +* 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 "QTracker.h" +#include +#include + +void QTracker::log( const QString& aString ) +{ + FILE* poFile = fopen( "c:/trace.log", "a" ); + if( !poFile ) + return; + fprintf( poFile, "%s\n", aString.toAscii().constData() ); + fclose( poFile ); +} diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/src/toolbarview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/src/toolbarview.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,264 @@ +/* +* 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 +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "toolbarview.h" + +ToolbarView::ToolbarView() : + HbView(), + portraitOrientation(true), + mirrored(false), + orientationChangeAction(0), + mirroringChangeAction(0) +{ + //setIcon(HbIcon(":/toolbardemo/toolbar")); + setTitle("Toolbar demo view"); + + QGraphicsGridLayout *layout = new QGraphicsGridLayout(); + + QSizePolicy policy(QSizePolicy::Preferred, QSizePolicy::Fixed); + + HbLabel *textLabel = new HbLabel("Text:", this); + textLabel->setSizePolicy(policy); + textLabel->setObjectName("textLabel"); + layout->addItem(textLabel, 0, 0); + + textLineEdit = new HbLineEdit("button text", this); + textLineEdit->setSizePolicy(policy); + textLineEdit->setObjectName("textLineEdit"); + layout->addItem(textLineEdit, 0, 1); + + HbLabel *tooltipLabel = new HbLabel("Tooltip:", this); + tooltipLabel->setSizePolicy(policy); + tooltipLabel->setObjectName("tooltipLabel"); + layout->addItem(tooltipLabel, 1, 0); + + tooltipLineEdit = new HbLineEdit("tooltip text", this); + tooltipLineEdit->setSizePolicy(policy); + tooltipLineEdit->setObjectName("tooltipLineEdit"); + layout->addItem(tooltipLineEdit, 1, 1); + + HbPushButton *addButton = new HbPushButton("Add", this); + addButton->setSizePolicy(policy); + addButton->setObjectName("add"); + layout->addItem(addButton, 2, 0, 1, 2); + connect(addButton, SIGNAL(clicked()), this, SLOT(toolbarDemoSlot())); + + HbPushButton *clearButton = new HbPushButton("Clear", this); + clearButton->setSizePolicy(policy); + clearButton->setObjectName("clear"); + layout->addItem(clearButton, 3, 0, 1, 2); + connect(clearButton, SIGNAL(clicked()), this, SLOT(toolbarDemoSlot())); + + HbPushButton *showButton = new HbPushButton("Show", this); + showButton->setSizePolicy(policy); + showButton->setObjectName("show"); + layout->addItem(showButton, 4, 0, 1, 2); + connect(showButton, SIGNAL(clicked()), this, SLOT(toolbarDemoSlot())); + + HbPushButton *hideButton = new HbPushButton("Hide", this); + hideButton->setSizePolicy(policy); + hideButton->setObjectName("hide"); + layout->addItem(hideButton, 5, 0, 1, 2); + connect(hideButton, SIGNAL(clicked()), this, SLOT(toolbarDemoSlot())); + + HbLabel *indexLabel = new HbLabel("Index:", this); + indexLabel->setSizePolicy(policy); + indexLabel->setObjectName("indexLabel"); + layout->addItem(indexLabel, 6, 0); + + indexLineEdit = new HbLineEdit("0", this); + indexLineEdit->setSizePolicy(policy); + indexLineEdit->setObjectName("indexLineEdit"); + layout->addItem(indexLineEdit, 6, 1); + + HbPushButton *insertButton = new HbPushButton("Insert", this); + insertButton->setSizePolicy(policy); + insertButton->setObjectName("insert"); + layout->addItem(insertButton, 7, 0, 1, 2); + connect(insertButton, SIGNAL(clicked()), this, SLOT(toolbarDemoSlot())); + + HbPushButton *removeButton = new HbPushButton("Remove", this); + removeButton->setSizePolicy(policy); + removeButton->setObjectName("remove"); + layout->addItem(removeButton, 8, 0, 1, 2); + connect(removeButton, SIGNAL(clicked()), this, SLOT(toolbarDemoSlot())); + + HbPushButton *iconButton = new HbPushButton("Icon", this); + iconButton->setSizePolicy(policy); + iconButton->setObjectName("icon"); + layout->addItem(iconButton, 9, 0, 1, 2); + connect(iconButton, SIGNAL(clicked()), this, SLOT(toolbarDemoSlot())); + + setLayout(layout); + + if (orientationChangeAction) { + menu()->addAction(orientationChangeAction); + } else { + orientationChangeAction = menu()->addAction( "Change to landscape (auto)" ); + connect(orientationChangeAction, SIGNAL(triggered()), this, SLOT(changeOrientation())); + } + + if (mirroringChangeAction) { + menu()->addAction(mirroringChangeAction); + } else { + mirroringChangeAction = menu()->addAction( "Turn mirroring on" ); + connect(mirroringChangeAction, SIGNAL(triggered()), this, SLOT(changeMirroring())); + } + + HbMenu *prtOrMenu = menu()->addMenu( "Set orientation" ); + prtOrMenu->addAction( "Vertical" ); + prtOrMenu->addAction( "Horizontal" ); + + connect(prtOrMenu, SIGNAL(triggered(HbAction*)), this, SLOT(setOrientation(HbAction*))); + + HbAction* unsetor = menu()->addAction( "Unset orientation" ); + connect(unsetor, SIGNAL(triggered()), this, SLOT(unsetOrientation())); +} + +ToolbarView::~ToolbarView() +{ +} + +int ToolbarView::selectedIndex(bool& ok) +{ + ok = true; + bool valid = false; + QString str = indexLineEdit->text(); + int value = str.toInt(&valid, 10); + if (!valid && !value) { + ok = false; + } + return value; +} + +void ToolbarView::toolbarDemoSlot() +{ + QString objectName = QObject::sender()->objectName(); + if (objectName == "add") { + toolBar()->show(); + HbAction *action = new HbAction(); + connect(action, SIGNAL(triggered()), this, SLOT(toolButtonTriggered())); + action->setText(textLineEdit->text()); + action->setToolTip(tooltipLineEdit->text()); + action->setIcon(HbIcon(":/toolbardemo/homer.jpg")); + toolBar()->addAction(action); + } else if (objectName == "clear") { + toolBar()->clearActions(); + } else if (objectName == "show") { + toolBar()->show(); + } else if (objectName == "hide") { + toolBar()->hide(); + } else if (objectName == "insert") { + bool ok; + int index = selectedIndex(ok); + + if (ok) { + toolBar()->show(); + HbAction *action = new HbAction(); + connect(action, SIGNAL(triggered()), this, SLOT(toolButtonTriggered())); + action->setText(textLineEdit->text()); + action->setToolTip(tooltipLineEdit->text()); + action->setIcon(HbIcon(":/toolbardemo/homer.jpg")); + + HbAction* before = NULL; + if ( index >= 0 && index < toolBar()->actions().count() ) { + before = (HbAction*)toolBar()->actions()[index]; + } + toolBar()->insertAction(before,action); + } + } else if (objectName == "remove") { + bool ok; + int index = selectedIndex(ok); + if (ok && index >= 0 && index < toolBar()->actions().count()) { + toolBar()->removeAction(toolBar()->actions()[index]); + } + } else if (objectName == "icon") { + bool ok; + int index = selectedIndex(ok); + if (ok && index >= 0 && index < toolBar()->actions().count()) { + HbAction* action = (HbAction*)toolBar()->actions()[index]; + action->setIcon(HbIcon(":/toolbardemo/barney.gif")); + } + } +} + +void ToolbarView::toolButtonTriggered() +{ + HbAction *triggeredAction = static_cast(sender()); + HbCommonNote *note = new HbCommonNote(triggeredAction->text(), HbCommonNote::InformationNoteType); + note->setAttribute(Qt::WA_DeleteOnClose); + //note->setUnfadedItems(Hb::ToolBarItem); + note->setUnfadedItems(Hb::AllItems); +} + +void ToolbarView::changeOrientation() +{ + portraitOrientation = !portraitOrientation; + + if (portraitOrientation) { + orientationChangeAction->setText("Change to landscape (auto)"); + } else { + orientationChangeAction->setText("Change to portrait (auto)"); + } + + // Change application's orientation + hbInstance->setOrientation(portraitOrientation? Qt::Vertical : Qt::Horizontal); +} + +void ToolbarView::changeMirroring() +{ + mirrored = !mirrored; + + if (mirrored) { + mirroringChangeAction->setText("Turn mirroring off"); + } else { + mirroringChangeAction->setText("Turn mirroring on"); + } + + if (mirrored) { + hbInstance->primaryWindow()->setLayoutDirection(Qt::RightToLeft); + } else { + hbInstance->primaryWindow()->setLayoutDirection(Qt::LeftToRight); + } +} + +void ToolbarView::setOrientation( HbAction* action ) +{ + if ( action->text() == "Vertical" ){ + toolBar()->setOrientation( Qt::Vertical ); + } else if ( action->text() == "Horizontal" ) { + toolBar()->setOrientation( Qt::Horizontal ); + } +} + +void ToolbarView::unsetOrientation() +{ + toolBar()->unsetOrientation(); +} diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/src/welcomeview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/app/src/welcomeview.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,106 @@ +/* +* 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 "welcomeview.h" + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +WelcomeView::WelcomeView(const QString &name) +: +HbView() + { + setObjectName(name); + setTitle(name); + mapper = new QSignalMapper(this); + mapper->setParent(this); + + setTitle(title()); + QSizePolicy policy(QSizePolicy::Fixed, QSizePolicy::Fixed); + + QGraphicsGridLayout *layout = new QGraphicsGridLayout(); + + label = new HbLabel(); + label->setSizePolicy(policy); +// label->setAlignment(Qt::AlignCenter); + layout->addItem(label, 7, 1, 3, 1); + + connect(mapper, SIGNAL(mapped(int)), this, SLOT(setLabelText(int))); + + bool result = false; + + HbPushButton *buttonNextSib = new HbPushButton("Right", this); + buttonNextSib->setSizePolicy(policy); + layout->addItem(buttonNextSib, 1, 1, 1, 1); +// connectButton(buttonNextSib, HbViewCommandGoNextSibiling); + + HbPushButton *buttonPreviousSib = new HbPushButton("Left", this); + buttonPreviousSib->setSizePolicy(policy); + layout->addItem(buttonPreviousSib, 2, 1, 1, 1); +// connectButton(buttonPreviousSib, HbViewCommandGoPreviousSibiling); + + + HbPushButton *buttonParent = new HbPushButton("Parent", this); + buttonParent->setSizePolicy(policy); + layout->addItem(buttonParent, 3, 1, 1, 1); +// connectButton(buttonParent, HbViewCommandGoParent); + + HbPushButton *buttonChild = new HbPushButton("Child", this); + buttonChild->setSizePolicy(policy); + layout->addItem(buttonChild, 4, 1, 1, 1); +// connectButton(buttonChild, HbViewCommandGoDefaultChild); + + HbPushButton *buttonForward = new HbPushButton("Forward", this); + buttonForward->setSizePolicy(policy); + layout->addItem(buttonForward, 5, 1, 1, 1); +// connectButton(buttonForward, HbViewCommandGoForward); + + HbPushButton *buttonBack = new HbPushButton("Back", this); + buttonBack->setSizePolicy(policy); + layout->addItem(buttonBack, 6, 1, 1, 1); +// connectButton(buttonBack, HbViewCommandGoBack); + + this->setLayout(layout); + } + +WelcomeView::~WelcomeView() + { + } + +bool WelcomeView::connectButton(HbPushButton *button, int commandId) + { + bool result = connect(button, SIGNAL(clicked()), mapper, SLOT(map())); + if (result) { + mapper->setMapping(button, commandId); + } + return result; + } + +void WelcomeView::setLabelText(int commandId) + { + QString ltext("command id: %1"); + label->setText(ltext.arg(commandId)); + } diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/example_vf_pluginresolving.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/example_vf_pluginresolving.pro Mon Oct 04 00:50:27 2010 +0300 @@ -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: +# +# + +TEMPLATE = subdirs + +CONFIG += ordered + +SUBDIRS = plugins \ + app + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/plugins.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/plugins.pro Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,22 @@ +# +# 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: +# +# + +TEMPLATE = subdirs +CONFIG += ordered + + +SUBDIRS = welcomeviewplugin diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/welcomeviewplugin/inc/welcomeview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/welcomeviewplugin/inc/welcomeview.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,51 @@ +/* +* 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 WELCOMEVIEW_H_ +#define WELCOMEVIEW_H_ + +#include + +class HbLabel; +class HbPushButton; +class QSignalMapper; + +class WelcomeView : public HbView + { + + Q_OBJECT + +public: + + WelcomeView(const QString &name = "Welcome!"); + + virtual ~WelcomeView(); + +public slots: + + void setLabelText(int commandId); + +private: + + bool connectButton(HbPushButton *button, int commandId); + + HbLabel *label; + QSignalMapper *mapper; + + }; + +#endif /* WELCOMEVIEW_H_ */ diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/welcomeviewplugin/inc/welcomeviewplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/welcomeviewplugin/inc/welcomeviewplugin.h Mon Oct 04 00:50:27 2010 +0300 @@ -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: +* +*/ + +#ifndef WELCOMEVIEWPLUGIN_H_ +#define WELCOMEVIEWPLUGIN_H_ + +#include +#include + +class HbView; + +class WelcomeViewPlugin : public MpxViewPlugin + { + Q_OBJECT + +public: + + WelcomeViewPlugin(); + + virtual ~WelcomeViewPlugin(); + + virtual void createView(); + + virtual void destroyView(); + + virtual void activateView(); + + virtual void deactivateView(); + + virtual QGraphicsWidget* getView(); + +public slots: + + virtual void orientationChange(Qt::Orientation orientation); + + virtual void back(); + +private: + + HbView *viewInstance; + + }; + +#endif /* WELCOMEVIEW_H_ */ diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/welcomeviewplugin/src/welcomeview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/welcomeviewplugin/src/welcomeview.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,107 @@ +/* +* 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 "welcomeview.h" + +#include +#include +#include +#include +#include + +#include +#include +#include + +WelcomeView::WelcomeView(const QString &name) +: +HbView() + { + setObjectName(name); + setTitle(name); + mapper = new QSignalMapper(this); + mapper->setParent(this); + + setTitle(title()); + QSizePolicy policy(QSizePolicy::Fixed, QSizePolicy::Fixed); + + QGraphicsGridLayout *layout = new QGraphicsGridLayout(); + + label = new HbLabel(); + label->setSizePolicy(policy); +// label->setAlignment(Qt::AlignCenter); + layout->addItem(label, 7, 1, 3, 1); + + connect(mapper, SIGNAL(mapped(int)), this, SLOT(setLabelText(int))); + + bool result = false; + +/* + HbPushButton *buttonNextSib = new HbPushButton("Right", this); + buttonNextSib->setSizePolicy(policy); + layout->addItem(buttonNextSib, 1, 1, 1, 1); +// connectButton(buttonNextSib, HbViewCommandGoNextSibiling); + + HbPushButton *buttonPreviousSib = new HbPushButton("Left", this); + buttonPreviousSib->setSizePolicy(policy); + layout->addItem(buttonPreviousSib, 2, 1, 1, 1); +// connectButton(buttonPreviousSib, HbViewCommandGoPreviousSibiling); + + + HbPushButton *buttonParent = new HbPushButton("Parent", this); + buttonParent->setSizePolicy(policy); + layout->addItem(buttonParent, 3, 1, 1, 1); +// connectButton(buttonParent, HbViewCommandGoParent); + + HbPushButton *buttonChild = new HbPushButton("Child", this); + buttonChild->setSizePolicy(policy); + layout->addItem(buttonChild, 4, 1, 1, 1); +// connectButton(buttonChild, HbViewCommandGoDefaultChild); + + HbPushButton *buttonForward = new HbPushButton("Forward", this); + buttonForward->setSizePolicy(policy); + layout->addItem(buttonForward, 5, 1, 1, 1); +// connectButton(buttonForward, HbViewCommandGoForward); + + HbPushButton *buttonBack = new HbPushButton("Back", this); + buttonBack->setSizePolicy(policy); + layout->addItem(buttonBack, 6, 1, 1, 1); +// connectButton(buttonBack, HbViewCommandGoBack); + + this->setLayout(layout); +*/ + } + +WelcomeView::~WelcomeView() + { + } + +bool WelcomeView::connectButton(HbPushButton *button, int commandId) + { + bool result = connect(button, SIGNAL(clicked()), mapper, SLOT(map())); + if (result) { + mapper->setMapping(button, commandId); + } + return result; + } + +void WelcomeView::setLabelText(int commandId) + { + QString ltext("command id: %1"); + label->setText(ltext.arg(commandId)); + } + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/welcomeviewplugin/src/welcomeviewplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/welcomeviewplugin/src/welcomeviewplugin.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,59 @@ +/* +* 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 "welcomeviewplugin.h" +#include "welcomeview.h" + +#include + +WelcomeViewPlugin::WelcomeViewPlugin() +{ +} + +WelcomeViewPlugin::~WelcomeViewPlugin() +{ +} + +void WelcomeViewPlugin::createView() +{ +} + +void WelcomeViewPlugin::destroyView() +{ +} + +void WelcomeViewPlugin::activateView() +{ +} + +void WelcomeViewPlugin::deactivateView() +{ +} + +QGraphicsWidget* WelcomeViewPlugin::getView() +{ +} + +void WelcomeViewPlugin::orientationChange(Qt::Orientation orientation) +{ +} + +void WelcomeViewPlugin::back() +{ +} + +XQ_EXPORT_PLUGIN2( welcomeviewplugin, WelcomeViewPlugin ); diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/welcomeviewplugin/welcomeviewplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/example_vf_pluginresolving/plugins/welcomeviewplugin/welcomeviewplugin.pro Mon Oct 04 00:50:27 2010 +0300 @@ -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: +# +# + +TEMPLATE = lib + +CONFIG += qt hb ecomplugin +TARGET.UID3 = 0xE1253164 +TARGET = + +SERVICE.INTERFACE_NAME = org.nokia.mmdt.QViewPlugin/1.0 +SERVICE.CONFIGURATION = "0x10000000

0x30000001

EMPXViewPluginPriorityNormal0x00000003" + +INCLUDEPATH += inc \ + /epoc32/include/mw + +LIBS += -lmpxviewframeworkqt + +HEADERS = inc/welcomeview.h \ + inc/welcomeviewplugin.h + + +SOURCES = src/welcomeviewplugin.cpp \ + src/welcomeview.cpp + +TARGET.CAPABILITY = All -Tcb +symbian:TARGET.EPOCALLOWDLLDATA = 1 + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/tsrc/simpleviewplugin1/simpleviewplugin1.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/tsrc/simpleviewplugin1/simpleviewplugin1.pro Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,46 @@ +# +# 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: +# +# + +TEMPLATE = lib + +CONFIG += qt hb ecomplugin +TARGET.UID3 = 0xE1253177 +TARGET = + +SERVICE.INTERFACE_NAME = org.nokia.mmdt.MpxViewPlugin/1.0 +SERVICE.CONFIGURATION = "0x10000123

0x30000001

EMPXViewPluginPriorityNormal0x00000003" + +INCLUDEPATH += inc \ + /epoc32/include/mw + +DEFINES += SIMPLE_VIEW_NO=1 SVIEW_PLUGIN_ID=simpleviewplugin1 + +LIBS += -lmpxviewframeworkqt + +HEADERS = ../simpleviewpluginsrc/simpleview.h \ + ../simpleviewpluginsrc/simpleviewplugin.h + + +SOURCES = ../simpleviewpluginsrc/simpleviewplugin.cpp \ + ../simpleviewpluginsrc/simpleview.cpp + +symbian { + TARGET.CAPABILITY = All -Tcb + TARGET.EPOCALLOWDLLDATA = 1 + MMP_RULES += EXPORTUNFROZEN +} + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/tsrc/simpleviewplugin2/simpleviewplugin2.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/tsrc/simpleviewplugin2/simpleviewplugin2.pro Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,46 @@ +# +# 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: +# +# + +TEMPLATE = lib + +CONFIG += qt hb ecomplugin +TARGET.UID3 = 0xE1253178 +TARGET = + +SERVICE.INTERFACE_NAME = org.nokia.mmdt.MpxViewPlugin/1.0 +SERVICE.CONFIGURATION = "0x10000123

0x30000001

EMPXViewPluginPriorityHigh0x00000002" + +INCLUDEPATH += inc \ + /epoc32/include/mw + +DEFINES += SIMPLE_VIEW_NO=2 SVIEW_PLUGIN_ID=simpleviewplugin2 + +LIBS += -lmpxviewframeworkqt + +HEADERS = ../simpleviewpluginsrc/simpleview.h \ + ../simpleviewpluginsrc/simpleviewplugin.h + + +SOURCES = ../simpleviewpluginsrc/simpleviewplugin.cpp \ + ../simpleviewpluginsrc/simpleview.cpp + +symbian { + TARGET.CAPABILITY = All -Tcb + TARGET.EPOCALLOWDLLDATA = 1 + MMP_RULES += EXPORTUNFROZEN +} + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/tsrc/simpleviewplugin3/simpleviewplugin3.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/tsrc/simpleviewplugin3/simpleviewplugin3.pro Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,46 @@ +# +# 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: +# +# + +TEMPLATE = lib + +CONFIG += qt hb ecomplugin +TARGET.UID3 = 0xE1253179 +TARGET = + +SERVICE.INTERFACE_NAME = org.nokia.mmdt.MpxViewPlugin/1.0 +SERVICE.CONFIGURATION = "0x10000123

0x30000001

EMPXViewPluginPriorityHighest0x00000001" + +INCLUDEPATH += inc \ + /epoc32/include/mw + +DEFINES += SIMPLE_VIEW_NO=3 SVIEW_PLUGIN_ID=simpleviewplugin3 + +LIBS += -lmpxviewframeworkqt + +HEADERS = ../simpleviewpluginsrc/simpleview.h \ + ../simpleviewpluginsrc/simpleviewplugin.h + + +SOURCES = ../simpleviewpluginsrc/simpleviewplugin.cpp \ + ../simpleviewpluginsrc/simpleview.cpp + +symbian { + TARGET.CAPABILITY = All -Tcb + TARGET.EPOCALLOWDLLDATA = 1 + MMP_RULES += EXPORTUNFROZEN +} + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/tsrc/simpleviewpluginsrc/simpleview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/tsrc/simpleviewpluginsrc/simpleview.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -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: +* +*/ + +#include "simpleview.h" + +#include +#include +#include +#include +#include + +#include +#include +#include + +SimpleView::SimpleView(const QString &name) +: +HbView() + { + setObjectName(name); + setTitle(name); + mapper = new QSignalMapper(this); + mapper->setParent(this); + + setTitle(title()); + QSizePolicy policy(QSizePolicy::Fixed, QSizePolicy::Fixed); + + QGraphicsGridLayout *layout = new QGraphicsGridLayout(); + + label = new HbLabel(); + label->setSizePolicy(policy); + layout->addItem(label, 7, 1, 3, 1); + + connect(mapper, SIGNAL(mapped(int)), this, SLOT(setLabelText(int))); + + bool result = false; + + } + +SimpleView::~SimpleView() + { + } + +bool SimpleView::connectButton(HbPushButton *button, int commandId) + { + bool result = connect(button, SIGNAL(clicked()), mapper, SLOT(map())); + if (result) { + mapper->setMapping(button, commandId); + } + return result; + } + +void SimpleView::setLabelText(int commandId) + { + QString ltext("command id: %1"); + label->setText(ltext.arg(commandId)); + } + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/tsrc/simpleviewpluginsrc/simpleview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/tsrc/simpleviewpluginsrc/simpleview.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,52 @@ +/* +* 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 SIMPLEVIEW_H_ +#define SIMPLEVIEW_H_ + +#include +#include + +class HbLabel; +class HbPushButton; +class QSignalMapper; + +class SimpleView : public HbView + { + + Q_OBJECT + +public: + + SimpleView(const QString &name = "Welcome!"); + + virtual ~SimpleView(); + +public slots: + + void setLabelText(int commandId); + +private: + + bool connectButton(HbPushButton *button, int commandId); + + HbLabel *label; + QSignalMapper *mapper; + + }; + +#endif /* SimpleView_H_ */ diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/tsrc/simpleviewpluginsrc/simpleviewplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/tsrc/simpleviewpluginsrc/simpleviewplugin.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -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: +* +*/ + +#include "simpleviewplugin.h" +#include "simpleview.h" + +#include + +/* +#ifndef SIMPLE_VIEW_NO +#define SIMPLE_VIEW_NO 0; +#endif +*/ + +SimpleViewPlugin::SimpleViewPlugin() : MpxViewPlugin(), viewInstance(0) +{ +} + +SimpleViewPlugin::~SimpleViewPlugin() +{ + delete viewInstance; +} + +MpxViewPlugin *SimpleViewPlugin::viewPlugin() +{ + return this; +} + +void SimpleViewPlugin::createView() +{ +} + +void SimpleViewPlugin::destroyView() +{ +} + +void SimpleViewPlugin::activateView() +{ +} + +void SimpleViewPlugin::deactivateView() +{ +} + +QGraphicsWidget* SimpleViewPlugin::getView() +{ + if (viewInstance==0) { + viewInstance = new SimpleView(QString("Simpleview#%1").arg(SIMPLE_VIEW_NO)); + } + return viewInstance; +} + +void SimpleViewPlugin::orientationChange(Qt::Orientation orientation) +{ +} + +void SimpleViewPlugin::back() +{ +} + +XQ_EXPORT_PLUGIN2(SVIEW_PLUGIN_ID, SimpleViewPlugin); diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/tsrc/simpleviewpluginsrc/simpleviewplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/tsrc/simpleviewpluginsrc/simpleviewplugin.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,61 @@ +/* +* 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 SIMPLEVIEWLUGIN_H_ +#define SIMPLEVIEWPLUGIN_H_ + +#include +#include + +class HbView; + +class SimpleViewPlugin : public MpxViewPlugin, public MpxPluginViewInterface + { + Q_INTERFACES(MpxPluginViewInterface) + Q_OBJECT + +public: + + SimpleViewPlugin(); + + virtual ~SimpleViewPlugin(); + + virtual void createView(); + + virtual void destroyView(); + + virtual void activateView(); + + virtual void deactivateView(); + + virtual QGraphicsWidget* getView(); + + virtual MpxViewPlugin *viewPlugin(); + +public slots: + + virtual void orientationChange(Qt::Orientation orientation); + + virtual void back(); + +private: + + HbView *viewInstance; + + }; + +#endif /* SIMPLEVIEWLUGIN_H_ */ diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/tsrc/src/src.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/tsrc/src/src.pro Mon Oct 04 00:50:27 2010 +0300 @@ -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: +# +# + +TEMPLATE = app +TARGET = tst_mpxviewframeworkqt + +CONFIG += qtestlib console hb + +INCLUDEPATH += . +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ + /epoc32/include/mw/qt \ + /epoc32/include/mw/qttest + +SOURCES += tst_mpxviewframework.cpp + + +LIBS += -lmpxviewframeworkqt -lxqplugins + +symbian { + + TARGET.CAPABILITY = ALL -TCB + +} + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/tsrc/src/tst_mpxviewframework.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/tsrc/src/tst_mpxviewframework.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,128 @@ +/* +* 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 +#include +#include + +#include + +#include +#include +#include + +class TestMpxViewFramework : public QObject +{ + Q_OBJECT + +public: + TestMpxViewFramework(): QObject(), fw(0) {}; + +private slots: + + void initTestCase(); + void cleanupTestCase(); + + void init(); + void cleanup(); + + void testDryPluginViewInstance(); + + void testMpxResolver(); + +private: + + void testMpxPlugViewInstance(MpxViewPlugin *plugin); + +public: + MpxViewFramework* fw; +}; + +void TestMpxViewFramework::initTestCase() +{ +} + +void TestMpxViewFramework::cleanupTestCase() +{ +} + +void TestMpxViewFramework::init() +{ + fw = new MpxViewFramework(); + QVERIFY(fw != 0); +} + +void TestMpxViewFramework::cleanup() +{ + delete fw; +} + +// = = Actual Tests = = + +void TestMpxViewFramework::testDryPluginViewInstance() +{ + // #1 instantiate it as real plugin + + QList uidList; + uidList << 0xE1253177 << 0xE1253178 << 0xE1253179; + + foreach (int uid, uidList) { + XQPluginLoader pluginLoader(uid); + QObject *objInstance = pluginLoader.instance(); + QVERIFY(objInstance != 0); + + MpxPluginViewInterface *interfaceInstance = qobject_cast(objInstance); + QVERIFY(interfaceInstance != 0); + + MpxViewPlugin *plugView = interfaceInstance->viewPlugin(); + QVERIFY(plugView != 0); + + HbView *view = qobject_cast(plugView->getView()); + qDebug(view->title().toLatin1().data()); + + pluginLoader.unload(); + } + +} + +void TestMpxViewFramework::testMpxResolver() +{ + QList uids; + + uids.append( 0x10000123 ); + uids.append( 0x30000001 ); + + MpxViewPlugin *plugin = fw->resolvePlugin(uids); + QVERIFY(plugin != 0); + + HbView *view = qobject_cast(plugin->getView()); + qDebug(view->title().toLatin1().data()); + +} + +void TestMpxViewFramework::testMpxPlugViewInstance(MpxViewPlugin *plugin) +{ + QVERIFY(plugin != 0); + QGraphicsWidget *widget = plugin->getView(); + QVERIFY(widget != 0); +} + + + +QTEST_MAIN(TestMpxViewFramework) + +#include "tst_mpxviewframework.moc" diff -r 3b098142db83 -r 92dbd2a406d9 mpx/mpxviewframeworkqt/tsrc/tsrc.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/mpxviewframeworkqt/tsrc/tsrc.pro Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,29 @@ +# +# 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: +# +# + +TEMPLATE=subdirs + +CONFIG += ordered + +SUBDIRS = \ + simpleviewplugin1 \ + simpleviewplugin2 \ + simpleviewplugin3 \ + src + +TARGET = tst_mpxviewframeworkqt + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectionhelpertest/bwinscw/collectionhelpertestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectionhelpertest/bwinscw/collectionhelpertestu.def Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &) + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectionhelpertest/eabi/collectionhelpertestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectionhelpertest/eabi/collectionhelpertestu.def Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectionhelpertest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectionhelpertest/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2002 - 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 collectionhelpertest. +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +collectionhelpertest.mmp + +PRJ_MMPFILES + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectionhelpertest/group/collectionhelpertest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectionhelpertest/group/collectionhelpertest.mmp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2002 - 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: Scripted Tests for MPXCollectionHelper +* +*/ + +#include + +TARGET collectionhelpertest.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE collectionhelpertest.cpp +SOURCE collectionhelpertestblocks.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../common/inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY efsrv.lib +LIBRARY mpxcollectionutility.lib +LIBRARY mpxcommon.lib +LIBRARY mpxcollectionhelper.lib +LIBRARY bafl.lib +LIBRARY estor.lib +LIBRARY basetest.lib + +#if defined(ARMCC) +#elif defined(WINSCW) +deffile ../bwinscw/ +#endif + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectionhelpertest/inc/collectionhelpertest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectionhelpertest/inc/collectionhelpertest.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,237 @@ +/* +* Copyright (c) 2002 - 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: Scripted Tests for MPXCollectionHelper +* +*/ + +#ifndef COLLECTIONHELPERTEST_H +#define COLLECTIONHELPERTEST_H + + +#include +#include +#include +#include +#include +#include "mpxcollectionhelper.h" +#include "mpxcollectionhelperfactory.h" +#include "mpxcollectionhelperobserver.h" +#include "mpxcollectionuihelper.h" +#include "mpxcollectionuihelperobserver.h" +#include "basetest.h" + + + +// Logging path +#ifdef __WINSCW__ +_LIT( KCollectionHelperTestLogPath, "\\logs\\testframework\\CollectionHelperTest\\" ); +#else +_LIT( KCollectionHelperTestLogPath, "e:\\logs\\testframework\\CollectionHelperTest\\" ); +#endif + +// Log file +_LIT( KCollectionHelperTestLogFile, "CollectionHelperTest.txt" ); + + +/** +* CCollectionHelperTest test class for STIF Test Framework TestScripter. +* +*/ +NONSHARABLE_CLASS(CCollectionHelperTest) : public CBaseTest, + public MMPXCollectionHelperObserver, + public MMPXCHelperObserver, + public MMPXCHelperEmbeddedOpenObserver, + public MMPXCollectionObserver, + public MMPXCollectionRemoveObserver, + public MMPXCollectionFindObserver + + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCollectionHelperTest* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CCollectionHelperTest(); + + public: // New functions + + /** + * Callback function to signal that adding a file is complete + * @param aErr, error of the operation + */ + virtual void HandleAddFileCompleteL( TInt aErr ); + + /** + * Generic Observer class for the ui helper + * A single callback function, but usable for all collection helper callbacks + */ + virtual void HandleOperationCompleteL( TCHelperOperation aOperation, + TInt aErr, + void* aArgument ); + + /** + * Callback to the observer for embedded OpenL() result + * @param aErr, error for the operation, KErrNone if successful + * @param aCategory, category of the file opened + */ + virtual void HandleEmbeddedOpenL( TInt aErr, + TMPXGeneralCategory aCategory ); + + /** + * From MMPXCollectionObserver + * Handle extended media properties + * @param aMedia media + * @param aError error code + */ + void HandleCollectionMediaL( + const CMPXMedia& aMedia, + TInt aError); + + /** + * From MMPXCollectionObserver + * Handle collection message + * @param aMessage collection message + */ + void HandleCollectionMessageL(const CMPXMessage& aMsg); + + /** + * From MMPXCollectionObserver + * Handles the collection entries being opened. Typically called + * when client has Open()'d a folder + * + * @param aEntries collection entries opened + * @param aIndex focused entry + * @param aComplete ETrue no more entries. EFalse more entries + * expected + * @param aError error code + */ + void HandleOpenL(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + + /** + * From MMPXCollectionObserver + * Handles the item being opened. Typically called + * when client has Open()'d an item. Client typically responds by + * 'playing' the item via the playlist + * + * @param aPlaylist collection playlist, owner ship is transfered + * @param aError error code + */ + void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError); + + + void HandleCommandComplete(CMPXCommand* aCommandResult, TInt aError); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + private: + + /** + * C++ default constructor. + */ + CCollectionHelperTest( CTestModuleIf& aTestModuleIf ); + + /** + * 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& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Test methods are listed below. + */ + + TInt OpenCollectionUtilityL(CStifItemParser& /*aItem*/); + TInt NewUiHelperL(CStifItemParser& /*aItem*/); + TInt NewHelperL(CStifItemParser& /*aItem*/); + TInt NewCachedHelperL(CStifItemParser& /*aItem*/); + TInt CloseUiHelperL(CStifItemParser& /*aItem*/); + TInt CloseHelperL(CStifItemParser& /*aItem*/); + TInt CloseCachedHelperL(CStifItemParser& /*aItem*/); + TInt AddFileL(CStifItemParser& /*aItem*/); + TInt AddMediaL(CStifItemParser& /*aItem*/); + TInt RemoveFileL(CStifItemParser& /*aItem*/); + TInt RemoveAllL(CStifItemParser& /*aItem*/); + TInt CleanupDeletedMediasL(CStifItemParser& /*aItem*/); + TInt SetMediaL(CStifItemParser& /*aItem*/); + TInt RenameUriL(CStifItemParser& /*aItem*/); + TInt GetFileL(CStifItemParser& /*aItem*/); + TInt GetFile2L(CStifItemParser& /*aItem*/); + TInt FindAllL(CStifItemParser& /*aItem*/); + + /** + * From MMPXCollectionRemoveObserver + * Handles removing a collection path + * calls back with the list of file paths that were deleted + * This callback is only applicable for local file storage plugins. + * + * @param aUriArray, list of files that were deleted + */ + void HandleRemoveL(MDesCArray& aUriArray, TInt aError); + + //*********************************************************************** + + /** + * From MMPXCollectionFindObserver + * Handle callback for "find" operation + * @param aEntries, CMPXMedia to be returned + * @param aComplete ETrue no more entries. EFalse more entries + * expected + * @param aError error code + */ + void HandleFindAllL(const CMPXMedia& aResults, TBool aComplete, + TInt aError); + + void CreateTestMediaL( CMPXMedia*& aNewProperty ); + + private: // Data + + MMPXCollectionUtility* iCollectionUtility; + + //NewUiHelperL() + MMPXCollectionUiHelper* iUIHelper; + + //NewHelperL() + MMPXCollectionHelper* iHelper; + + //NewCachedHelperL() + MMPXCollectionHelper* iCachedHelper; + }; + +#endif // COLLECTIONHELPERTEST_H + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectionhelpertest/src/collectionhelpertest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectionhelpertest/src/collectionhelpertest.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2002 - 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: Scripted STIF cases for MPXCollectionHelper +* +*/ + +// INCLUDE FILES +#include +#include "collectionhelpertest.h" + + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CCollectionHelperTest::CCollectionHelperTest +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCollectionHelperTest::CCollectionHelperTest( CTestModuleIf& aTestModuleIf ): + CBaseTest( aTestModuleIf ) + { + } + +CCollectionHelperTest::~CCollectionHelperTest() + { + // Delete resources allocated from test methods + Delete(); + + iCollectionUtility->Close(); + iCollectionUtility = NULL; + } + +// ----------------------------------------------------------------------------- +// CCollectionHelperTest::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCollectionHelperTest* CCollectionHelperTest::NewL( + CTestModuleIf& aTestModuleIf ) + { + CCollectionHelperTest* self = new (ELeave) CCollectionHelperTest( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CCollectionHelperTest::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCollectionHelperTest::ConstructL() + { + CBaseTest::ConstructL(); + + iLog = CStifLogger::NewL( KCollectionHelperTestLogPath, + KCollectionHelperTestLogFile, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + iCollectionUtility = MMPXCollectionUtility::NewL(this, KMcModeDefault); + } + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CCollectionHelperTest::NewL( aTestModuleIf ); + + } + +// ----------------------------------------------------------------------------- +// E32Dll is a DLL entry point function. +// Returns: KErrNone +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 // Hide Dll entry point to EKA2 +GLDEF_C TInt E32Dll( + TDllReason /*aReason*/) // Reason code + { + return(KErrNone); + + } +#endif // EKA2 + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectionhelpertest/src/collectionhelpertestblocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectionhelpertest/src/collectionhelpertestblocks.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,523 @@ +/* +* Copyright (c) 2002 - 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: Scripted STIF cases for MPXCollectionHelper +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include "collectionhelpertest.h" +#include +#include +#include +#include +#include +#include +#include +#include + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCollectionHelperTest::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CCollectionHelperTest::Delete() + { + FTRACE(FPrint(_L("CTunerUtilityTest::Delete"))); + + iExpectedEvents.Close(); + iOcurredEvents.Close(); + + iLog->Log(_L("Deleting test class...")); + iLog->Log(_L("")); + iLog->Log(_L("")); + + if(iUIHelper) + { + //delete iUIHelper; + iUIHelper = NULL; + } + if(iHelper) + { + //delete iHelper; + iHelper = NULL; + } + if(iCachedHelper) + { + //delete iCachedHelper; + iCachedHelper = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CCollectionHelperTest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CCollectionHelperTest::RunMethodL( CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + + ENTRY( "OpenCollectionUtility", CCollectionHelperTest::OpenCollectionUtilityL ), + ENTRY( "NewUiHelper", CCollectionHelperTest::NewUiHelperL ), + ENTRY( "NewHelper", CCollectionHelperTest::NewHelperL ), + ENTRY( "NewCachedHelper", CCollectionHelperTest::NewCachedHelperL ), + ENTRY( "CloseUiHelper", CCollectionHelperTest::CloseUiHelperL ), + ENTRY( "CloseHelper", CCollectionHelperTest::CloseHelperL ), + ENTRY( "CloseCachedHelper", CCollectionHelperTest::CloseCachedHelperL ), + ENTRY( "AddFile", CCollectionHelperTest::AddFileL), + ENTRY( "AddMedia", CCollectionHelperTest::AddMediaL ), + ENTRY( "RemoveFile", CCollectionHelperTest::RemoveFileL ), + ENTRY( "RemoveAll", CCollectionHelperTest::RemoveAllL ), + ENTRY( "CleanupDeletedMedias", CCollectionHelperTest::CleanupDeletedMediasL ), + ENTRY( "SetMedia", CCollectionHelperTest::SetMediaL ), + ENTRY( "RenameUri", CCollectionHelperTest::RenameUriL ), + ENTRY( "GetFile", CCollectionHelperTest::GetFileL ), + ENTRY( "GetFile2", CCollectionHelperTest::GetFile2L ), + ENTRY( "FindAll", CCollectionHelperTest::FindAllL ), + //ADD NEW ENTRY HERE + // [test cases entries] - Do not remove + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +TInt CCollectionHelperTest::OpenCollectionUtilityL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::OpenCollectionUtilityL"))); + iLog->Log(_L("CCollectionHelperTest::OpenCollectionUtilityL")); + + TRAPD( result, iCollectionUtility->Collection().OpenL() ); + + if( KErrNone == result ) + { + AddExpectedEvent( EColHandleCollectionMessage, KMediumTimeout ); + AddExpectedEvent( EColHandleOpen, KMediumTimeout ); + } + + return result; + } + + +TInt CCollectionHelperTest::NewUiHelperL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::NewUiHelperL"))); + iLog->Log(_L("CCollectionHelperTest::NewUiHelperL")); + + TRAPD( result, + iUIHelper = CMPXCollectionHelperFactory::NewCollectionUiHelperL() ); + + return result; + } + + +TInt CCollectionHelperTest::NewHelperL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::NewHelperL"))); + iLog->Log(_L("CCollectionHelperTest::NewHelperL")); + + TRAPD( result, + iHelper = CMPXCollectionHelperFactory::NewCollectionHelperL() ); + + return result; + } + +TInt CCollectionHelperTest::NewCachedHelperL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::NewCachedHelperL"))); + iLog->Log(_L("CCollectionHelperTest::NewCachedHelperL")); + + TRAPD( result, + iCachedHelper = + CMPXCollectionHelperFactory::NewCollectionCachedHelperL() ); + + return result; + } + +TInt CCollectionHelperTest::CloseUiHelperL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::CloseUiHelperL"))); + iLog->Log(_L("CCollectionHelperTest::CloseUiHelperL")); + + TRAPD( result, iUIHelper->Close() ); + + return result; + } + +TInt CCollectionHelperTest::CloseHelperL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::CloseHelperL"))); + iLog->Log(_L("CCollectionHelperTest::CloseHelperL")); + + TRAPD( result, iHelper->Close() ); + + return result; + } + +TInt CCollectionHelperTest::CloseCachedHelperL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::CloseCachedHelperL"))); + iLog->Log(_L("CCollectionHelperTest::CloseCachedHelperL")); + + TRAPD( result, iCachedHelper->Close() ); + + return result; + } + +TInt CCollectionHelperTest::AddFileL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::AddFileL"))); + iLog->Log(_L("CCollectionHelperTest::AddFileL")); + + TRAPD( result, iHelper->AddL( KTestFile, this ) ); + + if( KErrNone == result ) + { + AddExpectedEvent( EColHandleAddFileComplete, KMediumTimeout ); + } + + return result; + } + +TInt CCollectionHelperTest::AddMediaL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::AddMediaL"))); + iLog->Log(_L("CCollectionHelperTest::AddMediaL")); + + CMPXMedia* media( NULL ); + CreateTestMediaL( media ); + CleanupStack::PushL( media ); + + TRAPD( result, iHelper->AddL( media ) ); + + CleanupStack::PopAndDestroy( media ); + + return result; + }; + +TInt CCollectionHelperTest::RemoveFileL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::RemoveFileL"))); + iLog->Log(_L("CCollectionHelperTest::RemoveFileL")); + TRAPD( result, iHelper->RemoveL( KTestFile ) ); + + //if( KErrNone == result ) + // { + // AddExpectedEvent( EHandleRemove, KMediumTimeout ); + // } + + return result; + } + +TInt CCollectionHelperTest::RemoveAllL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::RemoveAllL"))); + iLog->Log(_L("CCollectionHelperTest::RemoveAllL")); + + TRAPD( result, iHelper->RemoveAllL() ); + + //if( KErrNone == result ) + // { + // AddExpectedEvent( EHandleRemove, KMediumTimeout ); + // } + + return result; + } + +TInt CCollectionHelperTest::CleanupDeletedMediasL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::CleanupDeletedMediasL"))); + iLog->Log(_L("CCollectionHelperTest::CleanupDeletedMediasL")); + + TRAPD( result, iHelper->CleanupDeletedMediasL() ); + + // This method is unsupported. + result = (result == KErrNotSupported) ? KErrNone : result; + return result; + } + +TInt CCollectionHelperTest::SetMediaL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::SetMediaL"))); + iLog->Log(_L("CCollectionHelperTest::SetMediaL")); + + CMPXMedia* media( NULL ); + CreateTestMediaL( media ); + CleanupStack::PushL( media ); + + TRAPD( result, iHelper->SetL( media ) ); + + CleanupStack::PopAndDestroy( media ); + + return result; + } + +TInt CCollectionHelperTest::RenameUriL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::RenameUriL"))); + iLog->Log(_L("CCollectionHelperTest::RenameUriL")); + + TRAPD( result, iHelper->RenameL( KRenameOldUri,KRenameNewUri ) ); + + return result; + } + +TInt CCollectionHelperTest::GetFileL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::GetFileL"))); + iLog->Log(_L("CCollectionHelperTest::GetFileL")); + + RArray attrs; + CleanupClosePushL( attrs ); + + CMPXMedia* theFile = NULL; + TRAPD( result, theFile = iHelper->GetL( KTestFile, attrs.Array() ) ); + if(theFile) + { + delete theFile; + } + + CleanupStack::PopAndDestroy( &attrs ); // attrs + + return result; + } + +TInt CCollectionHelperTest::GetFile2L(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::GetFile2L"))); + iLog->Log(_L("CCollectionHelperTest::GetFile2L")); + + TRAPD( result, const CMPXMedia& theFile = iHelper->GetL( KTestFile ) ); + + // This method is unsupported. + result = (result == KErrNotSupported) ? KErrNone : result; + return result; + } + +TInt CCollectionHelperTest::FindAllL(CStifItemParser& /*aItem*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::FindAllL"))); + iLog->Log(_L("CCollectionHelperTest::FindAllL")); + + RArray attrs; + CleanupClosePushL( attrs ); + + CMPXMedia* media( NULL ); + CreateTestMediaL( media ); + CleanupStack::PushL( media ); + + CMPXMedia* allMedia = NULL; + TRAPD( result, allMedia = iHelper->FindAllL( *media, attrs.Array() ) ); + if(allMedia) + { + delete allMedia; + } + + CleanupStack::PopAndDestroy( media ); + CleanupStack::PopAndDestroy( &attrs ); // attrs + + return result; + } + +void CCollectionHelperTest::CreateTestMediaL( CMPXMedia*& aNewProperty ) + { + RArray contentIDs; + contentIDs.AppendL( KMPXMediaIdGeneral ); + contentIDs.AppendL( KMPXMediaIdAudio ); + contentIDs.AppendL( KMPXMediaIdMusic ); + contentIDs.AppendL( KMPXMediaIdDrm ); + + aNewProperty = NULL; + CMPXMedia* media = CMPXMedia::NewL( contentIDs.Array() ); + CleanupStack::PushL( media ); + contentIDs.Close(); + + // CMPXMedia default types + media->SetTObjectValueL( KMPXMediaGeneralType, + EMPXItem ); + media->SetTObjectValueL( KMPXMediaGeneralCategory, + EMPXSong ); + media->SetTextValueL( KMPXMediaGeneralUri, KTestFile() ); + + // Title, default is file name + media->SetTextValueL( KMPXMediaGeneralTitle, KTestFile() ); + + // Default album track + media->SetTextValueL( KMPXMediaMusicAlbumTrack, KNullDesC ); + + // Set the Mime Type and collection UID + media->SetTextValueL( KMPXMediaGeneralMimeType, KTestFileMimeType() ); + //media->SetTObjectValueL( KMPXMediaGeneralCollectionId, ); + + // Set the pointers now that the object is ready + CleanupStack::Pop( media ); + aNewProperty = media; + } + +// --------------------------------------------------------------------------- +// Handle collection message +// --------------------------------------------------------------------------- +// +void CCollectionHelperTest::HandleCollectionMessageL(const CMPXMessage& aMsg) + { + FTRACE(FPrint(_L("CCollectionHelperTest::HandleCollectionMessageL"))); + iLog->Log(_L("CCollectionHelperTest::HandleCollectionMessageL")); + + if( aMsg.IsSupported(KMPXMessageGeneralEvent) && + aMsg.IsSupported(KMPXMessageGeneralType) ) + { + TMPXCollectionMessage::TEvent event = + *aMsg.Value( KMPXMessageGeneralEvent ); + TInt type = *aMsg.Value( KMPXMessageGeneralType ); + TInt data = *aMsg.Value( KMPXMessageGeneralData ); + + TMPXCollectionMessage message(event, type, data); + if(message.Event() == TMPXCollectionMessage::EPathChanged && + message.Type() == EMcPathChangedByOpen) + { + iCollectionUtility->Collection().OpenL(); + + this->ProcessEvent(EColHandleCollectionMessage, KErrNone); + } + } + } + +// --------------------------------------------------------------------------- +// Handles the collection entries being opened. Typically called +// when client has Open()'d a folder +// --------------------------------------------------------------------------- +// +void CCollectionHelperTest::HandleOpenL(const CMPXMedia& /*aEntries*/, + TInt /*aIndex*/, TBool aComplete,TInt aError) + { + FTRACE(FPrint(_L("CCollectionHelperTest::HandleOpenL"))); + iLog->Log(_L("CCollectionHelperTest::HandleOpenL")); + + this->ProcessEvent(EColHandleOpen, aError); + } + +// --------------------------------------------------------------------------- +// Handles the item being opened. Typically called +// when client has Open()'d an item. Client typically responds by +// 'playing' the item via the playlist +// --------------------------------------------------------------------------- +void CCollectionHelperTest::HandleOpenL( + const CMPXCollectionPlaylist& /*aPlaylist*/, TInt /*aError*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::HandleOpenL"))); + iLog->Log(_L("CCollectionHelperTest::HandleOpenL")); + } + +// --------------------------------------------------------------------------- +// Handle completion of a asynchronous command +// --------------------------------------------------------------------------- +void CCollectionHelperTest::HandleCommandComplete( + CMPXCommand* /*aCommandResult*/, TInt /*aError*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::HandleCommandComplete"))); + iLog->Log(_L("CCollectionHelperTest::HandleCommandComplete")); + + Signal(); + iTimeoutController->Cancel(); + } + +// --------------------------------------------------------------------------- +// Handle extended media properties +// --------------------------------------------------------------------------- +// +void CCollectionHelperTest::HandleCollectionMediaL(const CMPXMedia& /*aMedia*/, + TInt /*aError*/) + { + FTRACE(FPrint(_L("CCollectionHelperTest::HandleCollectionMediaL"))); + iLog->Log(_L("CCollectionHelperTest::HandleCollectionMediaL")); + + Signal(); + iTimeoutController->Cancel(); + } + +// --------------------------------------------------------------------------- +// Handles removing a collection path +// --------------------------------------------------------------------------- +// +void CCollectionHelperTest::HandleRemoveL(MDesCArray& /*aUriArray*/, TInt aError) + { + FTRACE(FPrint(_L("CCollectionHelperTest::HandleRemoveL"))); + iLog->Log(_L("CCollectionHelperTest::HandleRemoveL")); + + this->ProcessEvent(EColHandleRemove, aError); + } + +// --------------------------------------------------------------------------- +// Handle callback for "find" operation +// --------------------------------------------------------------------------- +// +void CCollectionHelperTest::HandleFindAllL(const CMPXMedia& /*aResults*/, + TBool aComplete, TInt aError) + { + FTRACE(FPrint(_L("CCollectionHelperTest::HandleFindAllL"))); + iLog->Log(_L("CCollectionHelperTest::HandleFindAllL")); + + if(aComplete) + { + this->ProcessEvent(EColHandleFindAllComplete, aError); + } + else + { + this->ProcessEvent(EColHandleFindAllComplete, KErrGeneral ); + } + } + + +void CCollectionHelperTest::HandleAddFileCompleteL( TInt aErr ) + { + FTRACE(FPrint(_L("CCollectionHelperTest::HandleAddFileCompleteL"))); + iLog->Log(_L("CCollectionHelperTest::HandleAddFileCompleteL")); + + this->ProcessEvent(EColHandleAddFileComplete, aErr); + } + +void CCollectionHelperTest::HandleOperationCompleteL( + TCHelperOperation /*aOperation*/, TInt /*aErr*/, void* /*aArgument*/ ) + { + FTRACE(FPrint(_L("CCollectionHelperTest::HandleOperationCompleteL"))); + iLog->Log(_L("CCollectionHelperTest::HandleOperationCompleteL")); + + Signal(); + iTimeoutController->Cancel(); + } + +void CCollectionHelperTest::HandleEmbeddedOpenL( + TInt /*aErr*/, TMPXGeneralCategory /*aCategory*/ ) + { + FTRACE(FPrint(_L("CCollectionHelperTest::HandleEmbeddedOpenL"))); + iLog->Log(_L("CCollectionHelperTest::HandleEmbeddedOpenL")); + + Signal(); + iTimeoutController->Cancel(); + } diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/bwinscw/collectiontestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/bwinscw/collectiontestu.def Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,4 @@ +EXPORTS + ?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 1 NONAME ; int SetRequirements(class CTestModuleParam * &, unsigned long &) + ?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 2 NONAME ; class CTestModuleBase * LibEntryL(void) + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/eabi/collectiontestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/eabi/collectiontestu.def Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,12 @@ +EXPORTS + _Z15SetRequirementsRP16CTestModuleParamRm @ 1 NONAME + _Z9LibEntryLv @ 2 NONAME + _ZTI15CPathOptionMenu @ 3 NONAME ; ## + _ZTI16CCollectionTests @ 4 NONAME ; ## + _ZTI18CMpxCollectionTest @ 5 NONAME ; ## + _ZTI19CPathOptionIsRemote @ 6 NONAME ; ## + _ZTV15CPathOptionMenu @ 7 NONAME ; ## + _ZTV16CCollectionTests @ 8 NONAME ; ## + _ZTV18CMpxCollectionTest @ 9 NONAME ; ## + _ZTV19CPathOptionIsRemote @ 10 NONAME ; ## + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,26 @@ +/* +* Copyright (c) 2002 - 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 collectiontest. +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTMMPFILES +collectiontest.mmp + +PRJ_MMPFILES + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/group/collectiontest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/group/collectiontest.mmp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,52 @@ +/* +* Copyright (c) 2002 - 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: mmp file for CollectionTest +* +*/ + +#include + +TARGET collectiontest.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E7 + +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE mpxcollectiontest.cpp +SOURCE collectiontests.cpp +SOURCE pathoptionmenu.cpp +SOURCE pathoptionisremote.cpp +SOURCE testutility.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../common/testplugins/inc +USERINCLUDE ../../common/testviewframework/inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY mpxcollectionutility.lib +LIBRARY mpxcommon.lib +LIBRARY stiftestinterface.lib +LIBRARY testviewframework.lib +LIBRARY bafl.lib +LIBRARY estor.lib +LIBRARY mpxharvesterutility.lib + +#if defined(ARMCC) +#elif defined(WINSCW) +deffile ../bwinscw/ +#endif diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/inc/collectionbrowser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/inc/collectionbrowser.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,166 @@ +/* +* Copyright (c) 2002 - 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: MpxCollectionTest test module. +* +*/ + +#ifndef COLLECTIONBROWSER_H +#define COLLECTIONBROWSER_H + +// INCLUDES +#include +#include "testmenuview.h" + +// MACROS + +// FORWARD DECLARATIONS +class MMPXCollectionUtility; +class CMPXCollectionPath; +class CStifLogger; +class CTestPlaybackUtility; + +// DATA TYPES +_LIT(KTxtCollectionBrowser, "CollectionBrowser"); + +// CLASS DECLARATION + +class CCollectionBrowser : public CTestMenuView, + public MMPXCollectionObserver + { + public: + /** + * Two-phased constructor + * @return object of CConsoleMain + */ +// static CCollectionBrowser* NewL(CConsoleMain* aConsoleMain, + // CTestBaseView* aParent, + // const TDesC16& aName, + // CStifLogger* aLogger, + // CMPXCollectionPath* aPath = NULL); + + /** + * Two-phased constructor + * @return object of CConsoleMain + */ + static CCollectionBrowser* NewLC(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC16& aName, + CStifLogger* aLogger, + CMPXCollectionPath* aPath = NULL); + + /** + * Destructor of CConsoleMain + */ + virtual ~CCollectionBrowser(); + + public: //From base classes + /** + * From CTestBaseView + * Initialize the view before display view + */ + void InitializeViewL(); + + /** + * From CTestBaseView + * Cleanup the view before deactivate/destroy view + */ + void CleanupViewL(); + + /** + * From CTestBaseView + * Handle number key press + */ + void HandleNumKeyL(); + + /** + * From CTestBaseView + * Handle left key press + */ + void HandleLeftKeyL(); + + /** + * From CTestBaseView + * Handle right/enter key press + */ + void HandleRightKeyL(); + + /** + * From MMPXCollectionObserver + * Handle extended media properties + * @param aMedia media + * @param aError error code + */ + void HandleCollectionMediaL( + const CMPXMedia& aMedia, + TInt aError); + + /** + * From MMPXCollectionObserver + * Handle collection message + * @param aMessage collection message + */ + void HandleCollectionMessageL(const CMPXMessage& aMsg); //const TMPXCollectionMessage& aMessage); + + /** + * From MMPXCollectionObserver + * Handles the collection entries being opened. Typically called + * when client has Open()'d a folder + * + * @param aEntries collection entries opened + * @param aIndex focused entry + * @param aComplete ETrue no more entries. EFalse more entries + * expected + * @param aError error code + */ + void HandleOpenL(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + + /** + * From MMPXCollectionObserver + * Handles the item being opened. Typically called + * when client has Open()'d an item. Client typically responds by + * 'playing' the item via the playlist + * + * @param aPlaylist collection playlist, owner ship is transfered + * @param aError error code + */ + void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError); + + private: + /** + * C++ default constructor. + */ + CCollectionBrowser(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger); + + /** + * the second phase constructor ConstructL to safely construct things + * that can leave + */ + void ConstructL(CMPXCollectionPath* aPath); + + private: //data + MMPXCollectionUtility* iCollectionUtility; //owns + CStifLogger* iLogger; //uses + CMPXCollectionPath* iCollectionPath; + CTestPlaybackUtility* iPlaybackUtility; + + }; + + + +#endif //COLLECTIONBROWSER + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/inc/collectiontests.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/inc/collectiontests.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,628 @@ +/* +* Copyright (c) 2002 - 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: MpxCollectionTest test module. +* +*/ + +#ifndef COLLECTIONTESTS_H +#define COLLECTIONTESTS_H + +// INCLUDES +#include +#include +#include +#include //EMPXItemDeleted +#include "testmenuview.h" +#include "testcommonpluginuids.h" +#include "testcollectionplugintype.h" + +// CONSTANTS +_LIT(KTestModuleHeaderL1, "**************************************************"); +_LIT(KTestModuleHeaderL2, "** Test Module: %S"); +_LIT(KTestModuleHeaderL3, "**"); + +_LIT(KTestModuleFooterL1, "**"); +_LIT(KTestModuleFooterL2, "** Test Module: %S Completed"); +_LIT(KTestModuleFooterL3, "**************************************************"); + + +_LIT(KTestModuleCaseL1, "--------------------------------------------------"); +_LIT(KTestModuleCaseL2, "-- Test case: [%d]%S"); +_LIT(KTestModuleCaseL3, "--"); + +_LIT(KTestModuleCaseLeave, "-- Test case failed: left with error: %d"); +_LIT(KTestModuleCheckptFail, "-- Test case failed at check point: %d"); +_LIT(KTestModuleTimeout, "-- Test case TIMEOUT"); +_LIT(KTestModuleUserCancel, "-- Test case user CANCELLED"); + +_LIT(KTestModuleInitializeLeft, "-- Test Modules Initialization left with error: %d"); +_LIT(KTestModuleUninitializeLeft,"-- Test Modules Uninitialization left with error: %d"); + +// CONSTANTS +// common text +const TUint32 KMusicCollectionUID = 0x101FFC3A; +const TUint32 KPodcastCollectionUID = 0x101FFC3C; +const TInt KColTestPluginIndex = 2; +const TInt KRootLvPluginNum = 3; + +_LIT(KTextNotImplemented, "Not Implemented"); +_LIT(KTextUninstallPlugin, "collectiontestplugin plugin need to be uninstalled"); +_LIT(KTextImproperMsg, "Improper TMPXCollectionMessage received"); +_LIT(KTextPanicExpected, "NOTE: PANICE EXPECTED - test case is marked as Failed and skipped"); +_LIT(KTextConfusingBehaviour,"NOTE: CONFUSING BEHAVIOUR"); +_LIT(KTextManualCheck, "NOTE: REQUIRE MANUAL CHECK"); +_LIT(KTextApiDeprecated, "NOTE: API IS DEPRECATED"); + +_LIT(KTextHandleColMsg, "Event: %d, Type: %d, Data: %d"); +_LIT(KTextHandleOpenLArg, "Index: %d, Complete: %d, Error: %d"); + +_LIT(KTextPathChangedByOpen,"TMPXCollectionMessage: TMPXCollectionMessage::EPathChanged, EMcPathChangedByOpen"); +_LIT(KTextCollectionChange, "TMPXCollectionMessage: TMPXCollectionMessage::ECollectionChanged"); +_LIT(KTextFocusChanged, "TMPXCollectionMessage: TMPXCollectionMessage::EFocusChanged"); +_LIT(KTextPluginImpUid, "Plugin implementation Id=0x%x"); + +// API names +_LIT(KTextApiNewL, "Testing MMPXCollectionUtility::NewL"); +_LIT(KTextApiCollectionIDL, "Testing MMPXCollectionUtility::CollectionIDL"); +_LIT(KTextApiOpenL, "Testing MMPXCollection::OpenL"); +_LIT(KTextApiSetFilterL, "Testing MMPXCollection::SetFilterL/FilterL"); +_LIT(KTextApiUidL, "Testing MMPXCollection::UidL"); +_LIT(KTextApiPathL, "Testing MMPXCollection::PathL"); +_LIT(KTextApiBackL, "Testing MMPXCollection::BackL"); +_LIT(KTextApiIsRemote, "Testing MMPXCollection::IsRemote"); +_LIT(KTextApiCancelRequest, "Testing MMPXCollection::CancelRequest"); +_LIT(KTextApiAddL, "Testing MMPXCollection::AddL"); +_LIT(KTextApiRemoveL, "Testing MMPXCollection::RemoveL"); +_LIT(KTextApiSetSyncL, "Testing MMPXCollection::SetSyncL"); +_LIT(KTextApiSetL, "Testing MMPXCollection::SetL"); +_LIT(KTextApiFindAllL_Asyn, "Testing MMPXCollection::FindAllL_Asyn"); +_LIT(KTextApiFindAllL_Syn, "Testing MMPXCollection::FindAllL_Syn"); +_LIT(KTextApiMediaL, "Testing MMPXCollection::MediaL"); +_LIT(KTextApiCommandL, "Testing MMPXCollection::CommandL"); +_LIT(KTextApiCommandL_Ext, "Testing MMPXCollection::CommandL_Ext"); +_LIT(KTextApiGetSupportedTypesL,"Testing MMPXCollection::GetSupportedTypesL"); +_LIT(KTextApiGetSupportedCapabilitiesL,"Testing MMPXCollection::GetSupportedCapabilitiesL"); +_LIT(KTextApiCollectionIDL_Col,"Testing MMPXCollection::CollectionIDL"); +_LIT(KTextApiNotifyL, "Testing MMPXCollection::NotifyL"); + + +_LIT(KTextHandleColMsgL1, "MMPXCollectionObserver::HandleCollectionMessageL-TMPXCollectionMessage"); +_LIT(KTextHandleColMsgL2, "MMPXCollectionObserver::HandleCollectionMessageL-CMPXMessage"); +_LIT(KTextHandleOpenL1, "MMPXCollectionObserver::HandleOpenL-CMPXMedia"); +_LIT(KTextHandleOpenL2, "MMPXCollectionObserver::HandleOpenL-CMPXCollectionPlaylist"); +_LIT(KTextHandleCommandComplete,"MMPXCollectionObserver::HandleCommandComplete"); +_LIT(KTextHandleMediaL, "MMPXCollectionObserver::HandleCollectionMediaL"); +_LIT(KTextHandleRemoveL, "MMPXCollectionRemoveObserver::HandleRemoveL"); +_LIT(KTextHandleFindAllL, "MMPXCollectionFindObserver::HandleFindAllL"); + +// MACROS + +// FORWARD DECLARATIONS +class MMPXCollectionUtility; +class CStifLogger; + +// DATA TYPES +_LIT(KTxtCollectionTests, "CollectionTests"); + +// CLASS DECLARATION + +class CCollectionTests : public CTestMenuView, + public MMPXCollectionObserver, + public MMPXCollectionRemoveObserver, + public MMPXCollectionFindObserver + { + public: + + /** + * Two-phased constructor + * @return object of CConsoleMain + */ + static CCollectionTests* NewL(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger, + TInt testIndex); + + /** + * Two-phased constructor + * @return object of CConsoleMain + */ + static CCollectionTests* NewLC(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger, + TInt testIndex); + + /** + * Destructor of CConsoleMain + */ + virtual ~CCollectionTests(); + + private: + + /** + * C++ default constructor. + */ + CCollectionTests(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger, + TInt testIndex); + + /** + * the second phase constructor ConstructL to safely construct things + * that can leave + */ + void ConstructL(); + + public: + + /* + * Return whether test requires scheduler for aysynchronous wait. + */ + TBool IsTestSynchronous(int iTestIndex); + + /** + * Result from latest test + */ + TInt GetLatestTestResult(); + + /** + * Stop the current test + */ + void TestCompleteL(); + + /** + * From CTestBaseView + * Handle number key press + */ + void HandleNumKeyL(); + + /** + * From CTestBaseView + * Handle left key press + */ + void HandleLeftKeyL(); + + /** + * From CTestBaseView + * Handle right/enter key press + */ + void HandleRightKeyL(); + + /** + * From CTestBaseView + * Cleanup the view before deactivate/destroy view + */ + void CleanupViewL(); + + /** + * From CTestBaseView + * Initialize the view before display view + */ + void InitializeViewL(); + + void RunNext(); + + void StartNextTestL(); + + TInt StartTest0001L(); + TInt StartTest0002L(); + TInt StartTest0003L(); + TInt StartTest0004L(); + TInt StartTest0005L(); + TInt StartTest0006L(); + TInt StartTest0007L(); + TInt StartTest0008L(); + TInt StartTest0009L(); + TInt StartTest0010L(); + TInt StartTest0011L(); + TInt StartTest0012L(); + TInt StartTest0013L(); + TInt StartTest0014L(); + TInt StartTest0015L(); + TInt StartTest0016L(); + TInt StartTest0017L(); + TInt StartTest0018L(); + TInt StartTest0019L(); + TInt StartTest0020L(); + TInt StartTest0021L(); + TInt StartTest0022L(); + TInt StartTest0023L(); + TInt StartTest0024L(); + TInt StartTest0025L(); + TInt StartTest0026L(); + TInt StartTest0027L(); + TInt StartTest0028L(); + TInt StartTest0029L(); + TInt StartTest0030L(); + TInt StartTest0031L(); + TInt StartTest0032L(); + TInt StartTest0033L(); + TInt StartTest0034L(); + TInt StartTest0035L(); + TInt StartTest0036L(); + TInt StartTest0037L(); + TInt StartTest0038L(); + TInt StartTest0039L(); + TInt StartTest0040L(); + TInt StartTest0041L(); + TInt StartTest0042L(); + TInt StartTest0043L(); + TInt StartTest0044L(); + TInt StartTest0045L(); + TInt StartTest0046L(); + TInt StartTest0047L(); + TInt StartTest0048L(); + TInt StartTest0049L(); + TInt StartTest0050L(); + TInt StartTest0051L(); + TInt StartTest0052L(); + TInt StartTest0053L(); + TInt StartTest0054L(); + TInt StartTest0055L(); + TInt StartTest0056L(); + TInt StartTest0057L(); + TInt StartTest0058L(); + TInt StartTest0059L(); + TInt StartTest0060L(); + TInt StartTest0061L(); + TInt StartTest0062L(); + TInt StartTest0063L(); + TInt StartTest0064L(); + TInt StartTest0065L(); + TInt StartTest0066L(); + TInt StartTest0067L(); + TInt StartTest0068L(); + TInt StartTest0069L(); + TInt StartTest0070L(); + TInt StartTest0071L(); + TInt StartTest0072L(); + TInt StartTest0073L(); + TInt StartTest0074L(); + TInt StartTest0075L(); + TInt StartTest0076L(); + TInt StartTest0077L(); + TInt StartTest0078L(); + TInt StartTest0079L(); + TInt StartTest0080L(); + TInt StartTest0081L(); + TInt StartTest0082L(); + TInt StartTest0083L(); + TInt StartTest0084L(); + TInt StartTest0085L(); + TInt StartTest0086L(); + TInt StartTest0087L(); + TInt StartTest0088L(); + TInt StartTest0089L(); + TInt StartTest0090L(); + TInt StartTest0091L(); + TInt StartTest0092L(); + TInt StartTest0093L(); + TInt StartTest0094L(); + TInt StartTest0095L(); + TInt StartTest0096L(); + TInt StartTest0097L(); + TInt StartTest0098L(); + TInt StartTest0099L(); + TInt StartTest0100L(); + TInt StartTest0101L(); + TInt StartTest0102L(); + TInt StartTest0103L(); + TInt StartTest0104L(); + TInt StartTest0105L(); + TInt StartTest0106L(); + TInt StartTest0107L(); + TInt StartTest0108L(); + TInt StartTest0109L(); + TInt StartTest0110L(); + TInt StartTest0111L(); + TInt StartTest0112L(); + TInt StartTest0113L(); + TInt StartTest0114L(); + TInt StartTest0115L(); + TInt StartTest0116L(); + TInt StartTest0117L(); + TInt StartTest0118L(); + TInt StartTest0119L(); + TInt StartTest0120L(); + TInt StartTest0121L(); + TInt StartTest0122L(); + TInt StartTest0123L(); + TInt StartTest0124L(); + TInt StartTest0125L(); + TInt StartTest0126L(); + TInt StartTest0127L(); + TInt StartTest0128L(); + TInt StartTest0129L(); + TInt StartTest0130L(); + TInt StartTest0131L(); + TInt StartTest0132L(); + TInt StartTest0133L(); + TInt StartTest0134L(); + TInt StartTest0135L(); + TInt StartTest0136L(); + TInt StartTest0137L(); + TInt StartTest0138L(); + TInt StartTest0139L(); + TInt StartTest0140L(); + TInt StartTest0141L(); + TInt StartTest0142L(); + TInt StartTest0143L(); + TInt StartTest0144L(); + TInt StartTest0145L(); + TInt StartTest0146L(); + TInt StartTest0147L(); + TInt StartTest0148L(); + TInt StartTest0149L(); + TInt StartTest0150L(); + TInt StartTest0151L(); + TInt StartTest0152L(); + TInt StartTest0153L(); + TInt StartTest0154L(); + TInt StartTest0155L(); + TInt StartTest0156L(); + TInt StartTest0157L(); + TInt StartTest0158L(); + TInt StartTest0159L(); + TInt StartTest0160L(); + TInt StartTest0161L(); + TInt StartTest0162L(); + TInt StartTest0163L(); + TInt StartTest0164L(); + TInt StartTest0165L(); + TInt StartTest0166L(); + TInt StartTest0167L(); + TInt StartTest0168L(); + TInt StartTest0169L(); + TInt StartTest0170L(); + TInt StartTest0171L(); + TInt StartTest0172L(); + TInt StartTest0173L(); + TInt StartTest0174L(); + TInt StartTest0175L(); + TInt StartTest0176L(); + TInt StartTest0177L(); + TInt StartTest0178L(); + TInt StartTest0179L(); + TInt StartTest0180L(); + TInt StartTest0181L(); + TInt StartTest0182L(); + TInt StartTest0183L(); + TInt StartTest0184L(); + TInt StartTest0185L(); + TInt StartTest0186L(); + TInt StartTest0187L(); + TInt StartTest0188L(); + TInt StartTest0189L(); + TInt StartTest0190L(); + TInt StartTest0191L(); + TInt StartTest0192L(); + TInt StartTest0193L(); + TInt StartTest0194L(); + TInt StartTest0195L(); + TInt StartTest0196L(); + TInt StartTest0197L(); + TInt StartTest0198L(); + TInt StartTest0199L(); + TInt StartTest0200L(); + TInt StartTest0201L(); + TInt StartTest0202L(); + + void DoHandleCollectionTest0001L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0011L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0012L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0021L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0022L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0023L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0029L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0029L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0030L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0031L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0032L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0033L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0034L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0035L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0036L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0036L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0037L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0038L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0039L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0039L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0040L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0041L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0043L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0044L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0047L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0048L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0051L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0052L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0056L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0057L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0058L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0059L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0059L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0060L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0060L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + void DoHandleCollectionTest0078L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0079L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0080L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0084L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0085L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0086L( const TMPXCollectionMessage& aMessage ); + void DoHandleRemoveLTest0088L(MDesCArray& aUriArray, TInt aError); + void DoHandleRemoveLTest0089L(MDesCArray& aUriArray, TInt aError); + void DoHandleRemoveLTest0090L(MDesCArray& aUriArray, TInt aError); + void DoHandleRemoveLTest0091L(MDesCArray& aUriArray, TInt aError); + void DoHandleCollectionTest0091L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0099L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0100L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0108L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0109L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0117L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0118L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0119L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0120L( const TMPXCollectionMessage& aMessage ); + void DoHandleFindAllTest0126L(const CMPXMedia& aResults, TBool aComplete,TInt aError); + void DoHandleCollectionTest0126L( const TMPXCollectionMessage& aMessage ); + void DoHandleFindAllTest0127L(const CMPXMedia& aResults, TBool aComplete,TInt aError); + void DoHandleCollectionTest0127L( const TMPXCollectionMessage& aMessage ); + void DoHandleFindAllTest0128L(const CMPXMedia& aResults, TBool aComplete,TInt aError); + void DoHandleFindAllTest0129L(const CMPXMedia& aResults, TBool aComplete,TInt aError); + void DoHandleFindAllTest0130L(const CMPXMedia& aResults, TBool aComplete,TInt aError); + void DoHandleCollectionTest0130L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0145L( const TMPXCollectionMessage& aMessage ); + void DoHandleMediaTest0145L(const CMPXMedia& aMedia, TInt aError); + void DoHandleMediaTest0146L(const CMPXMedia& aMedia, TInt aError); + void DoHandleMediaTest0147L(const CMPXMedia& aMedia, TInt aError); + void DoHandleCollectionTest0148L( const TMPXCollectionMessage& aMessage ); + void DoHandleMediaTest0148L(const CMPXMedia& aMedia, TInt aError); + void DoHandleMediaTest0149L(const CMPXMedia& aMedia, TInt aError); + void DoHandleCollectionTest0162L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0163L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0171L( const TMPXCollectionMessage& aMessage ); + void DoHandleCommandCompleteTest0171L(CMPXCommand* aCommandResult, TInt aError); + void DoHandleCommandCompleteTest0173L(CMPXCommand* aCommandResult, TInt aError); + void DoHandleCollectionTest0173L( const TMPXCollectionMessage& aMessage ); + void DoHandleCommandCompleteTest0176L(CMPXCommand* aCommandResult, TInt aError); + void DoHandleCommandCompleteTest0177L(CMPXCommand* aCommandResult, TInt aError); + void DoHandleCollectionTest0177L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0179L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0182L( const TMPXCollectionMessage& aMessage ); + void DoHandleCommandCompleteTest0184L(CMPXCommand* aCommandResult, TInt aError); + void DoHandleCollectionTest0194L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0195L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0196L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0197L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0198L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0199L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0200L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0201L( const TMPXCollectionMessage& aMessage ); + void DoHandleCollectionTest0202L( const TMPXCollectionMessage& aMessage ); + + //*********************************************************************** + + /** + * From MMPXCollectionObserver + * Handle extended media properties + * @param aMedia media + * @param aError error code + */ + void HandleCollectionMediaL( + const CMPXMedia& aMedia, + TInt aError); + + /** + * From MMPXCollectionObserver + * Handle collection message + * @param aMessage collection message + */ + void HandleCollectionMessageL(const CMPXMessage& aMsg); + + /** + * From MMPXCollectionObserver + * Handles the collection entries being opened. Typically called + * when client has Open()'d a folder + * + * @param aEntries collection entries opened + * @param aIndex focused entry + * @param aComplete ETrue no more entries. EFalse more entries + * expected + * @param aError error code + */ + void HandleOpenL(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + + /** + * From MMPXCollectionObserver + * Handles the item being opened. Typically called + * when client has Open()'d an item. Client typically responds by + * 'playing' the item via the playlist + * + * @param aPlaylist collection playlist, owner ship is transfered + * @param aError error code + */ + void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError); + + + void HandleCommandComplete(CMPXCommand* aCommandResult, TInt aError); + + //*********************************************************************** + + /** + * From MMPXCollectionRemoveObserver + * Handles removing a collection path + * calls back with the list of file paths that were deleted + * This callback is only applicable for local file storage plugins. + * + * @param aUriArray, list of files that were deleted + */ + void HandleRemoveL(MDesCArray& aUriArray, TInt aError); + + //*********************************************************************** + + /** + * From MMPXCollectionFindObserver + * Handle callback for "find" operation + * @param aEntries, CMPXMedia to be returned + * @param aComplete ETrue no more entries. EFalse more entries + * expected + * @param aError error code + */ + void HandleFindAllL(const CMPXMedia& aResults, TBool aComplete,TInt aError); + + private: + + // Assert function + void AssertL(TBool aCondition, TInt aCheckPt); + + // Compare function + static TBool CompareByTMPXItemId(const TMPXItemId& aFirst, + const TMPXItemId& aSecond); + + // Initialize new collection + void Collection1_Initialize(); + + // Initialize new collection and open with TMPXOpenMode (Test 9 - ) + void Collection2_InitializeAndOpenL(TMPXOpenMode aOpenMode); + + private: + + MMPXCollectionUtility* iCollectionUtility1; //owns + MMPXCollectionUtility* iCollectionUtility2; //owns + CStifLogger* iLogger; //uses + TInt iTestIndex; + TInt iStopAtTestIndex; + TInt iTempCnt; + TInt iLatestTestResult; + }; + +#endif // COLLECTIONTESTS_H + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/inc/mpxcollectiontest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/inc/mpxcollectiontest.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,400 @@ +/* +* Copyright (c) 2002 - 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: MpxCollectionTest test module. +* +*/ + +#ifndef MPXCOLLECTIONTEST_H +#define MPXCOLLECTIONTEST_H + +// INCLUDES +#include +#include +#include + +// MACROS +// Function pointer related internal definitions +// Hack around known GCC bug. +#ifndef __GCC32__ +#define GETPTR +#else +#define GETPTR & +#endif +#define ENTRY(str,func) {(TText*)L##str, GETPTR func} +#define FUNCENTRY(func) {(TText*)L#func, GETPTR func} + + +// FORWARD DECLARATIONS +class MMPXCollectionUtility; +class MMPXHarvesterUtility; +class CStifLogger; +class CMPXCollectionPath; +class CMpxCollectionTest; +class CConsoleMain; + +// DATA TYPES +// A typedef for function that does the actual testing, +typedef TInt (CMpxCollectionTest::* TestFunction)(TTestResult&); + +// CLASS DECLARATION + +/** +* An internal structure containing a test case name and +* the pointer to function doing the test +*/ +class TCaseInfoInternal + { + public: + const TText* iCaseName; + TestFunction iMethod; + }; + +// CLASS DECLARATION + +/** +* A structure containing a test case name and +* the pointer to function doing the test +*/ +class TCaseInfo + { + public: + TPtrC iCaseName; + TestFunction iMethod; + + TCaseInfo( const TText* a ) : iCaseName( (TText*) a ) + { + }; + + }; + + +// CLASS DECLARATION + +/** +* This a MpxCollectionTest class. +*/ +class CMpxCollectionTest: public CTestModuleBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CMpxCollectionTest* NewL(); + + /** + * Destructor. + */ + virtual ~CMpxCollectionTest(); + + public: // Functions from base classes + + + /** + * From CTestModuleBase InitL is used to initialize the + * MpxCollectionTest. It is called once for every instance of + * TestModuleMpxCollectionTest after its creation. + * @param aIniFile Initialization file for the test module (optional) + * @param aFirstTime Flag is true when InitL is executed for first + * created instance of MpxCollectionTest. + * @return Symbian OS error code + */ + TInt InitL( TFileName& aIniFile, TBool aFirstTime ); + + /** + * From CTestModuleBase GetTestCasesL is used to inquiry test cases + * from MpxCollectionTest. + * @param aTestCaseFile Test case file (optional) + * @param aTestCases Array of TestCases returned to test framework + * @return Symbian OS error code + */ + TInt GetTestCasesL( const TFileName& aTestCaseFile, + RPointerArray& aTestCases ); + + /** + * From CTestModuleBase RunTestCaseL is used to run an individual + * test case. + * @param aCaseNumber Test case number + * @param aTestCaseFile Test case file (optional) + * @param aResult Test case result returned to test framework (PASS/FAIL) + * @return Symbian OS error code (test case execution error, which is + * not reported in aResult parameter as test case failure). + */ + TInt RunTestCaseL( const TInt aCaseNumber, + const TFileName& aTestCaseFile, + TTestResult& aResult ); + + private: + + /** + * C++ default constructor. + */ + CMpxCollectionTest(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * Function returning test case name and pointer to test case function. + * @param aCaseNumber test case number + * @return TCaseInfo + */ + const TCaseInfo Case ( const TInt aCaseNumber ) const; + + /** + * Initialize environment before test + */ + void InitializeL( CActiveScheduler* scheduler ); + + /** + * Cleanup environment after test + */ + void Cleanup(); + + /** + * Actual Hardcoded test case functions are listed below. + */ + + /** + * Common test case driver for all Collection tests. + * @param aResult Test case result (PASS/FAIL) + * @return Symbian OS error code (test case execution error + * that is not returned as test case result in aResult) + */ + TInt CommonTestL( TInt testIndex, TTestResult& aResult ); + + private: // Help functions + + TInt Test0001L(TTestResult& aResult) { return CommonTestL( 1, aResult); } + TInt Test0002L(TTestResult& aResult) { return 0; } //return CommonTestL( 2, aResult); } + TInt Test0003L(TTestResult& aResult) { return 0; } //return CommonTestL( 3, aResult); } + TInt Test0004L(TTestResult& aResult) { return 0; } //return CommonTestL( 4, aResult); } + TInt Test0005L(TTestResult& aResult) { return 0; } //return CommonTestL( 5, aResult); } + TInt Test0006L(TTestResult& aResult) { return 0; } //return CommonTestL( 6, aResult); } + TInt Test0007L(TTestResult& aResult) { return 0; } //return CommonTestL( 7, aResult); } + TInt Test0008L(TTestResult& aResult) { return 0; } //return CommonTestL( 8, aResult); } + TInt Test0009L(TTestResult& aResult) { return 0; } //return CommonTestL( 9, aResult); } + TInt Test0010L(TTestResult& aResult) { return 0; } //return CommonTestL( 10, aResult); } + TInt Test0011L(TTestResult& aResult) { return CommonTestL( 11, aResult); } + TInt Test0012L(TTestResult& aResult) { return 0; } //return CommonTestL( 12, aResult); } + TInt Test0013L(TTestResult& aResult) { return CommonTestL( 13, aResult); } + TInt Test0014L(TTestResult& aResult) { return 0; } //return CommonTestL( 14, aResult); } + TInt Test0015L(TTestResult& aResult) { return CommonTestL( 15, aResult); } + TInt Test0016L(TTestResult& aResult) { return 0; } //return CommonTestL( 16, aResult); } + TInt Test0017L(TTestResult& aResult) { return CommonTestL( 17, aResult); } + TInt Test0018L(TTestResult& aResult) { return 0; } //return CommonTestL( 18, aResult); } + TInt Test0019L(TTestResult& aResult) { return CommonTestL( 19, aResult); } + TInt Test0020L(TTestResult& aResult) { return CommonTestL( 20, aResult); } + TInt Test0021L(TTestResult& aResult) { return CommonTestL( 21, aResult); } + TInt Test0022L(TTestResult& aResult) { return 0; } //return CommonTestL( 22, aResult); } + TInt Test0023L(TTestResult& aResult) { return 0; } //return CommonTestL( 23, aResult); } + TInt Test0024L(TTestResult& aResult) { return 0; } //return CommonTestL( 24, aResult); } + TInt Test0025L(TTestResult& aResult) { return 0; } //return CommonTestL( 25, aResult); } + TInt Test0026L(TTestResult& aResult) { return 0; } //return CommonTestL( 26, aResult); } + TInt Test0027L(TTestResult& aResult) { return 0; } //return CommonTestL( 27, aResult); } + TInt Test0028L(TTestResult& aResult) { return 0; } //return CommonTestL( 28, aResult); } + TInt Test0029L(TTestResult& aResult) { return 0; } //return CommonTestL( 29, aResult); } + TInt Test0030L(TTestResult& aResult) { return 0; } //return CommonTestL( 30, aResult); } + TInt Test0031L(TTestResult& aResult) { return 0; } //return CommonTestL( 31, aResult); } + TInt Test0032L(TTestResult& aResult) { return 0; } //return CommonTestL( 32, aResult); } + TInt Test0033L(TTestResult& aResult) { return 0; } //return CommonTestL( 33, aResult); } + TInt Test0034L(TTestResult& aResult) { return 0; } //return CommonTestL( 34, aResult); } + TInt Test0035L(TTestResult& aResult) { return 0; } //return CommonTestL( 35, aResult); } + TInt Test0036L(TTestResult& aResult) { return CommonTestL( 36, aResult); } + TInt Test0037L(TTestResult& aResult) { return 0; } //return CommonTestL( 37, aResult); } + TInt Test0038L(TTestResult& aResult) { return 0; } //return CommonTestL( 38, aResult); } + TInt Test0039L(TTestResult& aResult) { return 0; } //return CommonTestL( 39, aResult); } + TInt Test0040L(TTestResult& aResult) { return 0; } //return CommonTestL( 40, aResult); } + TInt Test0041L(TTestResult& aResult) { return 0; } //return CommonTestL( 41, aResult); } + TInt Test0042L(TTestResult& aResult) { return CommonTestL( 42, aResult); } + TInt Test0043L(TTestResult& aResult) { return 0; } //return CommonTestL( 43, aResult); } + TInt Test0044L(TTestResult& aResult) { return 0; } //return CommonTestL( 44, aResult); } + TInt Test0045L(TTestResult& aResult) { return 0; } //return CommonTestL( 45, aResult); } + TInt Test0046L(TTestResult& aResult) { return 0; } //return CommonTestL( 46, aResult); } + TInt Test0047L(TTestResult& aResult) { return 0; } //return CommonTestL( 47, aResult); } + TInt Test0048L(TTestResult& aResult) { return 0; } //return CommonTestL( 48, aResult); } + TInt Test0049L(TTestResult& aResult) { return 0; } //return CommonTestL( 49, aResult); } + TInt Test0050L(TTestResult& aResult) { return 0; } //return CommonTestL( 50, aResult); } + TInt Test0051L(TTestResult& aResult) { return 0; } //return CommonTestL( 51, aResult); } + TInt Test0052L(TTestResult& aResult) { return 0; } //return CommonTestL( 52, aResult); } + TInt Test0053L(TTestResult& aResult) { return 0; } //return CommonTestL( 53, aResult); } + TInt Test0054L(TTestResult& aResult) { return CommonTestL( 54, aResult); } + TInt Test0055L(TTestResult& aResult) { return 0; } //return CommonTestL( 55, aResult); } + TInt Test0056L(TTestResult& aResult) { return 0; } //return CommonTestL( 56, aResult); } + TInt Test0057L(TTestResult& aResult) { return 0; } //return CommonTestL( 57, aResult); } + TInt Test0058L(TTestResult& aResult) { return 0; } //return CommonTestL( 58, aResult); } + TInt Test0059L(TTestResult& aResult) { return 0; } //return CommonTestL( 59, aResult); } + TInt Test0060L(TTestResult& aResult) { return 0; } //return CommonTestL( 60, aResult); } + TInt Test0061L(TTestResult& aResult) { return 0; } //return CommonTestL( 61, aResult); } + TInt Test0062L(TTestResult& aResult) { return 0; } //return CommonTestL( 62, aResult); } + TInt Test0063L(TTestResult& aResult) { return 0; } //return CommonTestL( 63, aResult); } + TInt Test0064L(TTestResult& aResult) { return 0; } //return CommonTestL( 64, aResult); } + TInt Test0065L(TTestResult& aResult) { return 0; } //return CommonTestL( 65, aResult); } + TInt Test0066L(TTestResult& aResult) { return 0; } //return CommonTestL( 66, aResult); } + TInt Test0067L(TTestResult& aResult) { return 0; } //return CommonTestL( 67, aResult); } + TInt Test0068L(TTestResult& aResult) { return 0; } //return CommonTestL( 68, aResult); } + TInt Test0069L(TTestResult& aResult) { return 0; } //return CommonTestL( 69, aResult); } + TInt Test0070L(TTestResult& aResult) { return CommonTestL( 70, aResult); } + TInt Test0071L(TTestResult& aResult) { return 0; } //return CommonTestL( 71, aResult); } + TInt Test0072L(TTestResult& aResult) { return 0; } //return CommonTestL( 72, aResult); } + TInt Test0073L(TTestResult& aResult) { return 0; } //return CommonTestL( 73, aResult); } + TInt Test0074L(TTestResult& aResult) { return 0; } //return CommonTestL( 74, aResult); } + TInt Test0075L(TTestResult& aResult) { return 0; } //return CommonTestL( 75, aResult); } + TInt Test0076L(TTestResult& aResult) { return 0; } //return CommonTestL( 76, aResult); } + TInt Test0077L(TTestResult& aResult) { return 0; } //return CommonTestL( 77, aResult); } + TInt Test0078L(TTestResult& aResult) { return 0; } //return CommonTestL( 78, aResult); } + TInt Test0079L(TTestResult& aResult) { return 0; } //return CommonTestL( 79, aResult); } + TInt Test0080L(TTestResult& aResult) { return 0; } //return CommonTestL( 80, aResult); } + TInt Test0081L(TTestResult& aResult) { return 0; } //return CommonTestL( 81, aResult); } + TInt Test0082L(TTestResult& aResult) { return CommonTestL( 82, aResult); } + TInt Test0083L(TTestResult& aResult) { return 0; } //return CommonTestL( 83, aResult); } + TInt Test0084L(TTestResult& aResult) { return 0; } //return CommonTestL( 84, aResult); } + TInt Test0085L(TTestResult& aResult) { return 0; } //return CommonTestL( 85, aResult); } + TInt Test0086L(TTestResult& aResult) { return 0; } //return CommonTestL( 86, aResult); } + TInt Test0087L(TTestResult& aResult) { return 0; } //return CommonTestL( 87, aResult); } + TInt Test0088L(TTestResult& aResult) { return 0; } //return CommonTestL( 88, aResult); } + TInt Test0089L(TTestResult& aResult) { return 0; } //return CommonTestL( 89, aResult); } + TInt Test0090L(TTestResult& aResult) { return 0; } //return CommonTestL( 90, aResult); } + TInt Test0091L(TTestResult& aResult) { return 0; } //return CommonTestL( 91, aResult); } + TInt Test0092L(TTestResult& aResult) { return 0; } //return CommonTestL( 92, aResult); } + TInt Test0093L(TTestResult& aResult) { return 0; } //return CommonTestL( 93, aResult); } + TInt Test0094L(TTestResult& aResult) { return 0; } //return CommonTestL( 94, aResult); } + TInt Test0095L(TTestResult& aResult) { return 0; } //return CommonTestL( 95, aResult); } + TInt Test0096L(TTestResult& aResult) { return 0; } //return CommonTestL( 96, aResult); } + TInt Test0097L(TTestResult& aResult) { return 0; } //return CommonTestL( 97, aResult); } + TInt Test0098L(TTestResult& aResult) { return 0; } //return CommonTestL( 98, aResult); } + TInt Test0099L(TTestResult& aResult) { return 0; } //return CommonTestL( 99, aResult); } + TInt Test0100L(TTestResult& aResult) { return 0; } //return CommonTestL(100, aResult); } + TInt Test0101L(TTestResult& aResult) { return CommonTestL(101, aResult); } + TInt Test0102L(TTestResult& aResult) { return 0; } //return CommonTestL(102, aResult); } + TInt Test0103L(TTestResult& aResult) { return 0; } //return CommonTestL(103, aResult); } + TInt Test0104L(TTestResult& aResult) { return 0; } //return CommonTestL(104, aResult); } + TInt Test0105L(TTestResult& aResult) { return 0; } //return CommonTestL(105, aResult); } + TInt Test0106L(TTestResult& aResult) { return 0; } //return CommonTestL(106, aResult); } + TInt Test0107L(TTestResult& aResult) { return 0; } //return CommonTestL(107, aResult); } + TInt Test0108L(TTestResult& aResult) { return 0; } //return CommonTestL(108, aResult); } + TInt Test0109L(TTestResult& aResult) { return 0; } //return CommonTestL(109, aResult); } + TInt Test0110L(TTestResult& aResult) { return CommonTestL(110, aResult); } + TInt Test0111L(TTestResult& aResult) { return 0; } //return CommonTestL(111, aResult); } + TInt Test0112L(TTestResult& aResult) { return 0; } //return CommonTestL(112, aResult); } + TInt Test0113L(TTestResult& aResult) { return 0; } //return CommonTestL(113, aResult); } + TInt Test0114L(TTestResult& aResult) { return 0; } //return CommonTestL(114, aResult); } + TInt Test0115L(TTestResult& aResult) { return 0; } //return CommonTestL(115, aResult); } + TInt Test0116L(TTestResult& aResult) { return 0; } //return CommonTestL(116, aResult); } + TInt Test0117L(TTestResult& aResult) { return 0; } //return CommonTestL(117, aResult); } + TInt Test0118L(TTestResult& aResult) { return 0; } //return CommonTestL(118, aResult); } + TInt Test0119L(TTestResult& aResult) { return 0; } //return CommonTestL(119, aResult); } + TInt Test0120L(TTestResult& aResult) { return 0; } //return CommonTestL(120, aResult); } + TInt Test0121L(TTestResult& aResult) { return CommonTestL(121, aResult); } + TInt Test0122L(TTestResult& aResult) { return 0; } //return CommonTestL(122, aResult); } + TInt Test0123L(TTestResult& aResult) { return 0; } //return CommonTestL(123, aResult); } + TInt Test0124L(TTestResult& aResult) { return 0; } //return CommonTestL(124, aResult); } + TInt Test0125L(TTestResult& aResult) { return 0; } //return CommonTestL(125, aResult); } + TInt Test0126L(TTestResult& aResult) { return 0; } //return CommonTestL(126, aResult); } + TInt Test0127L(TTestResult& aResult) { return 0; } //return CommonTestL(127, aResult); } + TInt Test0128L(TTestResult& aResult) { return 0; } //return CommonTestL(128, aResult); } + TInt Test0129L(TTestResult& aResult) { return 0; } //return CommonTestL(129, aResult); } + TInt Test0130L(TTestResult& aResult) { return 0; } //return CommonTestL(130, aResult); } + TInt Test0131L(TTestResult& aResult) { return 0; } //return CommonTestL(131, aResult); } + TInt Test0132L(TTestResult& aResult) { return 0; } //return CommonTestL(132, aResult); } + TInt Test0133L(TTestResult& aResult) { return 0; } //return CommonTestL(133, aResult); } + TInt Test0134L(TTestResult& aResult) { return 0; } //return CommonTestL(134, aResult); } + TInt Test0135L(TTestResult& aResult) { return 0; } //return CommonTestL(135, aResult); } + TInt Test0136L(TTestResult& aResult) { return 0; } //return CommonTestL(136, aResult); } + TInt Test0137L(TTestResult& aResult) { return 0; } //return CommonTestL(137, aResult); } + TInt Test0138L(TTestResult& aResult) { return 0; } //return CommonTestL(138, aResult); } + TInt Test0139L(TTestResult& aResult) { return 0; } //return CommonTestL(139, aResult); } + TInt Test0140L(TTestResult& aResult) { return 0; } //return CommonTestL(140, aResult); } + TInt Test0141L(TTestResult& aResult) { return CommonTestL(141, aResult); } + TInt Test0142L(TTestResult& aResult) { return 0; } //return CommonTestL(142, aResult); } + TInt Test0143L(TTestResult& aResult) { return 0; } //return CommonTestL(143, aResult); } + TInt Test0144L(TTestResult& aResult) { return 0; } //return CommonTestL(144, aResult); } + TInt Test0145L(TTestResult& aResult) { return 0; } //return CommonTestL(145, aResult); } + TInt Test0146L(TTestResult& aResult) { return 0; } //return CommonTestL(146, aResult); } + TInt Test0147L(TTestResult& aResult) { return 0; } //return CommonTestL(147, aResult); } + TInt Test0148L(TTestResult& aResult) { return 0; } //return CommonTestL(148, aResult); } + TInt Test0149L(TTestResult& aResult) { return 0; } //return CommonTestL(149, aResult); } + TInt Test0150L(TTestResult& aResult) { return CommonTestL(150, aResult); } + TInt Test0151L(TTestResult& aResult) { return 0; } //return CommonTestL(151, aResult); } + TInt Test0152L(TTestResult& aResult) { return 0; } //return CommonTestL(152, aResult); } + TInt Test0153L(TTestResult& aResult) { return 0; } //return CommonTestL(153, aResult); } + TInt Test0154L(TTestResult& aResult) { return 0; } //return CommonTestL(154, aResult); } + TInt Test0155L(TTestResult& aResult) { return 0; } //return CommonTestL(155, aResult); } + TInt Test0156L(TTestResult& aResult) { return 0; } //return CommonTestL(156, aResult); } + TInt Test0157L(TTestResult& aResult) { return 0; } //return CommonTestL(157, aResult); } + TInt Test0158L(TTestResult& aResult) { return 0; } //return CommonTestL(158, aResult); } + TInt Test0159L(TTestResult& aResult) { return 0; } //return CommonTestL(159, aResult); } + TInt Test0160L(TTestResult& aResult) { return 0; } //return CommonTestL(160, aResult); } + TInt Test0161L(TTestResult& aResult) { return 0; } //return CommonTestL(161, aResult); } + TInt Test0162L(TTestResult& aResult) { return 0; } //return CommonTestL(162, aResult); } + TInt Test0163L(TTestResult& aResult) { return 0; } //return CommonTestL(163, aResult); } + TInt Test0164L(TTestResult& aResult) { return 0; } //return CommonTestL(164, aResult); } + TInt Test0165L(TTestResult& aResult) { return 0; } //return CommonTestL(165, aResult); } + TInt Test0166L(TTestResult& aResult) { return 0; } //return CommonTestL(166, aResult); } + TInt Test0167L(TTestResult& aResult) { return 0; } //return CommonTestL(167, aResult); } + TInt Test0168L(TTestResult& aResult) { return 0; } //return CommonTestL(168, aResult); } + TInt Test0169L(TTestResult& aResult) { return 0; } //return CommonTestL(169, aResult); } + TInt Test0170L(TTestResult& aResult) { return CommonTestL(170, aResult); } + TInt Test0171L(TTestResult& aResult) { return 0; } //return CommonTestL(171, aResult); } + TInt Test0172L(TTestResult& aResult) { return 0; } //return CommonTestL(172, aResult); } + TInt Test0173L(TTestResult& aResult) { return 0; } //return CommonTestL(173, aResult); } + TInt Test0174L(TTestResult& aResult) { return 0; } //return CommonTestL(174, aResult); } + TInt Test0175L(TTestResult& aResult) { return 0; } //return CommonTestL(175, aResult); } + TInt Test0176L(TTestResult& aResult) { return 0; } //return CommonTestL(176, aResult); } + TInt Test0177L(TTestResult& aResult) { return 0; } //return CommonTestL(177, aResult); } + TInt Test0178L(TTestResult& aResult) { return 0; } //return CommonTestL(178, aResult); } + TInt Test0179L(TTestResult& aResult) { return 0; } //return CommonTestL(179, aResult); } + TInt Test0180L(TTestResult& aResult) { return 0; } //return CommonTestL(180, aResult); } + TInt Test0181L(TTestResult& aResult) { return 0; } //return CommonTestL(181, aResult); } + TInt Test0182L(TTestResult& aResult) { return 0; } //return CommonTestL(182, aResult); } + TInt Test0183L(TTestResult& aResult) { return 0; } //return CommonTestL(183, aResult); } + TInt Test0184L(TTestResult& aResult) { return 0; } //return CommonTestL(184, aResult); } + TInt Test0185L(TTestResult& aResult) { return 0; } //return CommonTestL(185, aResult); } + TInt Test0186L(TTestResult& aResult) { return 0; } //return CommonTestL(186, aResult); } + TInt Test0187L(TTestResult& aResult) { return 0; } //return CommonTestL(187, aResult); } + TInt Test0188L(TTestResult& aResult) { return 0; } //return CommonTestL(188, aResult); } + TInt Test0189L(TTestResult& aResult) { return 0; } //return CommonTestL(189, aResult); } + TInt Test0190L(TTestResult& aResult) { return CommonTestL(190, aResult); } + TInt Test0191L(TTestResult& aResult) { return CommonTestL(191, aResult); } + TInt Test0192L(TTestResult& aResult) { return CommonTestL(192, aResult); } + TInt Test0193L(TTestResult& aResult) { return CommonTestL(193, aResult); } + TInt Test0194L(TTestResult& aResult) { return CommonTestL(194, aResult); } + TInt Test0195L(TTestResult& aResult) { return 0; } //return CommonTestL(195, aResult); } + TInt Test0196L(TTestResult& aResult) { return 0; } //return CommonTestL(196, aResult); } + TInt Test0197L(TTestResult& aResult) { return 0; } //return CommonTestL(197, aResult); } + TInt Test0198L(TTestResult& aResult) { return 0; } //return CommonTestL(198, aResult); } + TInt Test0199L(TTestResult& aResult) { return 0; } //return CommonTestL(199, aResult); } + TInt Test0200L(TTestResult& aResult) { return 0; } //return CommonTestL(200, aResult); } + TInt Test0201L(TTestResult& aResult) { return 0; } //return CommonTestL(201, aResult); } + TInt Test0202L(TTestResult& aResult) { return 0; } //return CommonTestL(202, aResult); } + + private: // Data + + // Pointer to test (function) to be executed + TestFunction iMethod; + + // Pointer to an active scheduler. Needed for MCModel + CActiveScheduler* iScheduler; + + // Pointer to a Logger. Helps to write log information + CStifLogger* iLogger; + + CConsoleMain* iMainConsole; + }; + +#endif // MpxCOLLECTIONTEST_H + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/inc/pathoptionisremote.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/inc/pathoptionisremote.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,156 @@ +/* +* Copyright (c) 2002 - 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: MpxCollectionTest test module. +* +*/ + +#ifndef PATHOPTIONISREMOTE_H +#define PATHOPTIONISREMOTE_H + +// INCLUDES +#include "testmenuview.h" + +// MACROS + +// FORWARD DECLARATIONS +class MMPXCollectionUtility; +class CMPXCollectionPath; +class CStifLogger; + +// DATA TYPES +_LIT(KTxtPathOptionIsRemote, "PathOptionIsRemote"); + +// CLASS DECLARATION +class CPathOptionIsRemote : public CTestMenuView, + public MMPXCollectionObserver + { + public: + /** + * Two-phased constructor + * @return object of CConsoleMain + */ + static CPathOptionIsRemote* NewL(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger, + CMPXCollectionPath* aPath); + + /** + * Destructor of CConsoleMain + */ + virtual ~CPathOptionIsRemote(); + +public: //From base classes + /** + * From CTestBaseView + * Initialize the view before display view + */ + void InitializeViewL(); + + /** + * From CTestBaseView + * Cleanup the view before deactivate/destroy view + */ + void CleanupViewL(); + + /** + * From CTestBaseView + * Handle number key press + */ + void HandleNumKeyL(); + + /** + * From CTestBaseView + * Handle left key press + */ + void HandleLeftKeyL(); + + /** + * From CTestBaseView + * Handle right/enter key press + */ + void HandleRightKeyL(); + + /** + * From MMPXCollectionObserver + * Handle extended media properties + * @param aMedia media + * @param aError error code + */ + void HandleCollectionMediaL( + const CMPXMedia& aMedia, + TInt aError); + + /** + * From MMPXCollectionObserver + * Handle collection message + * @param aMessage collection message + */ + void HandleCollectionMessageL(const TMPXCollectionMessage& aMessage); + + /** + * From MMPXCollectionObserver + * Handles the collection entries being opened. Typically called + * when client has Open()'d a folder + * + * @param aEntries collection entries opened + * @param aIndex focused entry + * @param aComplete ETrue no more entries. EFalse more entries + * expected + * @param aError error code + */ + void HandleOpenL(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError); + + /** + * From MMPXCollectionObserver + * Handles the item being opened. Typically called + * when client has Open()'d an item. Client typically responds by + * 'playing' the item via the playlist + * + * @param aPlaylist collection playlist, owner ship is transfered + * @param aError error code + */ + void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError); + +private: + /** + * C++ default constructor. + */ + CPathOptionIsRemote(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger); + + /** + * the second phase constructor ConstructL to safely construct things + * that can leave + */ + void ConstructL(CMPXCollectionPath* aPath); + + /** + * Output a string to RDebug, Stiflogger, and Screen + */ + void OutputStringL(const TDesC& aStr); + + private: //data + MMPXCollectionUtility* iCollectionUtility; //owns + CStifLogger* iLogger; //uses + CMPXCollectionPath* iCollectionPath; + }; + + + +#endif //PATHOPTIONISREMOTE_H + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/inc/pathoptionmenu.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/inc/pathoptionmenu.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,113 @@ +/* +* Copyright (c) 2002 - 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: MpxCollectionTest test module. +* +*/ + +#ifndef PATHOPTIONMENU_H +#define PATHOPTIONMENU_H + +// INCLUDES +#include +#include "testmenuview.h" + + +// MACROS + +// FORWARD DECLARATIONS +class MMPXCollectionUtility; +class CMPXCollectionPath; +class CStifLogger; + +// DATA TYPES +_LIT(KTxtPathOptionMenu, "PathOptionMenu"); + +// CLASS DECLARATION +class CPathOptionMenu : public CTestMenuView + { + public: + /** + * Two-phased constructor + * @return object of CConsoleMain + */ + static CPathOptionMenu* NewL(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger); + + /** + * Destructor of CConsoleMain + */ + virtual ~CPathOptionMenu(); + + /** + * Set the handling path + */ + void SetPathL(CMPXCollectionPath& aPath); + + public: //From base classes + /** + * From CTestBaseView + * Initialize the view before display view + */ + void InitializeViewL(); + + /** + * From CTestBaseView + * Cleanup the view before deactivate/destroy view + */ + void CleanupViewL(); + + /** + * From CTestBaseView + * Handle number key press + */ + void HandleNumKeyL(); + + /** + * From CTestBaseView + * Handle left key press + */ + void HandleLeftKeyL(); + + /** + * From CTestBaseView + * Handle right/enter key press + */ + void HandleRightKeyL(); + + + private: + /** + * C++ default constructor. + */ + CPathOptionMenu(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger); + + /** + * the second phase constructor ConstructL to safely construct things + * that can leave + */ + void ConstructL(); + + private: //data + CStifLogger* iLogger; //uses + CMPXCollectionPath* iCollectionPath; + + + }; + +#endif //PATHOPTIONMENU_H diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/inc/testpanic.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/inc/testpanic.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2002 - 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: test panic code +* +*/ + +#ifndef TESTPANIC_H +#define TESTPANIC_H + +// INCLUDE +#include + +/** Test panic codes */ +enum TTestCommonPanics + { + ETestCommonState = 1, + ETestCommonActiveState, + ETestCommonActiveRunError, + ETestCommonOutOfBound, + ETestCommonCancelError, + ETestCommonTestNotSupport, + // add further panics here + }; + +inline void TestPanic(TTestCommonPanics aReason) + { + _LIT(name, "TestCommon"); + User::Panic(name, aReason); + } + +#endif // TESTPANIC_H diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/inc/testutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/inc/testutility.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,127 @@ +/* +* Copyright (c) 2002 - 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: Provide common utility function for all test cases +* +*/ + +#ifndef TESTUTILITY_H +#define TESTUTILITY_H + +// INCLUDES +#include +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CMPXMedia; +class CMPXMediaArray; +class CMPXCollectionPath; +class CStifLoggger; + +// CONSTANTS + + +// CLASS DECLARATION + +/** +* This static class contains utilities functions +*/ +class TestUtility + { +public: + /** + * Test whether aTest descriptor attribute contains in aContainer + * @param aContainer: media + * @param aTest: media + * @param aAttr: attribute type + * @return ETrue aTest's aAttr is containing in aConatiner + */ + template + static TBool ContainMediaObject(const CMPXMedia& aContainer, const CMPXMedia& aTest, + TMPXAttribute& aAttr, TIdentityRelation anIdentity); + + /** + * Test whether aTest and aContainer are contain media array and match specific content in order + * @param aContainer: media + * @param aTest: media + * @param aAttr: attribute type + * @return ETrue aTest's aAttr is containing in aConatiner + */ + template + static TBool MatchMediaArrayObject(const CMPXMedia& aContainer, const CMPXMedia& aTest, + TMPXAttribute& aAttr, TIdentityRelation anIdentity); + + /** + * Test whether aContainer containing all the T object in aArray with aAttr attribues in order + * @param aContainer: media + * @param aArray: array of T objects + * @param aAttr: attribute type + * @return ETrue aTest's aAttr is containing in aConatiner + */ + template + static TBool MatchMediaArrayObject(const CMPXMedia& aContainer, const RArray& aArray, + TMPXAttribute& aAttr, TIdentityRelation anIdentity); + + /** + * Test whether aContainer containing all the text object in aArray with aAttr attribues in order + * @param aContainer: media + * @param aArray: array of text objects + * @param aAttr: attribute type + * @return ETrue aTest's aAttr is containing in aConatiner + */ + static TBool MatchMediaArrayTextObject(const CMPXMedia& aContainer, const MDesC16Array& aArray, + TMPXAttribute& aAttr); + + + /** + * Log the content of collection path. Only selection of each level and top level Ids are logged + * @param aPath a path to log + * @param aLogger a logger to log the message + */ + //static void LogCollectionPath(CMPXCollectionPath& aPath, CStifLogger* aLogger); + +private: + /** + * Test whether aMedia1 and aMedia2 support same attribute + * @param aMedia1: media + * @param aMedia2: media + * @param aAttr: attribute type to match + * @return ETrue aMedia1 and aMedia2 has same aAttr attribute + */ + static TBool ValidateMediaObject(const CMPXMedia& aMedia1, const CMPXMedia& aMedia2, + TMPXAttribute& aAttr); + + /** + * Test whether aMedia1 and aMedia2 support same array attribute + * @param aMedia1: media + * @param aMedia2: media + * @return ETrue aMedia1 and aMedia2 has same aAttr attribute + */ + static TBool ValidateMediaArrayObject(const CMPXMedia& aMedia1, const CMPXMedia& aMedia2); + + /** + * Test whether aMedia is media array and same count as aArray + * @param aMedia: media + * @param aArray: an array of items + * @return ETrue aMedia is array object and same count as aArray + */ + static TBool ValidateMediaArrayObject(const CMPXMedia& aMedia, TInt aArrayCnt); + }; + +#include "testutility.inl" + +#endif // TESTUTILITY_H diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/inc/testutility.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/inc/testutility.inl Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,96 @@ +/* +* Copyright (c) 2002 - 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: Provide common utility function for all test cases +* +*/ + +// ---------------------------------------------------------------------------------------------------------- +// Test whether aTest descriptor attribute contains in aContainer +// ---------------------------------------------------------------------------------------------------------- +// +template +TBool TestUtility::ContainMediaObject(const CMPXMedia& aContainer, const CMPXMedia& aTest, + TMPXAttribute& aAttr, TIdentityRelation anIdentity) + { + TBool match = ValidateMediaObject(aContainer, aTest, aAttr); // assume true + if( match ) + { + const T* contObj = aContainer.Value( aAttr ); + const T* testObj = aTest.Value( aAttr ); + match = (*anIdentity)(contObj, testObj); + } + return match; + } + +// ---------------------------------------------------------------------------------------------------------- +// Test whether aTest and aContainer are contain media array and match specific content +// ---------------------------------------------------------------------------------------------------------- +// +template +TBool TestUtility::MatchMediaArrayObject(const CMPXMedia& aContainer, const CMPXMedia& aTest, + TMPXAttribute& aAttr, TIdentityRelation anIdentity) + { + TBool match = ValidateMediaArrayObject(aContainer, aTest); + if( match ) + { + TMPXAttribute arrAttr(KMPXMediaIdContainer,EMPXMediaArrayContents); + CMPXMediaArray* contArray = aContainer.Value( arrAttr ); + CMPXMediaArray* testArray = aTest.Value( arrAttr ); + TInt testCnt = testArray->Count(); + + for(TInt i = 0; i < testCnt; i++) + { + const CMPXMedia* contItem = ( *contArray )[i]; + const CMPXMedia* testItem = ( *testArray )[i]; + if( !TestUtility::ContainMediaObject(*contItem, *testItem, aAttr, anIdentity) ) + { + match = EFalse; + break; + } + } + } + return match; + } + + +// ---------------------------------------------------------------------------------------------------------- +// Test whether aContainer containing all the T object in aArray with aAttr attribues in order +// ---------------------------------------------------------------------------------------------------------- +// +template +TBool TestUtility::MatchMediaArrayObject(const CMPXMedia& aContainer, const RArray& aArray, + TMPXAttribute& aAttr, TIdentityRelation anIdentity) + { + TBool match = ValidateMediaArrayObject(aContainer, aArray.Count()); + if( match ) + { + CMPXMediaArray* contArray = aContainer.Value( TMPXAttribute(KMPXMediaIdContainer,EMPXMediaArrayContents) ); + TInt contCnt = contArray->Count(); + + for(TInt i = 0; i < contCnt; i++) + { + const CMPXMedia* contItem = ( *contArray )[i]; + const T* contObj = contItem->Value( aAttr ); + if(contObj == NULL || !(*anIdentity)(contObj, &aArray[i]) ) + { + match = EFalse; + break; + } + } + } + return match; + } + +// END OF FILE + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/src/collectionbrowser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/src/collectionbrowser.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,381 @@ +/* +* Copyright (c) 2002 - 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: MpxCollectionTest test module. +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include // KMPXMessageGeneralEvent, KMPXMessageGeneralType +#include +#include +#include +#include +#include +#include +#include +#include +#include "pathoptionmenu.h" +#include "collectionbrowser.h" + +// MACROS + +// DATA TYPES + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCollectionBrowser::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +/* +CCollectionBrowser* CCollectionBrowser::NewL(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC16& aName, + CStifLogger* aLogger, + CMPXCollectionPath* aPath) + { + CCollectionBrowser* self = CCollectionBrowser::NewL(aConsoleMain, + aParent, + aName, + aLogger); + CleanupStack::PopAndDestroy(self); + + return self; + } + */ +// ----------------------------------------------------------------------------- +// CCollectionBrowser::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCollectionBrowser* CCollectionBrowser::NewLC(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC16& aName, + CStifLogger* aLogger, + CMPXCollectionPath* aPath) + { + CCollectionBrowser* self = new (ELeave) CCollectionBrowser(aConsoleMain, + aParent, + aName, + aLogger); + + CleanupStack::PushL( self ); + self->ConstructL(aPath); + + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +CCollectionBrowser::~CCollectionBrowser() + { + iLogger->Log(_L("+CCollectionBrowser::~CCollectionBrowser")); + + if(iCollectionUtility) + iCollectionUtility->Close(); + if(iCollectionPath) + delete iCollectionPath; + if(iPlaybackUtility) + delete iPlaybackUtility; + iLogger->Log(_L("-CCollectionBrowser::~CCollectionBrowser")); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Initialize the view before display view +// ----------------------------------------------------------------------------- +void CCollectionBrowser::InitializeViewL() + { + iLogger->Log(_L("+CCollectionBrowser::InitializeViewL")); + +/* + // Resynchronize podcast databases + TUid collection = KPodcastCollection; + collection = iCollectionUtility-> + Collection().CollectionIDL( collection ); + TRAP_IGNORE( + iCollectionUtility-> + Collection().CommandL( EMcCmdCollectionInit, + collection.iUid ) ); + + // Resynchronize music collection databases + collection = KLocalCollection; + collection = iCollectionUtility-> + Collection().CollectionIDL( collection ); + iCollectionUtility->Collection().CommandL( EMcCmdCollectionInit, + collection.iUid ); +*/ + + // ConstructL() did the Utility->NewL() already. + + if( iCollectionPath ) + iCollectionUtility->Collection().OpenL(*iCollectionPath); + else + iCollectionUtility->Collection().OpenL(); + + iLogger->Log(_L("-CCollectionBrowser::InitializeViewL")); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Cleanup the view before deactivate/destroy view +// ----------------------------------------------------------------------------- +void CCollectionBrowser::CleanupViewL() + { + if(iPlaybackUtility) + { + delete iPlaybackUtility; + iPlaybackUtility = NULL; + } + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle number key press +// ----------------------------------------------------------------------------- +void CCollectionBrowser::HandleNumKeyL() + { + /* + TKeyCode key = LastKeyPressed(); + if((int)key == '1') + { + CPathOptionMenu* pathOptionMenu = + CPathOptionMenu::NewL(iConsoleMain, + this, + KTxtPathOptionMenu, + iLogger); + CleanupStack::PushL(pathOptionMenu); + CMPXCollectionPath* path = iCollectionUtility->Collection().PathL(); + CleanupStack::PushL(path); + path->SelectL(CurrentIndex()); //change to selected path + pathOptionMenu->SetPathL(*path); + CleanupStack::PopAndDestroy(path); + NextViewL(pathOptionMenu); + CleanupStack::Pop(pathOptionMenu); + iChild = static_cast(pathOptionMenu); + } + */ + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle left key press +// ----------------------------------------------------------------------------- +void CCollectionBrowser::HandleLeftKeyL() + { + iLogger->Log(_L("+CCollectionBrowser::HandleLeftKeyL")); + CMPXCollectionPath* currPath = iCollectionUtility->Collection().PathL(); + CleanupStack::PushL( currPath ); + if(currPath->Levels() > 1) + { + iCollectionUtility->Collection().BackL(); + } + // otherwise current path is at or below root level, thereofeore, no back call + CleanupStack::PopAndDestroy( currPath ); + iLogger->Log(_L("-CCollectionBrowser::HandleLeftKeyL")); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle right/enter key press +// ----------------------------------------------------------------------------- +void CCollectionBrowser::HandleRightKeyL() + { + iLogger->Log(_L("+CCollectionBrowser::HandleRightKeyL")); + TInt count = ItemCount(); + TInt index = CurrentIndex(); + + if(count > 0 && index >= 0 && index < count) + { + iCollectionUtility->Collection().OpenL( index ); + } + iLogger->Log(_L("-CCollectionBrowser::HandleRightKeyL")); + } + +// ----------------------------------------------------------------------------- +// CCollectionBrowser::HandleCollectionMediaL +// ----------------------------------------------------------------------------- +// +void CCollectionBrowser::HandleCollectionMediaL( + const CMPXMedia& aMedia, + TInt aError) + { + if(aError == KErrNone) + { + // Assume root plugins title will be returned only + // see CCollectionBrowser::HandleOpenL + TMPXAttribute titleAttr(KMPXMediaIdGeneral,EMPXMediaGeneralTitle); + if( aMedia.IsSupported(titleAttr) ) + { + const TDesC& title = aMedia.ValueText( titleAttr ); + // TestUtility::TestLog(iLogger, _L("%S\n"), &title); + AddItemL(title); + } + DisplayViewL(); + } + } + +// ----------------------------------------------------------------------------- +// CCollectionBrowser::HandleCollectionMessageL +// ----------------------------------------------------------------------------- +// +void CCollectionBrowser::HandleCollectionMessageL(const CMPXMessage& aMsg) + { + iLogger->Log(_L("+CCollectionBrowser::HandleCollectionMessageL")); + + if( aMsg.IsSupported(KMPXMessageGeneralEvent) && + aMsg.IsSupported(KMPXMessageGeneralType) ) + { + TMPXCollectionMessage::TEvent event = + *aMsg.Value( KMPXMessageGeneralEvent ); + TInt type = *aMsg.Value( KMPXMessageGeneralType ); + TInt data = *aMsg.Value( KMPXMessageGeneralData ); + TMPXCollectionMessage message(event, type, data); + + if (message.Event() == TMPXCollectionMessage::EPathChanged && + message.Type() == EMcPathChangedByOpen) + { + // Open new entries + iCollectionUtility->Collection().OpenL(); + } + + iLogger->Log(_L("CCollectionBrowser: Message %d Returned: type=%d data=%d"), + message.Event(), + message.Type(), + message.Data()); + + iLogger->Log(_L("-CCollectionBrowser::HandleCollectionMessageL")); + } + } + +// ----------------------------------------------------------------------------- +// CCollectionBrowser::HandleCollectionMessageL +// ----------------------------------------------------------------------------- +// +void CCollectionBrowser::HandleOpenL(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + iLogger->Log(_L("+CCollectionBrowser::HandleOpenL")); + if(!aEntries.IsSupported(TMPXAttribute(KMPXMediaIdContainer,EMPXMediaArrayContents)) || + !aEntries.IsSupported(TMPXAttribute(KMPXMediaIdContainer,EMPXMediaArrayCount)) ) + User::Panic(_L("NOT appropiate array media"), -1); + + CMPXMediaArray* media = + aEntries.ValueCObjectL( TMPXAttribute(KMPXMediaIdContainer, EMPXMediaArrayContents) ); + CleanupStack::PushL( media ); + + (void)aComplete; + iItems->Reset(); + if(aError == KErrNone) + { + TMPXAttribute uidAttr(KMPXMediaIdGeneral,EMPXMediaGeneralId); + TMPXAttribute titleAttr(KMPXMediaIdGeneral,EMPXMediaGeneralTitle); + + CMPXCollectionPath* currPath = iCollectionUtility->Collection().PathL(); + CleanupStack::PushL( currPath ); + + for(TInt i=0; iCount(); i++) + { + const CMPXMedia* entry = ( *media )[i]; + if(currPath->Levels() == 1) + { + // Assume at root level, use MediaL to get plugin name + CMPXCollectionPath* rootPath = CMPXCollectionPath::NewL(); + CleanupStack::PushL( rootPath ); + TMPXItemId uid = entry->ValueTObjectL( uidAttr ); + rootPath->AppendL( uid ); + RArray attrs; + CleanupClosePushL( attrs ); + attrs.Append( titleAttr ); + + iCollectionUtility->Collection().MediaL(*rootPath, attrs.Array()); + CleanupStack::PopAndDestroy(2, rootPath ); //attrs, rootPath + } + else + { + // Assume browsing within plugin already + const TDesC& title = entry->ValueText( titleAttr ); + // TestUtility::TestLog(iLogger, _L("%S\n"), &title); + AddItemL(title); + } + } + CleanupStack::PopAndDestroy( currPath ); + } + iPosOnScreen = aIndex; + DisplayViewL(); + + CleanupStack::PopAndDestroy(media); + iLogger->Log(_L("-CCollectionBrowser::HandleOpenL")); + } + +// ----------------------------------------------------------------------------- +// CCollectionBrowser::HandleCollectionMessageL +// ----------------------------------------------------------------------------- +// +void CCollectionBrowser::HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError) + { + (void)aError; + CTestPlaybackView* view = CTestPlaybackView::NewL(iConsoleMain, + this, + KTxtTestPlaybackView, + iLogger); + iPlaybackUtility = CTestPlaybackUtility::NewL(KPbModeNewPlayer, + view, + iLogger); + view->AddObserver(iPlaybackUtility); + CleanupStack::PushL(view); + iPlaybackUtility->InitL(aPlaylist); + CleanupStack::Pop(view); + iChild = static_cast(view); + NextViewL(iChild); + } + +// ----------------------------------------------------------------------------- +// C++ default constructor. +// ----------------------------------------------------------------------------- +CCollectionBrowser::CCollectionBrowser(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger) + : CTestMenuView(aConsoleMain, aParent, aName) + { + iCollectionUtility = NULL; // set by ConstructL() + iLogger = aLogger; + iCollectionPath = NULL; // set by ConstructL() if path != NULL + iPlaybackUtility = NULL; + } + +// ----------------------------------------------------------------------------- +// Second phase constructor +// ----------------------------------------------------------------------------- +void CCollectionBrowser::ConstructL(CMPXCollectionPath* aPath) + { + iLogger->Log(_L("+CCollectionBrowser::ConstructL")); + iCollectionUtility = MMPXCollectionUtility::NewL(this); + if(aPath) + { + iCollectionPath = CMPXCollectionPath::NewL(*aPath); + } + CTestMenuView::ConstructL(); + iLogger->Log(_L("-CCollectionBrowser::ConstructL")); + } + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/src/collectiontests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/src/collectiontests.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,5269 @@ +/* +* Copyright (c) 2002 - 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: MpxCollectionTest test module. +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include // KMPXMessageGeneralEvent, KMPXMessageGeneralType +#include +#include +#include +#include +#include +#include "testutility.h" +#include "testplaybackview.h" +#include "pathoptionmenu.h" +#include "collectiontests.h" +#include "testpanic.h" + +// MACROS + +#define DELETE_PTR( PTR_VAR )\ + if( PTR_VAR )\ + {\ + delete PTR_VAR;\ + PTR_VAR = NULL;\ + } + +#define DELETE_COLLECTION_PTR( PTR_VAR )\ + if( PTR_VAR )\ + {\ + PTR_VAR->Close();\ + PTR_VAR = NULL;\ + } + +// return on failure +#define TMC_ASSERT( _TMCcode, _TMCcheckpt )\ + {\ + AssertL( _TMCcode, _TMCcheckpt );\ + if( !(_TMCcode ) )\ + {\ + return;\ + }\ + } + + +// DATA TYPES + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCollectionTests::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCollectionTests* CCollectionTests::NewL(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger, + TInt testIndex) + { + CCollectionTests* self = CCollectionTests::NewLC(aConsoleMain, + aParent, + aName, + aLogger, + testIndex); + CleanupStack::PopAndDestroy(self); + + return self; + } + +// ----------------------------------------------------------------------------- +// CCollectionTests::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCollectionTests* CCollectionTests::NewLC(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger, + TInt testIndex) + { + CCollectionTests* self = new (ELeave) CCollectionTests(aConsoleMain, + aParent, + aName, + aLogger, + testIndex); + + CleanupStack::PushL( self ); + self->ConstructL(); + + return self; + } + +// ----------------------------------------------------------------------------- +// C++ default constructor. +// ----------------------------------------------------------------------------- +CCollectionTests::CCollectionTests(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger, + TInt testIndex) + : CTestMenuView(aConsoleMain, aParent, aName), + iCollectionUtility1(NULL), + iCollectionUtility2(NULL), + iLogger(aLogger), + iTestIndex(testIndex), + iStopAtTestIndex(testIndex), + iTempCnt(0), + iLatestTestResult(KErrNone) + { + // set stop index for groups + switch(iTestIndex) + { + case 21: iStopAtTestIndex = 35; break; + case 36: iStopAtTestIndex = 41; break; + case 42: iStopAtTestIndex = 53; break; + case 54: iStopAtTestIndex = 60; break; + case 70: iStopAtTestIndex = 81; break; + case 82: iStopAtTestIndex = 100; break; + case 101: iStopAtTestIndex = 109; break; + case 110: iStopAtTestIndex = 120; break; + case 121: iStopAtTestIndex = 140; break; + case 141: iStopAtTestIndex = 149; break; + case 150: iStopAtTestIndex = 169; break; + case 170: iStopAtTestIndex = 184; break; + case 185: iStopAtTestIndex = 189; break; + case 194: iStopAtTestIndex = 202; break; + } + } + +// ----------------------------------------------------------------------------- +// Second phase constructor +// ----------------------------------------------------------------------------- +void CCollectionTests::ConstructL() + { + CTestMenuView::ConstructL(); + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +CCollectionTests::~CCollectionTests() + { + iLogger->Log(_L("+CCollectionTests::~CCollectionTests")); + + DELETE_COLLECTION_PTR(iCollectionUtility1); + DELETE_COLLECTION_PTR(iCollectionUtility2); + + iLogger->Log(_L("-CCollectionTests::~CCollectionTests")); + } + +// ----------------------------------------------------------------------------- +// Return whether test requires scheduler for aysynchronous wait. +// ----------------------------------------------------------------------------- + +TBool CCollectionTests::IsTestSynchronous(int testIndex) + { + // some cases do not use callbacks; so, no need to use scheduler + return (testIndex == 20 ) || (testIndex >= 190 && testIndex <= 193); + } + +// ----------------------------------------------------------------------------- +// Result from latest test +// ----------------------------------------------------------------------------- +TInt CCollectionTests::GetLatestTestResult() + { + return iLatestTestResult; + } + + +// ----------------------------------------------------------------------------- +// Stop the current test +// ----------------------------------------------------------------------------- +void CCollectionTests::TestCompleteL() + { + CurrentViewDoneL(); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle number key press +// ----------------------------------------------------------------------------- +void CCollectionTests::HandleNumKeyL() + { + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle left key press +// ----------------------------------------------------------------------------- +void CCollectionTests::HandleLeftKeyL() + { + iLogger->Log(_L("+CCollectionTests::HandleLeftKeyL")); + + iLogger->Log(_L("-CCollectionTests::HandleLeftKeyL")); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle right/enter key press +// ----------------------------------------------------------------------------- +void CCollectionTests::HandleRightKeyL() + { + iLogger->Log(_L("+CCollectionTests::HandleRightKeyL")); + + iLogger->Log(_L("-CCollectionTests::HandleRightKeyL")); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Cleanup the view before deactivate/destroy view +// ----------------------------------------------------------------------------- +void CCollectionTests::CleanupViewL() + { + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Initialize the view before display view +// ----------------------------------------------------------------------------- +void CCollectionTests::InitializeViewL() + { + Collection1_Initialize(); + } + +void CCollectionTests::RunNext() + { + if(iStopAtTestIndex == iTestIndex) + { + TestCompleteL(); + return; + } + + iTestIndex++; + + StartNextTestL(); + } + +void CCollectionTests::StartNextTestL() +{ + switch(iTestIndex) + { + case 1: StartTest0001L(); break; + case 2: StartTest0002L(); break; + case 3: StartTest0003L(); break; + case 4: StartTest0004L(); break; + case 5: StartTest0005L(); break; + case 6: StartTest0006L(); break; + case 7: StartTest0007L(); break; + case 8: StartTest0008L(); break; + case 9: StartTest0009L(); break; + case 10: StartTest0010L(); break; + case 11: StartTest0011L(); break; + case 12: StartTest0012L(); break; + case 13: StartTest0013L(); break; + case 14: StartTest0014L(); break; + case 15: StartTest0015L(); break; + case 16: StartTest0016L(); break; + case 17: StartTest0017L(); break; + case 18: StartTest0018L(); break; + case 19: StartTest0019L(); break; + case 20: StartTest0020L(); break; + case 21: StartTest0021L(); break; + case 22: StartTest0022L(); break; + case 23: StartTest0023L(); break; + case 24: StartTest0024L(); break; + case 25: StartTest0025L(); break; + case 26: StartTest0026L(); break; + case 27: StartTest0027L(); break; + case 28: StartTest0028L(); break; + case 29: StartTest0029L(); break; + case 30: StartTest0030L(); break; + case 31: StartTest0031L(); break; + case 32: StartTest0032L(); break; + case 33: StartTest0033L(); break; + case 34: StartTest0034L(); break; + case 35: StartTest0035L(); break; + case 36: StartTest0036L(); break; + case 37: StartTest0037L(); break; + case 38: StartTest0038L(); break; + case 39: StartTest0039L(); break; + case 40: StartTest0040L(); break; + case 41: StartTest0041L(); break; + case 42: StartTest0042L(); break; + case 43: StartTest0043L(); break; + case 44: StartTest0044L(); break; + case 45: StartTest0045L(); break; + case 46: StartTest0046L(); break; + case 47: StartTest0047L(); break; + case 48: StartTest0048L(); break; + case 49: StartTest0049L(); break; + case 50: StartTest0050L(); break; + case 51: StartTest0051L(); break; + case 52: StartTest0052L(); break; + case 53: StartTest0053L(); break; + case 54: StartTest0054L(); break; + case 55: StartTest0055L(); break; + case 56: StartTest0056L(); break; + case 57: StartTest0057L(); break; + case 58: StartTest0058L(); break; + case 59: StartTest0059L(); break; + case 60: StartTest0060L(); break; + case 61: StartTest0061L(); break; + case 62: StartTest0062L(); break; + case 63: StartTest0063L(); break; + case 64: StartTest0064L(); break; + case 65: StartTest0065L(); break; + case 66: StartTest0066L(); break; + case 67: StartTest0067L(); break; + case 68: StartTest0068L(); break; + case 69: StartTest0069L(); break; + case 70: StartTest0070L(); break; + case 71: StartTest0071L(); break; + case 72: StartTest0072L(); break; + case 73: StartTest0073L(); break; + case 74: StartTest0074L(); break; + case 75: StartTest0075L(); break; + case 76: StartTest0076L(); break; + case 77: StartTest0077L(); break; + case 78: StartTest0078L(); break; + case 79: StartTest0079L(); break; + case 80: StartTest0080L(); break; + case 81: StartTest0081L(); break; + case 82: StartTest0082L(); break; + case 83: StartTest0083L(); break; + case 84: StartTest0084L(); break; + case 85: StartTest0085L(); break; + case 86: StartTest0086L(); break; + case 87: StartTest0087L(); break; + case 88: StartTest0088L(); break; + case 89: StartTest0089L(); break; + case 90: StartTest0090L(); break; + case 91: StartTest0091L(); break; + case 92: StartTest0092L(); break; + case 93: StartTest0093L(); break; + case 94: StartTest0094L(); break; + case 95: StartTest0095L(); break; + case 96: StartTest0096L(); break; + case 97: StartTest0097L(); break; + case 98: StartTest0098L(); break; + case 99: StartTest0099L(); break; + case 100: StartTest0100L(); break; + case 101: StartTest0101L(); break; + case 102: StartTest0102L(); break; + case 103: StartTest0103L(); break; + case 104: StartTest0104L(); break; + case 105: StartTest0105L(); break; + case 106: StartTest0106L(); break; + case 107: StartTest0107L(); break; + case 108: StartTest0108L(); break; + case 109: StartTest0109L(); break; + case 110: StartTest0110L(); break; + case 111: StartTest0111L(); break; + case 112: StartTest0112L(); break; + case 113: StartTest0113L(); break; + case 114: StartTest0114L(); break; + case 115: StartTest0115L(); break; + case 116: StartTest0116L(); break; + case 117: StartTest0117L(); break; + case 118: StartTest0118L(); break; + case 119: StartTest0119L(); break; + case 120: StartTest0120L(); break; + case 121: StartTest0121L(); break; + case 122: StartTest0122L(); break; + case 123: StartTest0123L(); break; + case 124: StartTest0124L(); break; + case 125: StartTest0125L(); break; + case 126: StartTest0126L(); break; + case 127: StartTest0127L(); break; + case 128: StartTest0128L(); break; + case 129: StartTest0129L(); break; + case 130: StartTest0130L(); break; + case 131: StartTest0131L(); break; + case 132: StartTest0132L(); break; + case 133: StartTest0133L(); break; + case 134: StartTest0134L(); break; + case 135: StartTest0135L(); break; + case 136: StartTest0136L(); break; + case 137: StartTest0137L(); break; + case 138: StartTest0138L(); break; + case 139: StartTest0139L(); break; + case 140: StartTest0140L(); break; + case 141: StartTest0141L(); break; + case 142: StartTest0142L(); break; + case 143: StartTest0143L(); break; + case 144: StartTest0144L(); break; + case 145: StartTest0145L(); break; + case 146: StartTest0146L(); break; + case 147: StartTest0147L(); break; + case 148: StartTest0148L(); break; + case 149: StartTest0149L(); break; + case 150: StartTest0150L(); break; + case 151: StartTest0151L(); break; + case 152: StartTest0152L(); break; + case 153: StartTest0153L(); break; + case 154: StartTest0154L(); break; + case 155: StartTest0155L(); break; + case 156: StartTest0156L(); break; + case 157: StartTest0157L(); break; + case 158: StartTest0158L(); break; + case 159: StartTest0159L(); break; + case 160: StartTest0160L(); break; + case 161: StartTest0161L(); break; + case 162: StartTest0162L(); break; + case 163: StartTest0163L(); break; + case 164: StartTest0164L(); break; + case 165: StartTest0165L(); break; + case 166: StartTest0166L(); break; + case 167: StartTest0167L(); break; + case 168: StartTest0168L(); break; + case 169: StartTest0169L(); break; + case 170: StartTest0170L(); break; + case 171: StartTest0171L(); break; + case 172: StartTest0172L(); break; + case 173: StartTest0173L(); break; + case 174: StartTest0174L(); break; + case 175: StartTest0175L(); break; + case 176: StartTest0176L(); break; + case 177: StartTest0177L(); break; + case 178: StartTest0178L(); break; + case 179: StartTest0179L(); break; + case 180: StartTest0180L(); break; + case 181: StartTest0181L(); break; + case 182: StartTest0182L(); break; + case 183: StartTest0183L(); break; + case 184: StartTest0184L(); break; + case 185: StartTest0185L(); break; + case 186: StartTest0186L(); break; + case 187: StartTest0187L(); break; + case 188: StartTest0188L(); break; + case 189: StartTest0189L(); break; + case 190: StartTest0190L(); break; + case 191: StartTest0191L(); break; + case 192: StartTest0192L(); break; + case 193: StartTest0193L(); break; + case 194: StartTest0194L(); break; + case 195: StartTest0195L(); break; + case 196: StartTest0196L(); break; + case 197: StartTest0197L(); break; + case 198: StartTest0198L(); break; + case 199: StartTest0199L(); break; + case 200: StartTest0200L(); break; + case 201: StartTest0201L(); break; + case 202: StartTest0202L(); break; + } + } + +TInt CCollectionTests::StartTest0001L() + { + // Initialization + iLogger->Log( KTextApiNewL ); + + iCollectionUtility1->Collection().OpenL(); + return 0; + } + +TInt CCollectionTests::StartTest0002L() + { + // MMPXCollectionUtility::CollectionIDL not implemented + iLogger->Log( KTextApiCollectionIDL ); + iLogger->Log( KTextNotImplemented ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0003L() + { + // MMPXCollectionUtility::CollectionIDL not implemented + iLogger->Log( KTextApiCollectionIDL ); + iLogger->Log( KTextNotImplemented ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0004L() + { + // MMPXCollectionUtility::CollectionIDL not implemented + iLogger->Log( KTextApiCollectionIDL ); + iLogger->Log( KTextNotImplemented ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0005L() + { + // MMPXCollectionUtility::CollectionIDL not implemented + iLogger->Log( KTextApiCollectionIDL ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0006L() + { + // MMPXCollectionUtility::CollectionIDL not implemented + iLogger->Log( KTextApiCollectionIDL ); + iLogger->Log( KTextNotImplemented ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0007L() + { + // MMPXCollectionUtility::CollectionIDL not implemented + iLogger->Log( KTextApiCollectionIDL ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0008L() + { + // MMPXCollectionUtility::CollectionIDL not implemented + iLogger->Log( KTextApiCollectionIDL ); + iLogger->Log( KTextNotImplemented ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0009L() + { + // MMPXCollection::OpenL + iLogger->Log( KTextApiOpenL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0010L() + { + // MMPXCollection::OpenL + iLogger->Log( KTextApiOpenL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0011L() + { + iLogger->Log( KTextApiOpenL ); + Collection2_InitializeAndOpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0012L() + { + // Included in Test0011 + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0013L() + { + iLogger->Log( KTextApiOpenL ); + Collection2_InitializeAndOpenL( EMPXOpenGroupOrPlaylist ); + return 0; + } + +TInt CCollectionTests::StartTest0014L() + { + // Included in Test0013 + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0015L() + { + iLogger->Log( KTextApiOpenL ); + Collection2_InitializeAndOpenL( EMPXOpenAllItems ); + return 0; + } + +TInt CCollectionTests::StartTest0016L() + { + // Included in Test0015 + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0017L() + { + iLogger->Log( KTextApiOpenL ); + Collection2_InitializeAndOpenL( EMPXOpenNoPlaylist ); + return 0; + } + +TInt CCollectionTests::StartTest0018L() + { + // Included in Test0017 + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0019L() + { + iLogger->Log( KTextApiOpenL ); + Collection2_InitializeAndOpenL( EMPXOpenPlaylistOnly ); + return 0; + } + +TInt CCollectionTests::StartTest0020L() + { + // Included in Test0019 + //RunNext(); + + // copy case 19 here + iLogger->Log( KTextApiOpenL ); + Collection2_InitializeAndOpenL( EMPXOpenPlaylistOnly ); + + // Cleanup up iCollectionUtility2 + DELETE_COLLECTION_PTR(iCollectionUtility2); + + return 0; + } + +TInt CCollectionTests::StartTest0021L() + { + iLogger->Log( KTextApiOpenL ); + + + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault); + return 0; + } + +TInt CCollectionTests::StartTest0022L() + { + iLogger->Log( KTextApiOpenL ); + iCollectionUtility1->Collection().OpenL(KColTestPluginIndex, EMPXOpenDefault); + return 0; + } + +TInt CCollectionTests::StartTest0023L() + { + iLogger->Log( KTextApiOpenL ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0024L() + { + iLogger->Log( KTextApiOpenL ); + // No HandleMessage should be received, since No Path and No Collection plugin changed + iCollectionUtility1->Collection().OpenL( EMPXOpenGroupOrPlaylist ); + return 0; + } + +TInt CCollectionTests::StartTest0025L() + { + iLogger->Log( KTextApiOpenL ); + // No HandleMessage should be received, since No Path and No Collection plugin changed + iCollectionUtility1->Collection().OpenL( EMPXOpenAllItems ); + return 0; + } + +TInt CCollectionTests::StartTest0026L() + { + iLogger->Log( KTextApiOpenL ); + // No HandleMessage should be received, since No Path and No Collection plugin changed + iCollectionUtility1->Collection().OpenL( EMPXOpenNoPlaylist ); + return 0; + } + +TInt CCollectionTests::StartTest0027L() + { + iLogger->Log( KTextApiOpenL ); + // No HandleMessage should be received, since No Path and No Collection plugin changed + // TODO: SINCE TMPXOpenMode IS DECPRECATED, REMOVED THESE TEST SOONER OR LATER + iCollectionUtility1->Collection().OpenL( EMPXOpenPlaylistOnly ); + return 0; + } + +TInt CCollectionTests::StartTest0028L() + { + iLogger->Log( KTextApiOpenL ); + // No HandleMessage should be received, since No Path and No Collection plugin changed + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0029L() + { + iLogger->Log( KTextApiOpenL ); + // Open first entry in CollectionTestPlugin root menu + iCollectionUtility1->Collection().OpenL(0, EMPXOpenDefault); + return 0; + } + +TInt CCollectionTests::StartTest0030L() + { + iLogger->Log( KTextApiOpenL ); + // Open the CollectionTestPlugin root menu through path + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + RArray attrs; + CleanupClosePushL( attrs ); + attrs.Append( KMPXMediaGeneralId ); //TODO: NOTE: attribute is not selected through path + path->Set( attrs.Array() ); + + iCollectionUtility1->Collection().OpenL(*path, EMPXOpenDefault); + CleanupStack::PopAndDestroy(2, path); // attrs, path + return 0; + } + +TInt CCollectionTests::StartTest0031L() + { + iLogger->Log( KTextApiOpenL ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0032L() + { + iLogger->Log( KTextApiOpenL ); + // Open second entry in CollectionTestPlugin root menu + RArray attrs; + CleanupClosePushL( attrs ); + attrs.Append( KMPXMediaGeneralId ); + attrs.Append( KMPXMediaGeneralUri ); + + iCollectionUtility1->Collection().OpenL(1, attrs.Array(), EMPXOpenDefault); + CleanupStack::PopAndDestroy( &attrs ); // attrs + return 0; + } + +TInt CCollectionTests::StartTest0033L() + { + iLogger->Log( KTextApiOpenL ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0034L() + { + iLogger->Log( KTextApiOpenL ); + // Open the CollectionTestPlugin container level13 through path + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 13 ); + + RArray attrs; + CleanupClosePushL( attrs ); + attrs.Append( KMPXMediaGeneralId ); + attrs.Append( KMPXMediaGeneralUri ); + + iCollectionUtility1->Collection().OpenL(*path, attrs.Array(), EMPXOpenDefault); + CleanupStack::PopAndDestroy(2, path); // attrs, path + return 0; + } + +TInt CCollectionTests::StartTest0035L() + { + iLogger->Log( KTextApiOpenL ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0036L() + { + iLogger->Log( KTextApiOpenL ); + RArray uidArray; + CleanupClosePushL( uidArray ); + uidArray.Append( TUid::Uid( ECollectionTestPluginType ) ); + iCollectionUtility1->Collection().OpenL(uidArray.Array(), EMPXOpenDefault); + CleanupStack::PopAndDestroy( &uidArray ); + return 0; + } + +TInt CCollectionTests::StartTest0037L() + { + iLogger->Log( KTextApiOpenL ); + RArray uidArray; + CleanupClosePushL( uidArray ); + uidArray.Append( TUid::Uid( EMPXCollectionPluginMusic ) ); + uidArray.Append( TUid::Uid( EMPXCollectionPluginPodCast ) ); + iCollectionUtility1->Collection().OpenL(uidArray.Array(), EMPXOpenDefault); + CleanupStack::PopAndDestroy( &uidArray ); + return 0; + } + +TInt CCollectionTests::StartTest0038L() + { + iLogger->Log( KTextApiOpenL ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0039L() + { + iLogger->Log( KTextApiOpenL ); + // No plugin Id should returned through HandleOpenL + iCollectionUtility1->Collection().OpenL(TUid::Uid(EMPXCollectionPluginUnknown), EMPXOpenDefault); + return 0; + } + +TInt CCollectionTests::StartTest0040L() + { + iLogger->Log( KTextApiOpenL ); + iCollectionUtility1->Collection().OpenL(TUid::Uid( ECollectionTestPluginType ), EMPXOpenDefault); + return 0; + } + +TInt CCollectionTests::StartTest0041L() + { + iLogger->Log( KTextApiOpenL ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0042L() + { + iLogger->Log( KTextApiSetFilterL ); + CMPXFilter* filter = CMPXFilter::NewL(); + CleanupStack::PushL( filter ); + + TMPXAttribute titleAttr(KMPXMediaGeneralTitle); + TMPXAttribute idAttr(KMPXMediaGeneralId); + + // Filter out Title="level211" + filter->SetTextValueL(titleAttr, _L("level211")); + // Filter out Id=213 + filter->SetTObjectValueL(idAttr, 213); + + iCollectionUtility1->Collection().SetFilterL( filter ); + CleanupStack::PopAndDestroy( filter ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0043L() + { + iLogger->Log( KTextApiSetFilterL ); + // Open the CollectionTestPlugin container "level11" + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 11 ); + + iCollectionUtility1->Collection().OpenL(*path, EMPXOpenDefault); + CleanupStack::PopAndDestroy(path); // path + return 0; + } + +TInt CCollectionTests::StartTest0044L() + { + iLogger->Log( KTextApiSetFilterL ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0045L() + { + iLogger->Log( KTextApiSetFilterL ); + CMPXFilter* filter = iCollectionUtility1->Collection().FilterL(); + CleanupStack::PushL( filter ); + TMC_ASSERT((filter != NULL), 1); + + TMPXAttribute titleAttr(KMPXMediaGeneralTitle); + TMPXAttribute idAttr(KMPXMediaGeneralId); + TMC_ASSERT(filter->IsSupported(titleAttr) && filter->IsSupported(titleAttr), 2); + + TInt filterId = *filter->Value( idAttr ); + TMC_ASSERT(filterId == 213, 3); + + const TDesC& filterTitle = filter->ValueText( titleAttr ); + TMC_ASSERT(filterTitle == _L("level211"), 4); + + CleanupStack::PopAndDestroy( filter ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0046L() + { + iLogger->Log( KTextApiSetFilterL ); + CMPXFilter* filter = CMPXFilter::NewL(); + CleanupStack::PushL( filter ); + + TMPXAttribute uriAttr(KMPXMediaGeneralUri); + // Filter out Uri="\song3311.ts" + filter->SetTextValueL(uriAttr, _L("\\song3311.ts")); + iCollectionUtility1->Collection().SetFilterL( filter ); + CleanupStack::PopAndDestroy( filter ); + RunNext(); + return 0; + } +TInt CCollectionTests::StartTest0047L() + { + iLogger->Log( KTextApiSetFilterL ); + // Open the CollectionTestPlugin container "level231" + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 13 ); + path->AppendL( 231 ); + + iCollectionUtility1->Collection().OpenL(*path, EMPXOpenDefault); + CleanupStack::PopAndDestroy(path); // path + return 0; + } + +TInt CCollectionTests::StartTest0048L() + { + iLogger->Log( KTextApiSetFilterL ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0049L() + { + iLogger->Log( KTextApiSetFilterL ); + CMPXFilter* filter = iCollectionUtility1->Collection().FilterL(); + CleanupStack::PushL( filter ); + TMC_ASSERT(filter != NULL, 1); + + TMPXAttribute uriAttr(KMPXMediaGeneralUri); + TMC_ASSERT(filter->IsSupported(uriAttr), 2); + + const TDesC& filterUri = filter->ValueText( uriAttr ); + TMC_ASSERT(filterUri == _L("\\song3311.ts"), 3); + + CleanupStack::PopAndDestroy( filter ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0050L() + { + iLogger->Log( KTextApiSetFilterL ); + iCollectionUtility1->Collection().SetFilterL( NULL ); + CMPXFilter* filter = iCollectionUtility1->Collection().FilterL(); + TMC_ASSERT(filter == NULL, 1); + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0051L() + { + iLogger->Log( KTextApiSetFilterL ); + // Open the CollectionTestPlugin container level11 through path + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 11 ); + + iCollectionUtility1->Collection().OpenL(*path, EMPXOpenDefault); + CleanupStack::PopAndDestroy( path); // path + return 0; + } + +TInt CCollectionTests::StartTest0052L() + { + iLogger->Log( KTextApiSetFilterL ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0053L() + { + iLogger->Log( KTextApiUidL ); + TUid pluginUid; + TRAPD(err, pluginUid = iCollectionUtility1->Collection().UidL() ); + TMC_ASSERT(err == KErrNone, 1); + TMC_ASSERT(pluginUid == TUid::Uid(KCollectionTestPluginImpId), 2); + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0054L() + { + iLogger->Log( KTextApiUidL ); + + // Close all the collection utility API + DELETE_COLLECTION_PTR(iCollectionUtility1); + + iCollectionUtility1 = MMPXCollectionUtility::NewL(this, KMcModeDefault); + TUid pluginUid; + TRAPD(err, pluginUid = iCollectionUtility1->Collection().UidL() ); + TMC_ASSERT(err == KErrNone, 1); + TMC_ASSERT(pluginUid == KNullUid, 1); + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0055L() + { + iLogger->Log( KTextApiPathL ); + + CMPXCollectionPath* path = iCollectionUtility1->Collection().PathL(); + CleanupStack::PushL( path ); + TMC_ASSERT(path->Levels() == 0, 1); + CleanupStack::PopAndDestroy( path ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0056L() + { + iLogger->Log( KTextApiPathL ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + return 0; + } + +TInt CCollectionTests::StartTest0057L() + { + iLogger->Log( KTextApiPathL ); + iCollectionUtility1->Collection().OpenL(KColTestPluginIndex, EMPXOpenDefault); + return 0; + } + +TInt CCollectionTests::StartTest0058L() + { + iLogger->Log( KTextApiPathL ); + iCollectionUtility1->Collection().OpenL(2, EMPXOpenDefault); + return 0; + } + +TInt CCollectionTests::StartTest0059L() + { + iLogger->Log( KTextApiBackL ); + iCollectionUtility1->Collection().BackL(); + return 0; + } + +TInt CCollectionTests::StartTest0060L() + { + iLogger->Log( KTextApiBackL ); + iCollectionUtility1->Collection().BackL(); + return 0; + } + +TInt CCollectionTests::StartTest0061L() + { + // MMPXCollectionUtility::IsRemote not implemented + iLogger->Log( KTextApiIsRemote ); + iLogger->Log( KTextNotImplemented ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0062L() + { + iLogger->Log( KTextApiCancelRequest ); + iLogger->Log( _L("Cancel Request can be called through UI \"Stop\" key") ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0063L() + { + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0064L() + { + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0065L() + { + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0066L() + { + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0067L() + { + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0068L() + { + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0069L() + { + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0070L() + { + /* + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + // Adding empty media + TMC_ASSERT(err == KErrArgument, 1); + + CleanupStack::PopAndDestroy( media ); + */ + RunNext(); // do not remove + return 0; + } + +TInt CCollectionTests::StartTest0071L() + { + /* + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + // Adding an empty item + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + TMC_ASSERT(err == KErrNotSupported, 1); + + CleanupStack::PopAndDestroy( media ); + */ + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0072L() + { + /* + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTObjectValueL(KMPXMediaGeneralCollectionId, KNullUid); + // Adding with NULL collection Id + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + TMC_ASSERT(err == KErrNotSupported, 1); + + CleanupStack::PopAndDestroy( media ); + */ + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0073L() + { + /* + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(0x12345678)); // arbitary Uid + // Adding with non-supported collection Id + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + TMC_ASSERT(err == KErrNotSupported, 1); + + CleanupStack::PopAndDestroy( media ); + */ + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0074L() + { + /* + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTextValueL(KMPXMediaGeneralUri, KNullDesC); + // Adding with NULL Uri + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + TMC_ASSERT(err == KErrArgument, 1); + + CleanupStack::PopAndDestroy( media ); + */ + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0075L() + { + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + + /* + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + // Adding with uri with non-suported extension + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTextValueL(KMPXMediaGeneralUri, _L("c:\\song.abc")); // unsupported extension + + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + + TMC_ASSERT(err == KErrArgument, 1); + + CleanupStack::PopAndDestroy( media ); + RunNext(); + */ + + //TODO: Collection framework won't check the Uri extension and select right plugin + // Therefore, this test case doesn't make any sense until above feature has been implemented + iLogger->Log( _L("TODO: feature not implemented. Test case skipped") ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0076L() + { + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + + /* + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXGroup); + // Adding an empty group item + iLogger->Log( KTextPanicExpected ); + + // TODO: panic will raised + //TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + //TMC_ASSERT(err == KErrNotSupported, 1); + TMC_ASSERT(EFalse, 1); // mark it as failing + + CleanupStack::PopAndDestroy( media ); + */ + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0077L() + { + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + CMPXMediaArray* array = CMPXMediaArray::NewL(); + CleanupStack::PushL( array ); + + // Add empty media + CMPXMedia* content = CMPXMedia::NewL(); + CleanupStack::PushL( content ); + content->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + array->AppendL( content ); + CleanupStack::Pop( content ); + + // Adding an array and set media to group + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXGroup); + media->SetCObjectValueL(KMPXMediaArrayContents, array); + media->SetTObjectValueL(KMPXMediaArrayCount, array->Count() ); + + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + TMC_ASSERT(err == KErrNotSupported, 1); + + CleanupStack::PopAndDestroy(2, media); // array, media + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0078L() + { + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + media->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0078")); + // Adding valid media + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + TMC_ASSERT(err == KErrNone, 1); + + CleanupStack::PopAndDestroy( media ); + + return 0; + } + +TInt CCollectionTests::StartTest0079L() + { + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + CMPXMediaArray* array = CMPXMediaArray::NewL(); + CleanupStack::PushL( array ); + + // Add 1st media + CMPXMedia* content = CMPXMedia::NewL(); + CleanupStack::PushL( content ); + content->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + content->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + content->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0079")); + array->AppendL( content ); + CleanupStack::Pop( content ); + // Add 2nd media + content = CMPXMedia::NewL(); + CleanupStack::PushL( content ); + content->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + content->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + content->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0079")); + array->AppendL( content ); + CleanupStack::Pop( content ); + + // Adding an array and set media to group + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXGroup); + media->SetCObjectValueL(KMPXMediaArrayContents, array); + media->SetTObjectValueL(KMPXMediaArrayCount, array->Count() ); + + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + TMC_ASSERT(err == KErrNone, 1); + + CleanupStack::PopAndDestroy(2, media); // array, media + iTempCnt = 2; // expecting 2 sets of callback + + return 0; + } + +TInt CCollectionTests::StartTest0080L() + { + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + media->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0080")); + // Adding valid media + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + TMC_ASSERT(err == KErrNone, 1); + + CleanupStack::PopAndDestroy( media ); + + return 0; + } + +TInt CCollectionTests::StartTest0081L() + { + // MMPXCollection::AddL + iLogger->Log( KTextApiAddL ); + iLogger->Log( _L("Reuse part of Test0078") ); + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTextValueL(KMPXMediaGeneralUri, _L("\\song.ts")); + media->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0078")); + // Adding valid media + TRAPD(err, iCollectionUtility1->Collection().AddL(*media) ); + TMC_ASSERT(err == KErrNone, 1); + + CleanupStack::PopAndDestroy( media ); + + return 0; + } + +TInt CCollectionTests::StartTest0082L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0083L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0084L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + + /* + CMPXCollectionPath* path = iCollectionUtility1->Collection().PathL(); + CleanupStack::PushL( path ); + //TestUtility::LogCollectionPath(*path, iLogger); + + TMC_ASSERT(path->Levels() == 1, 1); // Assume currently browing plugins main view + + CMPXCollectionPath* removePath = CMPXCollectionPath::NewL(); + CleanupStack::PushL( removePath ); + TRAPD(err, iCollectionUtility1->Collection().RemoveL(*removePath, NULL)); + CleanupStack::PopAndDestroy(2, path); // removePath, path + // No callback expected + TMC_ASSERT(err == KErrArgument, 2); + */ + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0085L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + iCollectionUtility1->Collection().OpenL( *path ); + CleanupStack::PopAndDestroy( path ); + return 0; + } + +TInt CCollectionTests::StartTest0086L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); // empty path + TRAPD(err, iCollectionUtility1->Collection().RemoveL( *path )); + CleanupStack::PopAndDestroy( path ); + TMC_ASSERT(err == KErrArgument, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0087L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); // empty path + TRAPD(err, iCollectionUtility1->Collection().RemoveL(*path, this)); + CleanupStack::PopAndDestroy( path ); + TMC_ASSERT(err == KErrArgument, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0088L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 11 ); + path->AppendL( 211 ); + path->AppendL( 3111 ); // for testing purpose, not actually deleting + iCollectionUtility1->Collection().RemoveL(*path, this); + CleanupStack::PopAndDestroy( path ); + return 0; + } + +TInt CCollectionTests::StartTest0089L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 11 ); + path->AppendL( 211 ); + path->AppendL( 3111 ); // for testing purpose, not actually deleting + iCollectionUtility1->Collection().RemoveL(*path, NULL); + CleanupStack::PopAndDestroy( path ); + RunNext(); // No callback expected + return 0; + } + +TInt CCollectionTests::StartTest0090L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 11 ); + path->AppendL( 212 ); // for testing purpose, not actually deleting + iCollectionUtility1->Collection().RemoveL(*path, this); + CleanupStack::PopAndDestroy( path ); + return 0; + } + +TInt CCollectionTests::StartTest0091L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 14 ); // for testing purpose, not actually deleting + iCollectionUtility1->Collection().RemoveL(*path, this); + CleanupStack::PopAndDestroy( path ); + return 0; + } + +TInt CCollectionTests::StartTest0092L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0093L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0094L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0095L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0096L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0097L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0098L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0099L() + { + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + media->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0099")); + // Adding valid media + TRAPD(err, iCollectionUtility1->Collection().RemoveL(*media) ); + TMC_ASSERT(err == KErrNone, 1); + + CleanupStack::PopAndDestroy( media ); + + return 0; + } + +TInt CCollectionTests::StartTest0100L() + { + /* + // MMPXCollection::RemoveL + iLogger->Log( KTextApiRemoveL ); + + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + media->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0100")); + // Adding valid media + TRAPD(err, iCollectionUtility1->Collection().RemoveL(*media) ); + TMC_ASSERT(err == KErrNone, 1); + + CleanupStack::PopAndDestroy( media ); + iTempCnt = 2; // expecting receiving 2 HandleCollectionMessages + */ + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0101L() + { + // MMPXCollection::SetSyncL + iLogger->Log( KTextApiSetSyncL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0102L() + { + // MMPXCollection::SetSyncL + iLogger->Log( KTextApiSetSyncL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0103L() + { + // MMPXCollection::SetSyncL + iLogger->Log( KTextApiSetSyncL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0104L() + { + // MMPXCollection::SetSyncL + iLogger->Log( KTextApiSetSyncL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0105L() + { + // MMPXCollection::SetSyncL + iLogger->Log( KTextApiSetSyncL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0106L() + { + // MMPXCollection::SetSyncL + iLogger->Log( KTextApiSetSyncL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0107L() + { + // MMPXCollection::SetSyncL + iLogger->Log( KTextApiSetSyncL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0108L() + { + // MMPXCollection::SetSyncL + iLogger->Log( KTextApiSetSyncL ); + + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + media->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0108")); + // Adding valid media + TRAPD(err, iCollectionUtility1->Collection().SetSyncL(*media) ); + TMC_ASSERT(err == KErrNone, 1); + + CleanupStack::PopAndDestroy( media ); + + return 0; + } + +TInt CCollectionTests::StartTest0109L() + { + // MMPXCollection::SetSyncL + iLogger->Log( KTextApiSetSyncL ); + + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + media->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0109")); + // Adding valid media + TRAPD(err, iCollectionUtility1->Collection().SetSyncL(*media) ); + TMC_ASSERT(err == KErrNone, 1); + + CleanupStack::PopAndDestroy( media ); + iTempCnt = 2; // expecting receiving 2 HandleCollectionMessages + return 0; + } + +TInt CCollectionTests::StartTest0110L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0111L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0112L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0113L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0114L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0115L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0116L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0117L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + + /* + // Reinitialize collection utility first + DELETE_COLLECTION_PTR(iCollectionUtility1); + iCollectionUtility1 = MMPXCollectionUtility::NewL(this); + iLogger->Log( KTextPanicExpected ); + // TODO: panic will raised - because of no EMcsSetMediaAsync handle + // in CMPXCollectionUtility::HandleRunErrorL + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + iCollectionUtility1->Collection().SetL( *media ); + CleanupStack::PopAndDestroy( media ); + TMC_ASSERT(EFalse, 1); // temp + */ + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0118L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + iLogger->Log( KTextPanicExpected ); + // TODO: panic will raised - because of NULL callback + // Update DoHandleCollectionTest0118L() as the problem is fixed + + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + iCollectionUtility1->Collection().OpenL( *path ); + CleanupStack::PopAndDestroy( path ); + return 0; + } +TInt CCollectionTests::StartTest0119L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + + /* + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + media->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0119")); + // Adding valid media + TRAPD(err, iCollectionUtility1->Collection().SetL(*media) ); + TMC_ASSERT(err == KErrNone, 1); + + CleanupStack::PopAndDestroy( media ); + //TODO: API deprecated + iLogger->Log( KTextApiDeprecated ); + */ + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0120L() + { + // MMPXCollection::SetL + iLogger->Log( KTextApiSetL ); + + /* + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + media->SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + media->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + media->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0120")); + // Adding valid media + TRAPD(err, iCollectionUtility1->Collection().SetL(*media) ); + TMC_ASSERT(err == KErrNone, 1); + + CleanupStack::PopAndDestroy( media ); + iTempCnt = 2; // expecting receiving 2 HandleCollectionMessages + //TODO: API deprecated + iLogger->Log( KTextApiDeprecated ); + */ + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0121L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0122L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0123L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0124L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0125L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0126L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + + // Close iCollectionUtility and re-initialize + DELETE_COLLECTION_PTR(iCollectionUtility1); + iCollectionUtility1 = MMPXCollectionUtility::NewL(this); + + // Find with empty attribute list and cristeria + RArray attrs; + CleanupClosePushL( attrs ); + CMPXSearchCriteria* criteria = CMPXSearchCriteria::NewL(); + CleanupStack::PushL( criteria ); + iCollectionUtility1->Collection().FindAllL(*criteria, attrs.Array(), *this); + + CleanupStack::PopAndDestroy(2, &attrs); // criteria, attrs + return 0; + } + +TInt CCollectionTests::StartTest0127L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + RArray attrs; + CleanupClosePushL( attrs ); + CMPXSearchCriteria* criteria = CMPXSearchCriteria::NewL(); + CleanupStack::PushL( criteria ); + criteria->SetTObjectValueL(KMPXMediaGeneralCollectionId, KNullUid); + iCollectionUtility1->Collection().FindAllL(*criteria, attrs.Array(), *this); + + CleanupStack::PopAndDestroy(2, &attrs); // criteria, attrs + return 0; + } + +TInt CCollectionTests::StartTest0128L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + RArray attrs; + CleanupClosePushL( attrs ); + CMPXSearchCriteria* criteria = CMPXSearchCriteria::NewL(); + CleanupStack::PushL( criteria ); + criteria->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0128")); + criteria->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + iCollectionUtility1->Collection().FindAllL(*criteria, attrs.Array(), *this); + + CleanupStack::PopAndDestroy(2, &attrs); // criteria, attrs + return 0; + } + +TInt CCollectionTests::StartTest0129L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + RArray attrs; + CleanupClosePushL( attrs ); + attrs.Append( KMPXMediaGeneralTitle ); + attrs.Append( KMPXMediaGeneralUri ); + attrs.Append( KMPXMediaGeneralId ); + + CMPXSearchCriteria* criteria = CMPXSearchCriteria::NewL(); + CleanupStack::PushL( criteria ); + criteria->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0129")); + criteria->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + iCollectionUtility1->Collection().FindAllL(*criteria, attrs.Array(), *this); + + CleanupStack::PopAndDestroy(2, &attrs); // criteria, attrs + return 0; + } + +TInt CCollectionTests::StartTest0130L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + RArray attrs; + CleanupClosePushL( attrs ); + CMPXSearchCriteria* criteria = CMPXSearchCriteria::NewL(); + CleanupStack::PushL( criteria ); + criteria->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0130")); + criteria->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + iCollectionUtility1->Collection().FindAllL(*criteria, attrs.Array(), *this); + + CleanupStack::PopAndDestroy(2, &attrs); // criteria, attrs + return 0; + } + +TInt CCollectionTests::StartTest0131L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Syn ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0132L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Syn ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0133L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Syn ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0134L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Syn ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0135L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Syn ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0136L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Syn ); + + // Close iCollectionUtility and re-initialize + DELETE_COLLECTION_PTR(iCollectionUtility1); + iCollectionUtility1 = MMPXCollectionUtility::NewL(this); + + // Find with empty attribute list and cristeria + RArray attrs; + CleanupClosePushL( attrs ); + CMPXSearchCriteria* criteria = CMPXSearchCriteria::NewL(); + CleanupStack::PushL( criteria ); + CMPXMedia* media = NULL; + TRAPD(err, media = iCollectionUtility1->Collection().FindAllL(*criteria, attrs.Array()) ); + DELETE_PTR( media ); + TMC_ASSERT(err == KErrNotSupported, 1); + CleanupStack::PopAndDestroy(2, &attrs); // criteria, attrs + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0137L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Syn ); + RArray attrs; + CleanupClosePushL( attrs ); + CMPXSearchCriteria* criteria = CMPXSearchCriteria::NewL(); + CleanupStack::PushL( criteria ); + criteria->SetTObjectValueL(KMPXMediaGeneralCollectionId, KNullUid); + CMPXMedia* media = NULL; + TRAPD(err, media = iCollectionUtility1->Collection().FindAllL(*criteria, attrs.Array()) ); + DELETE_PTR( media ); + TMC_ASSERT(err == KErrNotSupported, 1); + CleanupStack::PopAndDestroy(2, &attrs); // criteria, attrs + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0138L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + RArray attrs; + CleanupClosePushL( attrs ); + CMPXSearchCriteria* criteria = CMPXSearchCriteria::NewL(); + CleanupStack::PushL( criteria ); + criteria->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0138")); + criteria->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + CMPXMedia* media = NULL; + TRAPD(err, media = iCollectionUtility1->Collection().FindAllL(*criteria, attrs.Array()) ); + CleanupStack::PopAndDestroy(2, &attrs); // criteria, attrs + CleanupStack::PushL( media ); + TMC_ASSERT(err == KErrNone, 1); + TMC_ASSERT(media != NULL, 2); + + // Result comparsion + if( !media->IsSupported(KMPXMediaGeneralTitle) ) + { + TMC_ASSERT(EFalse , 3); + return 0; + } + const TDesC& title = media->ValueText( KMPXMediaGeneralTitle ); + TMC_ASSERT(title == _L("CollectionPluginTest0138"), 4 ); + + if( !media->IsSupported(KMPXMediaGeneralCollectionId) ) + { + TMC_ASSERT(EFalse , 5); + return 0; + } + TUid uid = media->ValueTObjectL( KMPXMediaGeneralCollectionId ); + TMC_ASSERT(uid == TUid::Uid(KCollectionTestPluginImpId), 6); + + if( !media->IsSupported(KMPXMediaGeneralSize) ) + { + TMC_ASSERT(EFalse , 7); + return 0; + } + TInt attrSize = media->ValueTObjectL( KMPXMediaGeneralSize ); + TMC_ASSERT(attrSize == 0, 8); + CleanupStack::PopAndDestroy( media ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0139L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + RArray attrs; + CleanupClosePushL( attrs ); + attrs.Append( KMPXMediaGeneralTitle ); + attrs.Append( KMPXMediaGeneralUri ); + attrs.Append( KMPXMediaGeneralId ); + + CMPXSearchCriteria* criteria = CMPXSearchCriteria::NewL(); + CleanupStack::PushL( criteria ); + criteria->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0139")); + criteria->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + CMPXMedia* media = NULL; + TRAPD(err, media = iCollectionUtility1->Collection().FindAllL(*criteria, attrs.Array()) ); + CleanupStack::PopAndDestroy(2, &attrs); // criteria, attrs + CleanupStack::PushL( media ); + TMC_ASSERT(err == KErrNone, 1); + TMC_ASSERT(media != NULL, 2); + + // Result comparsion + if( !media->IsSupported(KMPXMediaGeneralTitle) ) + { + TMC_ASSERT(EFalse , 3); + return 0; + } + const TDesC& title = media->ValueText( KMPXMediaGeneralTitle ); + TMC_ASSERT(title == _L("CollectionPluginTest0139"), 4 ); + + if( !media->IsSupported(KMPXMediaGeneralCollectionId) ) + { + TMC_ASSERT(EFalse , 5); + return 0; + } + TUid uid = media->ValueTObjectL( KMPXMediaGeneralCollectionId ); + TMC_ASSERT(uid == TUid::Uid(KCollectionTestPluginImpId), 6); + + if( !media->IsSupported(KMPXMediaGeneralSize) ) + { + TMC_ASSERT(EFalse , 7); + return 0; + } + TInt attrSize = media->ValueTObjectL( KMPXMediaGeneralSize ); + TMC_ASSERT(attrSize == 3, 8); + CleanupStack::PopAndDestroy( media ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0140L() + { + // MMPXCollection::FindAllL + iLogger->Log( KTextApiFindAllL_Asyn ); + RArray attrs; + CleanupClosePushL( attrs ); + CMPXSearchCriteria* criteria = CMPXSearchCriteria::NewL(); + CleanupStack::PushL( criteria ); + criteria->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0140")); + criteria->SetTObjectValueL(KMPXMediaGeneralCollectionId, TUid::Uid(KCollectionTestPluginImpId)); + CMPXMedia* media = NULL; + TRAPD(err, media = iCollectionUtility1->Collection().FindAllL(*criteria, attrs.Array()) ); + CleanupStack::PopAndDestroy(2, &attrs); // criteria, attrs + + TMC_ASSERT(err == KErrNotFound, 1); + TMC_ASSERT(media == NULL, 2); + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0141L() + { + // MMPXCollection::MediaL + iLogger->Log( KTextApiMediaL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0142L() + { + // MMPXCollection::MediaL + iLogger->Log( KTextApiMediaL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0143L() + { + // MMPXCollection::MediaL + iLogger->Log( KTextApiMediaL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0144L() + { + // MMPXCollection::MediaL + iLogger->Log( KTextApiMediaL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + RArray attrs; + CleanupClosePushL( attrs ); + TRAPD(err, iCollectionUtility1->Collection().MediaL(*path, attrs.Array()) ); + TMC_ASSERT(err == KErrArgument, 1); + CleanupStack::PopAndDestroy(2, path); // attrs, path + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0145L() + { + // MMPXCollection::MediaL + iLogger->Log( KTextApiMediaL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( NULL ); + RArray attrs; + CleanupClosePushL( attrs ); + iCollectionUtility1->Collection().MediaL(*path, attrs.Array()); + CleanupStack::PopAndDestroy(2, path); // attrs, path + return 0; + } + +TInt CCollectionTests::StartTest0146L() + { + // MMPXCollection::MediaL + iLogger->Log( KTextApiMediaL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 14 ); + RArray attrs; + CleanupClosePushL( attrs ); + iCollectionUtility1->Collection().MediaL(*path, attrs.Array()); + CleanupStack::PopAndDestroy(2, path); // attrs, path + + // Do HandleMediaTest0146L() is never called + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0147L() + { + // MMPXCollection::MediaL + iLogger->Log( KTextApiMediaL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 15 ); + RArray attrs; + CleanupClosePushL( attrs ); + iCollectionUtility1->Collection().MediaL(*path, attrs.Array()); + CleanupStack::PopAndDestroy(2, path); // attrs, path + return 0; + } + +TInt CCollectionTests::StartTest0148L() + { + // MMPXCollection::MediaL + iLogger->Log( KTextApiMediaL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 16 ); + RArray attrs; + CleanupClosePushL( attrs ); + iCollectionUtility1->Collection().MediaL(*path, attrs.Array()); + CleanupStack::PopAndDestroy(2, path); // attrs, path + return 0; + } + +TInt CCollectionTests::StartTest0149L() + { + /* + // MMPXCollection::MediaL + iLogger->Log( KTextApiMediaL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + path->AppendL( 17 ); + RArray attrs; + CleanupClosePushL( attrs ); + CMPXAttributeSpecs* spec = CMPXAttributeSpecs::NewL(); + CleanupStack::PushL( spec ); + spec->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0149")); + iCollectionUtility1->Collection().MediaL(*path, attrs.Array(), spec); + CleanupStack::PopAndDestroy(3, path); // spec, attrs, path + */ + + RunNext(); // remove later + + return 0; + } + +TInt CCollectionTests::StartTest0150L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0151L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0152L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0153L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + TRAPD(err, iCollectionUtility1->Collection().CommandL(EMcCmdRemoveAll, NULL)); + TMC_ASSERT(err == KErrNotSupported, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0154L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + TRAPD(err, iCollectionUtility1->Collection().CommandL(EMcCmdRemoveAll, 0x12345678)); + TMC_ASSERT(err == KErrNotSupported, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0155L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + iLogger->Log( _L("Issuing EMcCmdRemoveAll command") ); + + /* Requires manual check + iCollectionUtility1->Collection().CommandL(EMcCmdRemoveAll, KCollectionTestPluginImpId); + iLogger->Log( KTextManualCheck ); + TMC_ASSERT(EFalse, 1); + */ + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0156L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + iLogger->Log( _L("Issuing EMcCmdReCreateDB command") ); + + /* Requires manual check + iCollectionUtility1->Collection().CommandL(EMcCmdReCreateDB, KCollectionTestPluginImpId); + iLogger->Log( KTextManualCheck ); + TMC_ASSERT(EFalse, 1); + */ + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0157L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + iLogger->Log( _L("Issuing EMcCmdDbCorrupted command") ); + + /* Requires manual check + iCollectionUtility1->Collection().CommandL(EMcCmdDbCorrupted, KCollectionTestPluginImpId); + iLogger->Log( KTextManualCheck ); + TMC_ASSERT(EFalse, 1); + */ + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0158L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + iLogger->Log( _L("Issuing EMcCmdCollectionInit command") ); + + /* Requires manual check + iCollectionUtility1->Collection().CommandL(EMcCmdCollectionInit, KCollectionTestPluginImpId); + iLogger->Log( KTextManualCheck ); + TMC_ASSERT(EFalse, 1); + */ + + RunNext(); + return 0; + } +TInt CCollectionTests::StartTest0159L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + iLogger->Log( _L("Issuing EMcCmdCollectionResyn command") ); + + /* Requires manual check + iCollectionUtility1->Collection().CommandL(EMcCmdCollectionResyn, KCollectionTestPluginImpId); + iLogger->Log( KTextManualCheck ); + TMC_ASSERT(EFalse, 1); + */ + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0160L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + TRAPD(err, iCollectionUtility1->Collection().CommandL(EMcCmdCollectionResyn, NULL)); + TMC_ASSERT(err == KErrNotSupported, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0161L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + + // Close iCollectionUtility and re-initialize + DELETE_COLLECTION_PTR(iCollectionUtility1); + iCollectionUtility1 = MMPXCollectionUtility::NewL(this); + + // Execute command + iLogger->Log( _L("Issuing EMcCmdSelect command") ); + TRAPD(err, iCollectionUtility1->Collection().CommandL(EMcCmdSelect, 0)); + TMC_ASSERT(err == KErrNotReady, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0162L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + // Open CollectionPluginTest + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + iCollectionUtility1->Collection().OpenL( *path ); + CleanupStack::PopAndDestroy( path ); + return 0; + } + +TInt CCollectionTests::StartTest0163L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + // Current path should in main view of CollectionTestPlugin + // containing 3 entries: "level11", "level12", "level13" and now select 3rd + iCollectionUtility1->Collection().CommandL(EMcCmdSelect, 2); + return 0; + } + +TInt CCollectionTests::StartTest0164L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + // Current path should in main view of CollectionTestPlugin + // containing 3 entries: "level11", "level12", "level13" and now select -1th one + TRAPD(err, iCollectionUtility1->Collection().CommandL(EMcCmdSelect, -1)); + TMC_ASSERT(err == KErrArgument, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0165L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + // Current path should in main view of CollectionTestPlugin + // containing 3 entries: "level11", "level12", "level13" and now select 1000th one + TRAPD(err, iCollectionUtility1->Collection().CommandL(EMcCmdSelect, 1000)); + TMC_ASSERT(err == KErrArgument, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0166L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL ); + TRAPD(err, iCollectionUtility1->Collection().CommandL(EMcCmdRefresh, 0)); + TMC_ASSERT(err == KErrNotSupported, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0167L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0168L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0169L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + iLogger->Log( KTextUninstallPlugin ); + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0170L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + + // Close collection utilty + DELETE_COLLECTION_PTR(iCollectionUtility1); + iCollectionUtility1 = MMPXCollectionUtility::NewL(this); + + // Send command + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + TRAPD(err, iCollectionUtility1->Collection().CommandL( *cmd )); + CleanupStack::PopAndDestroy( cmd ); + + // Seems to be Ready + TMC_ASSERT(err == KErrNone, 1); + //TMC_ASSERT(err == KErrNotReady, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0171L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + iCollectionUtility1->Collection().CommandL( *cmd ); + CleanupStack::PopAndDestroy( cmd ); + return 0; + } + +TInt CCollectionTests::StartTest0172L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, NULL); + TRAPD(err, iCollectionUtility1->Collection().CommandL( *cmd )); + CleanupStack::PopAndDestroy( cmd ); + TMC_ASSERT(err == KErrNotSupported, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0173L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, NULL); + iCollectionUtility1->Collection().CommandL( *cmd ); + CleanupStack::PopAndDestroy( cmd ); + return 0; + } + +TInt CCollectionTests::StartTest0174L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, KCollectionTestPluginImpId); + iCollectionUtility1->Collection().CommandL( *cmd ); + CleanupStack::PopAndDestroy( cmd ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0175L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, KCollectionTestPluginImpId); + cmd->SetTObjectValueL(KMPXCommandGeneralId, 175); + cmd->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0175")); + iCollectionUtility1->Collection().CommandL( *cmd ); + CleanupStack::PopAndDestroy( cmd ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0176L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, KCollectionTestPluginImpId); + cmd->SetTObjectValueL(KMPXCommandGeneralId, 176); + cmd->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0176")); + iCollectionUtility1->Collection().CommandL( *cmd ); + CleanupStack::PopAndDestroy( cmd ); + return 0; + } + +TInt CCollectionTests::StartTest0177L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, KCollectionTestPluginImpId); + cmd->SetTObjectValueL(KMPXCommandGeneralId, 177); + cmd->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0177")); + iCollectionUtility1->Collection().CommandL( *cmd ); + CleanupStack::PopAndDestroy( cmd ); + return 0; + } + +TInt CCollectionTests::StartTest0178L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, KCollectionTestPluginImpId); + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdCollectionSelect); + cmd->SetTObjectValueL(TMPXAttribute(KMPXCommandContentIdCollection, EMPXCollectionCommandIndex), + 0); + cmd->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0178")); + TRAPD(err, iCollectionUtility1->Collection().CommandL( *cmd )); + CleanupStack::PopAndDestroy( cmd ); + TMC_ASSERT(err == KErrNotReady, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0179L() + { + iLogger->Log( KTextApiCommandL_Ext ); + // Open CollectionPluginTest + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + iCollectionUtility1->Collection().OpenL( *path ); + CleanupStack::PopAndDestroy( path ); + return 0; + } + +TInt CCollectionTests::StartTest0180L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, KCollectionTestPluginImpId); + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdCollectionSelect); + cmd->SetTObjectValueL(TMPXAttribute(KMPXCommandContentIdCollection, EMPXCollectionCommandIndex), + -1); + cmd->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0180")); + TRAPD(err, iCollectionUtility1->Collection().CommandL( *cmd )); + CleanupStack::PopAndDestroy( cmd ); + TMC_ASSERT(err == KErrArgument, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0181L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, KCollectionTestPluginImpId); + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdCollectionSelect); + cmd->SetTObjectValueL(TMPXAttribute(KMPXCommandContentIdCollection, EMPXCollectionCommandIndex), + 1000); + cmd->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0181")); + TRAPD(err, iCollectionUtility1->Collection().CommandL( *cmd )); + CleanupStack::PopAndDestroy( cmd ); + TMC_ASSERT(err == KErrArgument, 1); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0182L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, KCollectionTestPluginImpId); + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdCollectionSelect); + cmd->SetTObjectValueL(TMPXAttribute(KMPXCommandContentIdCollection, EMPXCollectionCommandIndex), + 2); + cmd->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0182")); + iCollectionUtility1->Collection().CommandL( *cmd ); + CleanupStack::PopAndDestroy( cmd ); + return 0; + } + +TInt CCollectionTests::StartTest0183L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + + /* This test must be manually checked + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, KCollectionTestPluginImpId); + cmd->SetTObjectValueL(KMPXCommandGeneralId, 183); + cmd->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0183")); + iCollectionUtility1->Collection().CommandL( *cmd ); + CleanupStack::PopAndDestroy( cmd ); + iLogger->Log( KTextManualCheck ); + TMC_ASSERT(EFalse, 1); + */ + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0184L() + { + // MMPXCollection::CommandL + iLogger->Log( KTextApiCommandL_Ext ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + cmd->SetTObjectValueL(KMPXCommandGeneralCollectionId, KCollectionTestPluginImpId); + cmd->SetTObjectValueL(KMPXCommandGeneralId, 184); + cmd->SetTextValueL(KMPXMediaGeneralTitle, _L("CollectionPluginTest0184")); + iCollectionUtility1->Collection().CommandL( *cmd ); + CleanupStack::PopAndDestroy( cmd ); + return 0; + } + +TInt CCollectionTests::StartTest0185L() + { + // MMPXCollection::GetSupportedTypesL + iLogger->Log( KTextApiGetSupportedTypesL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0186L() + { + /* + // MMPXCollection::GetSupportedTypesL + iLogger->Log( KTextApiGetSupportedTypesL ); + RPointerArray typeArr; + CleanupClosePushL( typeArr ); + TRAPD(err, iCollectionUtility1->Collection().GetSupportedTypesL( typeArr )); + TMC_ASSERT(err == KErrNone, 1); + for(TInt i = 0; i < typeArr.Count(); i++) + { + TBuf<512> log; + CMPXCollectionType* type = typeArr[i]; + TUid uid = type->Uid(); + const CDesCArray& exts = type->Extensions(); + const CDesCArray& mimes = type->Mimetypes(); + + iLogger->Log(_L("[%d] Uid=0x%x"), i, uid.iUid); + + TInt j = 0; + log.Format( _L("[%d] supports ext: "), i ); + for(j = 0; j < exts.Count(); j++) + { + TPtrC ext = exts[j]; + log.AppendFormat(_L("[%S]"), &ext); + } + iLogger->Log( log ); + + log.Format( _L("[%d] supports mime: "), i ); + for(j = 0; j < mimes.Count(); j++) + { + TPtrC mime = mimes[j]; + log.AppendFormat(_L("[%S]"), &mime); + } + iLogger->Log( log ); + } + typeArr.ResetAndDestroy(); + CleanupStack::PopAndDestroy( &typeArr ); + iLogger->Log( KTextManualCheck ); + TMC_ASSERT(EFalse, 1); + */ + + RunNext(); + + return 0; + } + + +TInt CCollectionTests::StartTest0187L() + { + // MMPXCollection::GetSupportedCapabilitiesL + iLogger->Log( KTextApiGetSupportedCapabilitiesL ); + iLogger->Log( KTextUninstallPlugin ); + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0188L() + { + /* + // MMPXCollection::GetSupportedCapabilitiesL + iLogger->Log( KTextApiGetSupportedCapabilitiesL ); + TCollectionCapability capability; + iCollectionUtility1->Collection().GetSupportedCapabilitiesL( capability ); + TMC_ASSERT(capability == EMcNotModifiable, 1); + */ + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0189L() + { + // MMPXCollection::GetSupportedCapabilitiesL + iLogger->Log( KTextApiGetSupportedCapabilitiesL ); + + DELETE_COLLECTION_PTR(iCollectionUtility1); + iCollectionUtility1 = MMPXCollectionUtility::NewL(this); + + // Get current context capability + TCollectionCapability capability; + iCollectionUtility1->Collection().GetSupportedCapabilitiesL( capability ); + TMC_ASSERT(capability == 0, 1); + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0190L() + { + // MMPXCollection::CollectionIDL + iLogger->Log( KTextApiCollectionIDL_Col ); + TUid absUid = KLocalCollection; + TUid uid = iCollectionUtility1->Collection().CollectionIDL( absUid ); + DELETE_COLLECTION_PTR(iCollectionUtility1); + TMC_ASSERT(uid == TUid::Uid(0x101FFC3A), 1); + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0191L() + { + // MMPXCollection::CollectionIDL + iLogger->Log( KTextApiCollectionIDL ); + TUid absUid = KPodcastCollection; + TUid uid = iCollectionUtility1->Collection().CollectionIDL( absUid ); + TMC_ASSERT(uid == TUid::Uid(0x101FFC3C), 1); + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0192L() + { + // MMPXCollection::CollectionIDL + iLogger->Log( KTextApiCollectionIDL ); + TUid absUid = KInMemoryCollection; + TUid uid = iCollectionUtility1->Collection().CollectionIDL( absUid ); + TMC_ASSERT(uid == TUid::Uid(0x101FFCD8), 1); + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0193L() + { + // MMPXCollection::CollectionIDL + iLogger->Log( KTextApiCollectionIDL ); + TUid absUid = TUid::Uid(0x12345678); // invalid Uid + TUid uid; + TRAPD(err, uid = iCollectionUtility1->Collection().CollectionIDL( absUid )); + TMC_ASSERT(err == KErrNone, 1); + TMC_ASSERT(uid == KNullUid, 2); + + RunNext(); + return 0; + } + +TInt CCollectionTests::StartTest0194L() + { + // MMPXCollection::NotifyL + iLogger->Log( KTextApiNotifyL ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL( path ); + path->AppendL( KCollectionTestPluginImpId ); + iCollectionUtility1->Collection().OpenL( *path ); + CleanupStack::PopAndDestroy( path ); + return 0; + } + +TInt CCollectionTests::StartTest0195L() + { + // MMPXCollection::NotifyL + iLogger->Log( KTextApiNotifyL ); + iCollectionUtility1->Collection().NotifyL(EMcMsgFormatStart, EDriveE); + return 0; + } + +TInt CCollectionTests::StartTest0196L() + { + // MMPXCollection::NotifyL + iLogger->Log( KTextApiNotifyL ); + iCollectionUtility1->Collection().NotifyL(EMcMsgFormatEnd, EDriveE); + return 0; + } + +TInt CCollectionTests::StartTest0197L() + { + // MMPXCollection::NotifyL + iLogger->Log( KTextApiNotifyL ); + iCollectionUtility1->Collection().NotifyL(EMcMsgDiskRemoved, EDriveE); + return 0; + } + +TInt CCollectionTests::StartTest0198L() + { + // MMPXCollection::NotifyL + iLogger->Log( KTextApiNotifyL ); + iCollectionUtility1->Collection().NotifyL(EMcMsgDiskInserted, EDriveE); + return 0; + } + +TInt CCollectionTests::StartTest0199L() + { + // MMPXCollection::NotifyL + iLogger->Log( KTextApiNotifyL ); + iCollectionUtility1->Collection().NotifyL(EMcMsgUSBMassStorageStart, EDriveE); + return 0; + } + +TInt CCollectionTests::StartTest0200L() + { + // MMPXCollection::NotifyL + iLogger->Log( KTextApiNotifyL ); + iCollectionUtility1->Collection().NotifyL(EMcMsgUSBMassStorageEnd, EDriveE); + return 0; + } + +TInt CCollectionTests::StartTest0201L() + { + // MMPXCollection::NotifyL + iLogger->Log( KTextApiNotifyL ); + iCollectionUtility1->Collection().NotifyL(EMcMsgRefreshStart, EDriveE); + return 0; + } + +TInt CCollectionTests::StartTest0202L() + { + // MMPXCollection::NotifyL + iLogger->Log( KTextApiNotifyL ); + iCollectionUtility1->Collection().NotifyL(EMcMsgRefreshEnd, EDriveE); + return 0; + } + +void CCollectionTests::DoHandleCollectionTest0001L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) + { + iCollectionUtility1->Collection().OpenL(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0011L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) + { + iLogger->Log( KTextPathChangedByOpen ); + // To protect that 2 messages will be received from iCollectionUtility1 and iCollectionUtility2 + if(iTempCnt++ == 0) + { + TMPXOpenMode openMode = EMPXOpenDefault; + switch( iTestIndex ) + { + case 11: + openMode = EMPXOpenDefault; break; + case 13: + openMode = EMPXOpenGroupOrPlaylist; break; + case 15: + openMode = EMPXOpenAllItems; break; + case 17: + openMode = EMPXOpenNoPlaylist; break; + case 19: + case 20: + openMode = EMPXOpenPlaylistOnly; break; + default: + break; + }; + iCollectionUtility2->Collection().OpenL( openMode ); + } + } + else if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged) + { + iLogger->Log( KTextCollectionChange ); + // If open at root level, only EMPXOpenDefault and EMPXOpenGroupOrPlaylist are supported + // otherwise, framework assume openmode has changed and reopen at root level + // For ETCFwCollectTest0015(0016), 0017(0018), and 0019(0020), we have to handle callback here + // However, TMPXOpenMode will be changed to support EMPXOpenDefault only later on + iLogger->Log( KTextPluginImpUid, aMessage.Data()); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0012L(const CMPXMedia& aEntries, TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + TMPXAttribute uidAttr(KMPXMediaIdGeneral,EMPXMediaGeneralId); + RArray impUids; + CleanupClosePushL( impUids ); + impUids.Append( KMusicCollectionUID ); + impUids.Append( KPodcastCollectionUID ); + impUids.Append( KCollectionTestPluginImpId ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, impUids, + uidAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &impUids ); + + TMC_ASSERT(match, 2); + + // Each of tests 2-19 is closes and reopens so no need to Cancel. + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0021L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + if(iTestIndex == 20) + { + DELETE_COLLECTION_PTR(iCollectionUtility2); + } + else + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + TMPXAttribute uidAttr(KMPXMediaIdGeneral,EMPXMediaGeneralId); + RArray impUids; + CleanupClosePushL( impUids ); + impUids.Append( KMusicCollectionUID ); + impUids.Append( KPodcastCollectionUID ); + impUids.Append( KCollectionTestPluginImpId ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, impUids, + uidAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &impUids ); + + TMC_ASSERT(match, 2); + } + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0022L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged) // 1st + { + iLogger->Log( KTextCollectionChange ); + iLogger->Log( KTextPluginImpUid, aMessage.Data()); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0023L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + itemIds.Append( 11 ); + itemIds.Append( 12 ); + itemIds.Append( 13 ); + itemIds.Append( 990 ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 2); + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0029L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) + { + iLogger->Log( KTextPathChangedByOpen ); + iCollectionUtility1->Collection().OpenL(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0029L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 2); + + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + itemIds.Append( 211 ); + itemIds.Append( 212 ); + itemIds.Append( 213 ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 3); + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0030L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0031L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + itemIds.Append( 11 ); + itemIds.Append( 12 ); + itemIds.Append( 13 ); + itemIds.Append( 990 ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 2); + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0032L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0033L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + // Match Id + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + itemIds.Append( 221 ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 2); + + // Match Uri + CDesCArrayFlat* textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute uriAttr(KMPXMediaGeneralUri); + textArray->AppendL( KNullDesC ); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, uriAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match, 3); + + // Match Title - should not contain this attribute + textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute titleAttr(KMPXMediaGeneralTitle); + textArray->AppendL( _L("level221") ); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, titleAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match == EFalse, 4); + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0034L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0035L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + // Match Id + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + itemIds.Append( 231 ); + itemIds.Append( 232 ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 2); + + // Match Uri + CDesCArrayFlat* textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute uriAttr(KMPXMediaGeneralUri); + textArray->AppendL( KNullDesC ); + textArray->AppendL( KNullDesC ); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, uriAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match, 3); + + // Match Title - should not contain this attribute + textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute titleAttr(KMPXMediaGeneralTitle); + textArray->AppendL( _L("level231") ); + textArray->AppendL( _L("level232") ); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, titleAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match == EFalse, 4); + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0036L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged) // 1st + { + iLogger->Log( KTextCollectionChange ); + iLogger->Log( KTextPluginImpUid, aMessage.Data()); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + // iCollectionUtility1->Collection().OpenL(); // TODO: may update later + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0036L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + // TODO: Update may require + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 2); + + // Match Id + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + itemIds.Append( 231 ); + itemIds.Append( 232 ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 3); + + // Match Uri + CDesCArrayFlat* textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute uriAttr(KMPXMediaGeneralUri); + textArray->AppendL( KNullDesC ); + textArray->AppendL( KNullDesC ); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, uriAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match, 4); + + // Match Title + textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute titleAttr(KMPXMediaGeneralTitle); + textArray->AppendL( _L("level231") ); + textArray->AppendL( _L("level232") ); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, titleAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match, 5); + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0037L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0038L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + // Match Id + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + itemIds.Append( KPodcastCollectionUID ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 2); + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0039L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) + { + iLogger->Log( KTextPathChangedByOpen ); + iCollectionUtility1->Collection().OpenL( EMPXOpenDefault ); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } +void CCollectionTests::DoHandleCollectionTest0039L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 2); + + // Match Id + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 3); + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0040L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0041L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + // Match Id + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + itemIds.Append( KCollectionTestPluginImpId ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 2); + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0043L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged) // 1st + { + iLogger->Log( KTextCollectionChange ); + iLogger->Log( KTextPluginImpUid, aMessage.Data()); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0044L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + // Match Id + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + itemIds.Append( 212 ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 2); + + // Match Uri + CDesCArrayFlat* textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute uriAttr(KMPXMediaGeneralUri); + textArray->AppendL( KNullDesC ); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, uriAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match, 3); + + // Match Title + textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute titleAttr(KMPXMediaGeneralTitle); + textArray->AppendL( _L("level212") ); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, titleAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match, 4); + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0047L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0048L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + // Match Id + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 2); + + // Match Uri + CDesCArrayFlat* textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute uriAttr(KMPXMediaGeneralUri); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, uriAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match, 3); + + // Match Title + textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute titleAttr(KMPXMediaGeneralTitle); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, titleAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match, 4); + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0051L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0052L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + // Match Id + RArray itemIds; + CleanupClosePushL( itemIds ); + TMPXAttribute itemAttr(KMPXMediaGeneralId); + itemIds.Append( 211 ); + itemIds.Append( 212 ); + itemIds.Append( 213 ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, itemIds, + itemAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &itemIds ); + TMC_ASSERT(match, 2); + + // Match Uri + CDesCArrayFlat* textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute uriAttr(KMPXMediaGeneralUri); + textArray->AppendL( KNullDesC ); + textArray->AppendL( KNullDesC ); + textArray->AppendL( KNullDesC ); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, uriAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match, 3); + + // Match Title + textArray = new (ELeave) CDesCArrayFlat( 2 ); + CleanupStack::PushL( textArray ); + TMPXAttribute titleAttr(KMPXMediaGeneralTitle); + textArray->AppendL( _L("level211") ); + textArray->AppendL( _L("level212") ); + textArray->AppendL( _L("level213") ); + match = TestUtility::MatchMediaArrayTextObject(aEntries, *textArray, titleAttr); + CleanupStack::PopAndDestroy( textArray ); + TMC_ASSERT(match, 4); + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0056L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + + CMPXCollectionPath* path = iCollectionUtility1->Collection().PathL(); + CleanupStack::PushL( path ); + + TMC_ASSERT(path->Levels() == 1, 1); + TMC_ASSERT(path->Count() == KRootLvPluginNum, 2); + TMC_ASSERT(path->Index(0) == 0, 3); + TMC_ASSERT(path->Id(0).iId1 == (TInt)KMusicCollectionUID, 4); + path->SetToFirst(); + TMC_ASSERT(path->Id().iId1 == (TInt)KMusicCollectionUID, 5); + ++(*path); + TMC_ASSERT(path->Id().iId1 == (TInt)KPodcastCollectionUID, 6); + ++(*path); + TMC_ASSERT(path->Id().iId1 == (TInt)KCollectionTestPluginImpId, 7); + + CleanupStack::PopAndDestroy( path ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0057L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged) // 1st + { + iLogger->Log( KTextCollectionChange ); + iLogger->Log( KTextPluginImpUid, aMessage.Data()); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + CMPXCollectionPath* path = iCollectionUtility1->Collection().PathL(); + CleanupStack::PushL( path ); + + TMC_ASSERT(path->Levels() == 2, 1); + TMC_ASSERT(path->Count() == 4, 2); + TMC_ASSERT(path->Index(0) == KColTestPluginIndex, 3); + TMC_ASSERT(path->Id(0) == (TInt)KCollectionTestPluginImpId, 4); + TMC_ASSERT(path->Index(1) == 0, 5); + TMC_ASSERT(path->Id(1) == 11, 6); + path->SetToFirst(); + TMC_ASSERT(path->Id() == 11, 7); + ++(*path); + TMC_ASSERT(path->Id() == 12, 8); + ++(*path); + TMC_ASSERT(path->Id() == 13, 9); + ++(*path); + TMC_ASSERT(path->Id() == 990, 9); + + CleanupStack::PopAndDestroy( path ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0058L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + CMPXCollectionPath* path = iCollectionUtility1->Collection().PathL(); + CleanupStack::PushL( path ); + + TMC_ASSERT(path->Levels() == 3, 1); + TMC_ASSERT(path->Count() == 2, 2); + TMC_ASSERT(path->Index(0) == KColTestPluginIndex, 3); + TMC_ASSERT(path->Id(0) == (TInt)KCollectionTestPluginImpId, 4); + TMC_ASSERT(path->Index(1) == 2, 5); + TMC_ASSERT(path->Id(1) == 13, 6); + TMC_ASSERT(path->Index(2) == 0, 7); + TMC_ASSERT(path->Id(2) == 231, 8); + path->SetToFirst(); + TMC_ASSERT(path->Id() == 231, 9); + ++(*path); + TMC_ASSERT(path->Id() == 232, 10); + + CleanupStack::PopAndDestroy( path ); + + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0059L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + iCollectionUtility1->Collection().OpenL(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0059L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + TMPXAttribute idAttr(KMPXMediaIdGeneral,EMPXMediaGeneralId); + RArray ids; + CleanupClosePushL( ids ); + ids.Append( 11 ); + ids.Append( 12 ); + ids.Append( 13 ); + ids.Append( 990 ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, ids, + idAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &ids ); + + TMC_ASSERT(match, 2); + TMC_ASSERT(aIndex == 2, 3); + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0060L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged) // 1st + { + iLogger->Log( KTextCollectionChange ); + iLogger->Log( KTextPluginImpUid, aMessage.Data()); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + iCollectionUtility1->Collection().OpenL(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0060L(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + (void)aComplete; + (void)aIndex; + TMC_ASSERT(aError == KErrNone, 1); + + TMPXAttribute uidAttr(KMPXMediaIdGeneral,EMPXMediaGeneralId); + RArray impUids; + CleanupClosePushL( impUids ); + impUids.Append( KMusicCollectionUID ); + impUids.Append( KPodcastCollectionUID ); + impUids.Append( KCollectionTestPluginImpId ); + TBool match = TestUtility::MatchMediaArrayObject(aEntries, impUids, + uidAttr, CCollectionTests::CompareByTMPXItemId); + CleanupStack::PopAndDestroy( &impUids ); + + TMC_ASSERT(match, 2); + TMC_ASSERT(aIndex == KColTestPluginIndex, 3); + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0078L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EItemChanged && + aMessage.Type() == EMcItemInserted && + aMessage.Data() == 78) // 1st + { + iLogger->Log( _L("Insertion of item Id 78 received") ); + + RunNext(); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && + aMessage.Type() == EMcPathChangedByCollectionChange) // 2nd + { + iLogger->Log( _L("PathChangeByCollectionChange received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleCollectionTest0079L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EItemChanged && + aMessage.Type() == EMcItemInserted && + aMessage.Data() == 79) // 1st + { + iLogger->Log( _L("Insertion of item Id 79 received") ); +/* + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && + aMessage.Type() == EMcPathChangedByCollectionChange) // 2nd + { + iLogger->Log( _L("PathChangeByCollectionChange received") ); +*/ + if(--iTempCnt <= 0) + { + // 2 sets of callbacks received + RunNext(); + } + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleCollectionTest0080L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EItemChanged && + aMessage.Type() == EMcItemInserted && //EMcPlaylistInserted && + aMessage.Data() == 80) // 1st + { + iLogger->Log( _L("Insertion of playlist Id 80 received") ); + + RunNext(); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && + aMessage.Type() == EMcPathChangedByCollectionChange) // 2nd + { + iLogger->Log( _L("PathChangeByCollectionChange received") ); + + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleCollectionTest0084L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsRemovePath && + aMessage.Data() == KErrNotReady) + { + iLogger->Log( _L("RemoveL error message recieved: KErrNotReady") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleCollectionTest0085L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged) // 1st + { + iLogger->Log( KTextCollectionChange ); + iLogger->Log( KTextPluginImpUid, aMessage.Data()); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && + aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0086L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsRemovePath && + aMessage.Data() == KErrArgument) + { + iLogger->Log( _L("RemoveL error message recieved: KErrArgument") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleRemoveLTest0088L(MDesCArray& aUriArray, TInt aError) + { + TMC_ASSERT(aError == KErrNone, 1); + TMC_ASSERT(aUriArray.MdcaCount() == 1, 2); + TMC_ASSERT(aUriArray.MdcaPoint(0) == _L("\\song3111.ts"), 3); + RunNext(); + } + +void CCollectionTests::DoHandleRemoveLTest0089L(MDesCArray& /*aUriArray*/, TInt /*aError*/) + { + // Should never receive this callback + TMC_ASSERT(EFalse, 1); + RunNext(); + } + +void CCollectionTests::DoHandleRemoveLTest0090L(MDesCArray& aUriArray, TInt aError) + { + TMC_ASSERT(aError == KErrNone, 1); + TMC_ASSERT(aUriArray.MdcaCount() == 3, 2); + TMC_ASSERT(aUriArray.MdcaPoint(0) == _L("\\song3121.ts"), 3); + TMC_ASSERT(aUriArray.MdcaPoint(1) == _L("\\song3122.ts"), 4); + TMC_ASSERT(aUriArray.MdcaPoint(2) == _L("\\song3123.tp"), 5); + RunNext(); + } + +void CCollectionTests::DoHandleRemoveLTest0091L(MDesCArray& /*aUriArray*/, TInt aError) + { + TMC_ASSERT(aError == KErrNotFound, 1); + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0091L( const TMPXCollectionMessage& aMessage ) + { + // TODO: return error through HandleRemoveL/HandleCollectionMessage + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsRemovePath && + aMessage.Data() == KErrNotFound) + { + iLogger->Log( _L("RemoveL error message recieved: KErrNotFound") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleCollectionTest0099L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EItemChanged && + aMessage.Type() == EMPXItemDeleted && + aMessage.Data() == 99) // 1st + { + iLogger->Log( _L("Delete of item Id 99 received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleCollectionTest0100L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EItemChanged && + aMessage.Type() == EMPXItemDeleted && + aMessage.Data() == 100) // 1st + { + iLogger->Log( _L("[%d] Delete of item Id 99 received"), iTempCnt); + if(--iTempCnt <= 0) + { + RunNext(); + } + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleCollectionTest0108L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EItemChanged && + aMessage.Type() == EMPXItemModified && + aMessage.Data() == 108) // 1st + { + iLogger->Log( _L("Modification of item Id 108 received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleCollectionTest0109L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EItemChanged && + aMessage.Type() == EMPXItemModified && + aMessage.Data() == 109) // 1st + { + iLogger->Log( _L("[%d] Modification of item Id 109 received"), iTempCnt); + if(--iTempCnt <= 0) + { + RunNext(); + } + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } +void CCollectionTests::DoHandleCollectionTest0117L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EAsyncOpComplete && + aMessage.Type() == EMcsSetMediaAsync && + aMessage.Data() == KErrNotReady) // 1st + { + iLogger->Log( _L("EAsyncOpComplete[EMcsSetMediaAsync] message: KErrNotReady received") ); + } + else if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsSetMediaAsync && + aMessage.Data() == KErrNotReady) // 2nd + { + iLogger->Log( _L("EError[EMcsSetMediaAsync] message: KErrNotReady received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleCollectionTest0118L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged) // 1st + { + iLogger->Log( KTextCollectionChange ); + iLogger->Log( KTextPluginImpUid, aMessage.Data()); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && + aMessage.Type() == EMcPathChangedByOpen) // 2nd + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); // temp + + /* + // TODO: continue running will panic the thread + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + iCollectionUtility1->Collection().SetL( *media ); + CleanupStack::PopAndDestroy( media ); + */ + } + else if(aMessage.Event() == TMPXCollectionMessage::EAsyncOpComplete && + aMessage.Type() == EMcsSetMediaAsync && + aMessage.Data() == KErrArgument) // 3st + { + iLogger->Log( _L("EAsyncOpComplete[EMcsSetMediaAsync] message: KErrNotReady received") ); + } + else if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsSetMediaAsync && + aMessage.Data() == KErrArgument) // 4nd + { + iLogger->Log( _L("EError[EMcsSetMediaAsync] message: KErrNotReady received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0119L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EItemChanged && + aMessage.Type() == EMPXItemModified && + aMessage.Data() == 119) // 1st + { + iLogger->Log( _L("Modification of item Id 119 received") ); + } + else if(aMessage.Event() == TMPXCollectionMessage::EAsyncOpComplete && + aMessage.Type() == EMcsSetMediaAsync && + aMessage.Data() == KErrNone) // 2nd + { + iLogger->Log( _L("EAsyncOpComplete[EMcsSetMediaAsync] message: KErrNone received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleCollectionTest0120L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EItemChanged && + aMessage.Type() == EMPXItemModified && + aMessage.Data() == 120) // 1st + { + iLogger->Log( _L("Modification of item Id 120 received") ); + TMC_ASSERT(iTempCnt > 0, 3); + iTempCnt--; + if(iTempCnt == 0) // temp fix + { + TMC_ASSERT(EFalse, 4); // remove this when fixed + //RunNext(); // temp fix + } + } + else if(aMessage.Event() == TMPXCollectionMessage::EAsyncOpComplete && + aMessage.Type() == EMcsSetMediaAsync && + aMessage.Data() == KErrNone) // 2nd + { + iLogger->Log( _L("EAsyncOpComplete[EMcsSetMediaAsync] message: KErrNone received") ); + iLogger->Log( _L("THIS MESSAGE IS EXPECTED TO BE RECEIVED LAST") ); // temp + //RunNext(); // temp + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + } + +void CCollectionTests::DoHandleFindAllTest0126L(const CMPXMedia& /*aResults*/, TBool aComplete,TInt aError) + { + TMC_ASSERT(aComplete == 1, 1); + TMC_ASSERT(aError == KErrNotSupported, 2); + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0126L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsFindAll && + aMessage.Data() == KErrNotSupported) + { + iLogger->Log( _L("EError[EMcsFindAll] message: KErrNotSupported received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 3); + } + } + +void CCollectionTests::DoHandleFindAllTest0127L(const CMPXMedia& /*aResults*/, TBool aComplete,TInt aError) + { + TMC_ASSERT(aComplete == 1, 1); + TMC_ASSERT(aError == KErrNotSupported, 2); + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0127L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsFindAll && + aMessage.Data() == KErrNotSupported) + { + iLogger->Log( _L("EError[EMcsFindAll] message: KErrNotSupported received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 3); + } + } + +void CCollectionTests::DoHandleFindAllTest0128L(const CMPXMedia& aResults, TBool aComplete,TInt aError) + { + TMC_ASSERT( aComplete, 1 ); + TMC_ASSERT( aError == KErrNone, 2 ); + if( !aResults.IsSupported(KMPXMediaGeneralTitle) ) + { + TMC_ASSERT(EFalse , 3); + return; + } + const TDesC& title = aResults.ValueText( KMPXMediaGeneralTitle ); + TMC_ASSERT(title == _L("CollectionPluginTest0128"), 4 ); + + if( !aResults.IsSupported(KMPXMediaGeneralCollectionId) ) + { + TMC_ASSERT(EFalse , 5); + return; + } + TUid uid = aResults.ValueTObjectL( KMPXMediaGeneralCollectionId ); + TMC_ASSERT(uid == TUid::Uid(KCollectionTestPluginImpId), 6); + + if( !aResults.IsSupported(KMPXMediaGeneralSize) ) + { + TMC_ASSERT(EFalse , 7); + return; + } + TInt attrSize = aResults.ValueTObjectL( KMPXMediaGeneralSize ); + TMC_ASSERT(attrSize == 0, 8); + RunNext(); + } + +void CCollectionTests::DoHandleFindAllTest0129L(const CMPXMedia& aResults, TBool aComplete,TInt aError) + { + TMC_ASSERT( aComplete, 1 ); + TMC_ASSERT( aError == KErrNone, 2 ); + if( !aResults.IsSupported(KMPXMediaGeneralTitle) ) + { + TMC_ASSERT(EFalse , 3); + return; + } + const TDesC& title = aResults.ValueText( KMPXMediaGeneralTitle ); + TMC_ASSERT(title == _L("CollectionPluginTest0129"), 4 ); + + if( !aResults.IsSupported(KMPXMediaGeneralCollectionId) ) + { + TMC_ASSERT(EFalse , 5); + return; + } + TUid uid = aResults.ValueTObjectL( KMPXMediaGeneralCollectionId ); + TMC_ASSERT(uid == TUid::Uid(KCollectionTestPluginImpId), 6); + + if( !aResults.IsSupported(KMPXMediaGeneralSize) ) + { + TMC_ASSERT(EFalse , 7); + return; + } + TInt attrSize = aResults.ValueTObjectL( KMPXMediaGeneralSize ); + TMC_ASSERT(attrSize == 3, 8); + RunNext(); + } + +void CCollectionTests::DoHandleFindAllTest0130L(const CMPXMedia& aResults, TBool aComplete,TInt aError) + { + TMC_ASSERT( aComplete, 1 ); + TMC_ASSERT( aError == KErrArgument, 2 ); + TMC_ASSERT( &aResults != NULL, 3); + RunNext(); + } + + void CCollectionTests::DoHandleCollectionTest0130L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsFindAll && + aMessage.Data() == KErrArgument) + { + iLogger->Log( _L("EError[EMcsFindAll] message: KErrArgument received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 4); + } + } + +void CCollectionTests::DoHandleCollectionTest0145L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsMediaByPath && + aMessage.Data() == KErrNotSupported) + { + iLogger->Log( _L("EError[EMcsMediaByPath] message: KErrNotSupported received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 2); + } + + } + +void CCollectionTests::DoHandleMediaTest0145L(const CMPXMedia& aMedia, TInt aError) + { + TMC_ASSERT(aError == KErrNotSupported, 2); + TMC_ASSERT(&aMedia != NULL, 3); + RunNext(); + } + +void CCollectionTests::DoHandleMediaTest0146L(const CMPXMedia& aMedia, TInt aError) + { + TMC_ASSERT(aError == KErrNone, 2); + TMC_ASSERT(&aMedia == NULL, 3); + RunNext(); + } + +void CCollectionTests::DoHandleMediaTest0147L(const CMPXMedia& aMedia, TInt aError) + { + TMC_ASSERT(aError == KErrNone, 2); + TMC_ASSERT(aMedia.Count() == 0, 3); + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0148L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsMediaByPath && + aMessage.Data() == KErrNotFound) + { + iLogger->Log( _L("EError[EMcsFindAll] message: KErrNotFound received") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 4); + } + } + +void CCollectionTests::DoHandleMediaTest0148L(const CMPXMedia& aMedia, TInt aError) + { + //TMC_ASSERT(aError == KErrNotFound, 2); + TMC_ASSERT(aError == KErrNone, 2); // it is found! + TMC_ASSERT(&aMedia != NULL, 3); + RunNext(); + } + +void CCollectionTests::DoHandleMediaTest0149L(const CMPXMedia& aMedia, TInt aError) + { + TMC_ASSERT(aError == KErrNone, 2); + TMC_ASSERT(aMedia.Count() == 1, 3); + TMC_ASSERT(aMedia.IsSupported(KMPXMediaGeneralTitle), 4); + if( aMedia.IsSupported(KMPXMediaGeneralTitle) ) + { + const TDesC& title = aMedia.ValueText( KMPXMediaGeneralTitle ); + TMC_ASSERT(title == _L("CollectionPluginTest0149"), 5); + } + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0162L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged && + aMessage.Data() == KCollectionTestPluginImpId) + { + iLogger->Log( KTextCollectionChange ); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && + aMessage.Type() == EMcPathChangedByOpen) + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0163L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EFocusChanged && + aMessage.Type() == 2 ) // TODO: should be aMessage.Data() == 2??? + { + iLogger->Log( KTextFocusChanged ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0171L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsCommandExt && + aMessage.Data() == KErrNotReady) + { + iLogger->Log( _L("CommandL error message recieved: KErrNotReady") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCommandCompleteTest0171L(CMPXCommand* aCommandResult, TInt aError) + { + TMC_ASSERT(aCommandResult != NULL, 1); + TMC_ASSERT(aError == KErrNotReady, 2); + RunNext(); + } + +void CCollectionTests::DoHandleCommandCompleteTest0173L(CMPXCommand* aCommandResult, TInt aError) + { + TMC_ASSERT(aCommandResult != NULL, 1); + TMC_ASSERT(aError == KErrNotSupported, 2); + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0173L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsCommandExt && + aMessage.Data() == KErrNotSupported) + { + iLogger->Log( _L("CommandL error message recieved: KErrNotSupported") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCommandCompleteTest0176L(CMPXCommand* aCommandResult, TInt aError) + { + TMC_ASSERT(aCommandResult == NULL, 1); + TMC_ASSERT(aError == KErrNone, 2); + RunNext(); + } + +void CCollectionTests::DoHandleCommandCompleteTest0177L(CMPXCommand* aCommandResult, TInt aError) + { + TMC_ASSERT(aCommandResult != NULL, 1); + TMC_ASSERT(aError == KErrGeneral, 2); + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0177L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EError && + aMessage.Type() == EMcsCommandExt && + aMessage.Data() == KErrGeneral) + { + iLogger->Log( _L("CommandL error message recieved: KErrGeneral") ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0179L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged && + aMessage.Data() == KCollectionTestPluginImpId) + { + iLogger->Log( KTextCollectionChange ); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && + aMessage.Type() == EMcPathChangedByOpen) + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0182L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EFocusChanged && + aMessage.Type() == 2 ) // TODO: should be aMessage.Data() == 2??? + { + iLogger->Log( KTextFocusChanged ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCommandCompleteTest0184L(CMPXCommand* aCommandResult, TInt aError) + { + TMC_ASSERT(aError == KErrNone, 1); + if( !aCommandResult ) + { + TMC_ASSERT(EFalse, 2); + } + else + { + TMC_ASSERT(aCommandResult->Count() == 3, 3); + TMC_ASSERT(aCommandResult->ValueTObjectL(KMPXCommandGeneralId) == 184, 4); + } + + RunNext(); + } + +void CCollectionTests::DoHandleCollectionTest0194L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::ECollectionChanged && + aMessage.Data() == KCollectionTestPluginImpId) + { + iLogger->Log( KTextCollectionChange ); + } + else if(aMessage.Event() == TMPXCollectionMessage::EPathChanged && + aMessage.Type() == EMcPathChangedByOpen) + { + iLogger->Log( KTextPathChangedByOpen ); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0195L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EBroadcastEvent && + aMessage.Type() == EMcMsgFormatStart && + aMessage.Data() == EDriveE ) + { + iLogger->Log( _L("Broadcast Event message recieved: EMcMsgFormatStart; drive=EDriveE")); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0196L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EBroadcastEvent && + aMessage.Type() == EMcMsgFormatEnd && + aMessage.Data() == EDriveE ) + { + iLogger->Log( _L("Broadcast Event message recieved: EMcMsgFormatEnd; drive=EDriveE")); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0197L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EBroadcastEvent && + aMessage.Type() == EMcMsgDiskRemoved && + aMessage.Data() == EDriveE ) + { + iLogger->Log( _L("Broadcast Event message recieved: EMcMsgDiskRemoved; drive=EDriveE")); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } +void CCollectionTests::DoHandleCollectionTest0198L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EBroadcastEvent && + aMessage.Type() == EMcMsgDiskInserted && + aMessage.Data() == EDriveE ) + { + iLogger->Log( _L("Broadcast Event message recieved: EMcMsgDiskInserted; drive=EDriveE")); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0199L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EBroadcastEvent && + aMessage.Type() == EMcMsgUSBMassStorageStart && + aMessage.Data() == EDriveE ) + { + iLogger->Log( _L("Broadcast Event message recieved: EMcMsgUSBMassStorageStart; drive=EDriveE")); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } +void CCollectionTests::DoHandleCollectionTest0200L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EBroadcastEvent && + aMessage.Type() == EMcMsgUSBMassStorageEnd && + aMessage.Data() == EDriveE ) + { + iLogger->Log( _L("Broadcast Event message recieved: EMcMsgUSBMassStorageEnd; drive=EDriveE")); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0201L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EBroadcastEvent && + aMessage.Type() == EMcMsgRefreshStart && + aMessage.Data() == EDriveE ) + { + iLogger->Log( _L("Broadcast Event message recieved: EMcMsgRefreshStart; drive=EDriveE")); + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +void CCollectionTests::DoHandleCollectionTest0202L( const TMPXCollectionMessage& aMessage ) + { + if(aMessage.Event() == TMPXCollectionMessage::EBroadcastEvent && + aMessage.Type() == EMcMsgRefreshEnd && + aMessage.Data() == EDriveE ) + { + iLogger->Log( _L("Broadcast Event message recieved: EMcMsgRefreshEnd; drive=EDriveE")); + + RunNext(); + } + else + { + iLogger->Log( KTextImproperMsg ); + TMC_ASSERT(EFalse, 1); + } + } + +// --------------------------------------------------------------------------- +// Handle collection message +// --------------------------------------------------------------------------- +// +void CCollectionTests::HandleCollectionMessageL(const CMPXMessage& aMsg) + { + iLogger->Log(_L("+CCollectionTests::HandleCollectionMessageL")); + iLogger->Log( KTextHandleColMsgL2 ); + + // Is this right??? *AIP* + if( aMsg.IsSupported(KMPXMessageCollectionId) && + aMsg.IsSupported(KMPXMessageChangeEventType)) + { + //TMPXCollectionMessage::TEvent event = + //*aMsg.Value( KMPXMessageCollectionId ); + //TInt type = *aMsg.Value( KMPXMessageChangeEventType ); + //TInt data = *aMsg.Value( KMPXMessageGeneralData ); + + TMPXCollectionMessage::TEvent event = TMPXCollectionMessage::EItemChanged; + TInt type = *aMsg.Value( KMPXMessageChangeEventType ); + TInt data = *aMsg.Value( KMPXMessageMediaGeneralId ); + + TMPXCollectionMessage message(event, type, data); + switch( iTestIndex ) + { + case 78: //ETCFwCollectTest0078: + case 81: //ETCFwCollectTest0081: + DoHandleCollectionTest0078L( message ); + break; + case 79: //ETCFwCollectTest0079: + DoHandleCollectionTest0079L( message ); + break; + case 80: //ETCFwCollectTest0080: + DoHandleCollectionTest0080L( message ); + break; + case 99: //ETCFwCollectTest0099: + DoHandleCollectionTest0099L( message ); + break; + case 108: //ETCFwCollectTest0108: + DoHandleCollectionTest0108L( message ); + break; + case 109: //ETCFwCollectTest0109: + DoHandleCollectionTest0109L( message ); + break; + default: + TestPanic( ETestCommonTestNotSupport ); + }; + + return; + } + + if( aMsg.IsSupported(KMPXMessageGeneralEvent) && + aMsg.IsSupported(KMPXMessageGeneralType) ) + { + TMPXCollectionMessage::TEvent event = + *aMsg.Value( KMPXMessageGeneralEvent ); + TInt type = *aMsg.Value( KMPXMessageGeneralType ); + TInt data = *aMsg.Value( KMPXMessageGeneralData ); + TMPXCollectionMessage message(event, type, data); + switch( iTestIndex ) + { + case 1: //ETCFwCollectTest0001: + case 21: + case 23: + DoHandleCollectionTest0001L( message ); + break; + case 11: //ETCFwCollectTest0011: + case 13: //ETCFwCollectTest0013: + case 15: //ETCFwCollectTest0015: + case 17: //ETCFwCollectTest0017: + case 19: //ETCFwCollectTest0019: + case 20: + DoHandleCollectionTest0011L( message ); + break; + case 22: //ETCFwCollectTest0022: + DoHandleCollectionTest0022L( message ); + break; + case 29: //ETCFwCollectTest0029: + DoHandleCollectionTest0029L( message ); + break; + case 30: //ETCFwCollectTest0030: + DoHandleCollectionTest0030L( message ); + break; + case 32: //ETCFwCollectTest0032: + DoHandleCollectionTest0032L( message ); + break; + case 34: //ETCFwCollectTest0034: + DoHandleCollectionTest0034L( message ); + break; + case 36: //ETCFwCollectTest0036: + DoHandleCollectionTest0036L( message ); + break; + case 37: //ETCFwCollectTest0037: + DoHandleCollectionTest0037L( message ); + break; + case 39: //ETCFwCollectTest0039: + DoHandleCollectionTest0039L( message ); + break; + case 40: //ETCFwCollectTest0040: + DoHandleCollectionTest0040L( message ); + break; + case 43: //ETCFwCollectTest0043: + DoHandleCollectionTest0043L( message ); + break; + case 47: //ETCFwCollectTest0047: + DoHandleCollectionTest0047L( message ); + break; + case 51: //ETCFwCollectTest0051: + DoHandleCollectionTest0051L( message ); + break; + case 56: //ETCFwCollectTest0056: + DoHandleCollectionTest0056L( message ); + break; + case 57: //ETCFwCollectTest0057: + DoHandleCollectionTest0057L( message ); + break; + case 58: //ETCFwCollectTest0058: + DoHandleCollectionTest0058L( message ); + break; + case 59: //ETCFwCollectTest0059: + DoHandleCollectionTest0059L( message ); + break; + case 60: //ETCFwCollectTest0060: + DoHandleCollectionTest0060L( message ); + break; + /* *AIP* + case 78: //ETCFwCollectTest0078: + case 81: //ETCFwCollectTest0081: + DoHandleCollectionTest0078L( message ); + break; + case 79: //ETCFwCollectTest0079: + DoHandleCollectionTest0079L( message ); + break; + case 80: //ETCFwCollectTest0080: + DoHandleCollectionTest0080L( message ); + break; + */ + case 84: //ETCFwCollectTest0084: + DoHandleCollectionTest0084L( message ); + break; + case 85: //ETCFwCollectTest0085: + DoHandleCollectionTest0085L( message ); + break; + case 86: //ETCFwCollectTest0086: + case 87: //ETCFwCollectTest0087: + DoHandleCollectionTest0086L( message ); + break; + /* + case 99: //ETCFwCollectTest0099: + DoHandleCollectionTest0099L( message ); + break; + */ + case 100: //ETCFwCollectTest0100: + DoHandleCollectionTest0100L( message ); + break; + case 108: //ETCFwCollectTest0108: + DoHandleCollectionTest0108L( message ); + break; + case 109: //ETCFwCollectTest0109: + DoHandleCollectionTest0109L( message ); + break; + case 117: //ETCFwCollectTest0117: + DoHandleCollectionTest0117L( message ); + break; + case 118: //ETCFwCollectTest0118: + DoHandleCollectionTest0118L( message ); + break; + case 119: //ETCFwCollectTest0119: + DoHandleCollectionTest0119L( message ); + break; + case 120: //ETCFwCollectTest0120: + DoHandleCollectionTest0120L( message ); + break; + case 126: //ETCFwCollectTest0126: + DoHandleCollectionTest0126L( message ); + break; + case 127: //ETCFwCollectTest0127: + DoHandleCollectionTest0127L( message ); + break; + case 130: //ETCFwCollectTest0130: + DoHandleCollectionTest0130L( message ); + break; + case 145: //ETCFwCollectTest0145: + DoHandleCollectionTest0145L( message ); + break; + case 148: //ETCFwCollectTest0148: + DoHandleCollectionTest0148L( message ); + break; + case 162: //ETCFwCollectTest0162: + DoHandleCollectionTest0162L( message ); + break; + case 163: //ETCFwCollectTest0163: + DoHandleCollectionTest0163L( message ); + break; + case 171: //ETCFwCollectTest0171: + DoHandleCollectionTest0171L( message ); + break; + case 173: //ETCFwCollectTest0173: + DoHandleCollectionTest0173L( message ); + break; + case 177: //ETCFwCollectTest0177: + DoHandleCollectionTest0177L( message ); + break; + case 179: //ETCFwCollectTest0179: + DoHandleCollectionTest0179L( message ); + break; + case 182: //ETCFwCollectTest0182: + DoHandleCollectionTest0182L( message ); + break; + case 194: //ETCFwCollectTest0194: + DoHandleCollectionTest0194L( message ); + break; + case 195: //ETCFwCollectTest0195: + DoHandleCollectionTest0195L( message ); + break; + case 196: //ETCFwCollectTest0196: + DoHandleCollectionTest0196L( message ); + break; + case 197: //ETCFwCollectTest0197: + DoHandleCollectionTest0197L( message ); + break; + case 198: //ETCFwCollectTest0198: + DoHandleCollectionTest0198L( message ); + break; + case 199: //ETCFwCollectTest0199: + DoHandleCollectionTest0199L( message ); + break; + case 200: //ETCFwCollectTest0200: + DoHandleCollectionTest0200L( message ); + break; + case 201: //ETCFwCollectTest0201: + DoHandleCollectionTest0201L( message ); + break; + case 202: //ETCFwCollectTest0202: + DoHandleCollectionTest0202L( message ); + break; + default: + TestPanic( ETestCommonTestNotSupport ); + }; + } + } + +// --------------------------------------------------------------------------- +// Handles the collection entries being opened. Typically called +// when client has Open()'d a folder +// --------------------------------------------------------------------------- +// +void CCollectionTests::HandleOpenL(const CMPXMedia& aEntries, + TInt aIndex,TBool aComplete,TInt aError) + { + iLogger->Log(_L("+CCollectionTests::HandleOpenL")); + iLogger->Log(KTextHandleOpenL1); + iLogger->Log(KTextHandleOpenLArg, aIndex, aComplete, aError); + + switch( iTestIndex ) + { + case 1: //ETCFwCollectTest0001: + RunNext(); // skip the handling of callback + break; + case 11: //ETCFwCollectTest0011: + case 13: //ETCFwCollectTest0013: + case 15: //ETCFwCollectTest0015: + case 17: //ETCFwCollectTest0017: + case 19: //ETCFwCollectTest0019: + DoHandleCollectionTest0012L(aEntries, aIndex, aComplete, aError ); + break; + case 21: //ETCFwCollectTest0021: + case 22: + DoHandleCollectionTest0021L(aEntries, aIndex, aComplete, aError ); + break; + case 23: //ETCFwCollectTest0023: + case 24: //ETCFwCollectTest0024: + case 25: //ETCFwCollectTest0025: + case 26: //ETCFwCollectTest0026: + case 27: //ETCFwCollectTest0027: + case 28: //ETCFwCollectTest0028: + DoHandleCollectionTest0023L(aEntries, aIndex, aComplete, aError ); + break; + case 29: //ETCFwCollectTest0029: + DoHandleCollectionTest0029L(aEntries, aIndex, aComplete, aError ); + break; + case 31: //ETCFwCollectTest0031: + DoHandleCollectionTest0031L(aEntries, aIndex, aComplete, aError ); + break; + case 33: //ETCFwCollectTest0033: + DoHandleCollectionTest0033L(aEntries, aIndex, aComplete, aError ); + break; + case 35: //ETCFwCollectTest0035: + DoHandleCollectionTest0035L(aEntries, aIndex, aComplete, aError ); + break; + case 36: //ETCFwCollectTest0036: + DoHandleCollectionTest0036L(aEntries, aIndex, aComplete, aError ); + break; + case 38: //ETCFwCollectTest0038: + DoHandleCollectionTest0038L(aEntries, aIndex, aComplete, aError ); + break; + case 39: //ETCFwCollectTest0039: + DoHandleCollectionTest0039L(aEntries, aIndex, aComplete, aError ); + break; + case 41: //ETCFwCollectTest0041: + DoHandleCollectionTest0041L(aEntries, aIndex, aComplete, aError ); + break; + case 44: //ETCFwCollectTest0044: + DoHandleCollectionTest0044L(aEntries, aIndex, aComplete, aError ); + break; + case 48: //ETCFwCollectTest0048: + DoHandleCollectionTest0048L(aEntries, aIndex, aComplete, aError ); + break; + case 52: //ETCFwCollectTest0052: + DoHandleCollectionTest0052L(aEntries, aIndex, aComplete, aError ); + break; + case 59: //ETCFwCollectTest0059: + DoHandleCollectionTest0059L(aEntries, aIndex, aComplete, aError ); + break; + case 60: //ETCFwCollectTest0060: + DoHandleCollectionTest0060L(aEntries, aIndex, aComplete, aError ); + break; + default: + TestPanic( ETestCommonTestNotSupport ); + }; + } + +// --------------------------------------------------------------------------- +// Handles the item being opened. Typically called +// when client has Open()'d an item. Client typically responds by +// 'playing' the item via the playlist +// --------------------------------------------------------------------------- +void CCollectionTests::HandleOpenL(const CMPXCollectionPlaylist& /*aPlaylist*/,TInt aError) + { + iLogger->Log(KTextHandleOpenL2); + iLogger->Log(_L("~HandleOpenL executed with error: %d"), aError); + switch( iTestIndex ) + { + default: + TestPanic( ETestCommonTestNotSupport ); + }; + } + +// --------------------------------------------------------------------------- +// Handle completion of a asynchronous command +// --------------------------------------------------------------------------- +void CCollectionTests::HandleCommandComplete(CMPXCommand* aCommandResult, TInt aError) + { + iLogger->Log(KTextHandleCommandComplete); + iLogger->Log(_L("~HandleCommandComplete executed with error: %d; aCmdResult: 0x%x"), aError, aCommandResult); + switch( iTestIndex ) + { + case 171: //ETCFwCollectTest0171: + DoHandleCommandCompleteTest0171L(aCommandResult, aError); + break; + case 173: //ETCFwCollectTest0173: + DoHandleCommandCompleteTest0173L(aCommandResult, aError); + break; + case 176: //ETCFwCollectTest0176: + DoHandleCommandCompleteTest0176L(aCommandResult, aError); + break; + case 177: //ETCFwCollectTest0177: + DoHandleCommandCompleteTest0177L(aCommandResult, aError); + break; + case 184: //ETCFwCollectTest0184: + DoHandleCommandCompleteTest0184L(aCommandResult, aError); + break; + default: + TestPanic( ETestCommonTestNotSupport ); + }; + } + +// --------------------------------------------------------------------------- +// Handle extended media properties +// --------------------------------------------------------------------------- +// +void CCollectionTests::HandleCollectionMediaL(const CMPXMedia& aMedia, + TInt aError) + { + iLogger->Log(KTextHandleMediaL); + iLogger->Log(_L("~HandleCollectionMediaL executed with error: %d"), aError); + switch( iTestIndex ) + { + case 145: //ETCFwCollectTest0145: + DoHandleMediaTest0145L(aMedia, aError); + break; + case 146: //ETCFwCollectTest0146: + DoHandleMediaTest0146L(aMedia, aError); + break; + case 147: //ETCFwCollectTest0147: + DoHandleMediaTest0147L(aMedia, aError); + break; + case 148: //ETCFwCollectTest0148: + DoHandleMediaTest0148L(aMedia, aError); + break; + case 149: //ETCFwCollectTest0149: + DoHandleMediaTest0149L(aMedia, aError); + break; + default: + TestPanic( ETestCommonTestNotSupport ); + }; + } + +// --------------------------------------------------------------------------- +// Handles removing a collection path +// --------------------------------------------------------------------------- +// +void CCollectionTests::HandleRemoveL(MDesCArray& aUriArray, TInt aError) + { + // Log parameter + iLogger->Log( KTextHandleRemoveL ); + iLogger->Log(_L("~HandleRemoveL executed with error: %d"), aError); + if( !aError ) + { + for(TInt i = 0; i < aUriArray.MdcaCount(); i++) + { + TPtrC pt( aUriArray.MdcaPoint(i) ); + iLogger->Log(_L("~File [%d]\"%S\""), i, &pt ); + } + } + switch( iTestIndex ) + { + case 88: //ETCFwCollectTest0088: + DoHandleRemoveLTest0088L(aUriArray, aError); + break; + case 89: //ETCFwCollectTest0089: + DoHandleRemoveLTest0089L(aUriArray, aError); + break; + case 90: //ETCFwCollectTest0090: + DoHandleRemoveLTest0090L(aUriArray, aError); + break; + case 91: //ETCFwCollectTest0091: + DoHandleRemoveLTest0091L(aUriArray, aError); + break; + default: + TestPanic( ETestCommonTestNotSupport ); + }; + } + +// --------------------------------------------------------------------------- +// Handle callback for "find" operation +// --------------------------------------------------------------------------- +// +void CCollectionTests::HandleFindAllL(const CMPXMedia& aResults, TBool aComplete, + TInt aError) + { + iLogger->Log( KTextHandleFindAllL ); + iLogger->Log( _L("~HandleFindAllL executed with error: %d, complete: %d"), aError, aComplete ); + switch( iTestIndex ) + { + case 126: //ETCFwCollectTest0126: + DoHandleFindAllTest0126L(aResults, aComplete, aError); + break; + case 127: //ETCFwCollectTest0127: + DoHandleFindAllTest0127L(aResults, aComplete, aError); + break; + case 128: //ETCFwCollectTest0128: + DoHandleFindAllTest0128L(aResults, aComplete, aError); + break; + case 129: //ETCFwCollectTest0129: + DoHandleFindAllTest0129L(aResults, aComplete, aError); + break; + case 130: //ETCFwCollectTest0130: + DoHandleFindAllTest0130L(aResults, aComplete, aError); + break; + default: + TestPanic( ETestCommonTestNotSupport ); + }; + } + +// ----------------------------------------------------------------------------- +// Assert Utility +// ----------------------------------------------------------------------------- +void CCollectionTests::AssertL(TBool aCondition, TInt aCheckPt) + { + if( !aCondition ) + { + iLogger->Log(KTestModuleCheckptFail, aCheckPt); + iLatestTestResult = KErrGeneral; + TestCompleteL(); // stop on failure + } + } + +// ----------------------------------------------------------------------------- +// Compare Utility +// ----------------------------------------------------------------------------- +TBool CCollectionTests::CompareByTMPXItemId(const TMPXItemId& aFirst, + const TMPXItemId& aSecond) + { + // Compare the id + return aFirst == (TInt)aSecond; + } + +// ----------------------------------------------------------------------------- +// Initialize new collection +// ----------------------------------------------------------------------------- +void CCollectionTests::Collection1_Initialize() + { + DELETE_COLLECTION_PTR(iCollectionUtility1); + + iCollectionUtility1 = MMPXCollectionUtility::NewL(this, KMcModeDefault); + } + +// ----------------------------------------------------------------------------- +// Initialize new collection and open with TMPXOpenMode +// ----------------------------------------------------------------------------- +void CCollectionTests::Collection2_InitializeAndOpenL(TMPXOpenMode aOpenMode) + { + iTempCnt = 0; + + DELETE_COLLECTION_PTR(iCollectionUtility2); + + // Prevent iCollectionUtility2 from using same context as iCollectionUtility1 + iCollectionUtility2 = MMPXCollectionUtility::NewL(this, KMcModeIsolated); + iCollectionUtility2->Collection().OpenL( aOpenMode ); + } + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/src/mpxcollectiontest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/src/mpxcollectiontest.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,631 @@ +/* +* Copyright (c) 2002 - 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: MpxCollectionTest class member functions +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "consolemain.h" +#include "mpxcollectiontest.h" +#include "collectiontests.h" + +_LIT(KTestFailed, "Failed"); +_LIT(KTestPassed, "Passed"); + + +// CONSTANTS + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CMpxCollectionTest::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CMpxCollectionTest* CMpxCollectionTest::NewL() + { + CMpxCollectionTest* self = new (ELeave) CMpxCollectionTest; + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CMpxCollectionTest::CMpxCollectionTest +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CMpxCollectionTest::CMpxCollectionTest() + : iMainConsole(NULL) + { + } + +// ----------------------------------------------------------------------------- +// CMpxCollectionTest::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CMpxCollectionTest::ConstructL() + { + iScheduler = new(ELeave) CActiveScheduler; + CActiveScheduler::Install(iScheduler); + + iLogger = CStifLogger::NewL( _L("c:\\"), + _L("MpxCollectionTest.html"), + CStifLogger::EHtml, + CStifLogger::EFile, + ETrue, + ETrue, + ETrue, + EFalse, + ETrue, + ETrue); + + iLogger->Log(_L("===MpxCollectionTest constructed===")); + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +CMpxCollectionTest::~CMpxCollectionTest() + { + if(iMainConsole) + { + delete iMainConsole; + iMainConsole = NULL; + } + if(iLogger) + { + delete iLogger; + iLogger = NULL; + } + if(iScheduler) + { + delete iScheduler; + iScheduler = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CMpxCollectionTest::InitL +// InitL is used to initialize the Test Module. +// ----------------------------------------------------------------------------- +// +TInt CMpxCollectionTest::InitL( + TFileName& /*aIniFile*/, + TBool /*aFirstTime*/ ) + { + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CMpxCollectionTest::GetTestCasesL +// GetTestCases is used to inquire test cases from the Test Module. Test +// cases are stored to array of test cases. The Test Framework will be +// the owner of the data in the RPointerArray after GetTestCases return +// and it does the memory deallocation. +// ----------------------------------------------------------------------------- +// +TInt CMpxCollectionTest::GetTestCasesL( + const TFileName& /*aConfig*/, + RPointerArray& aTestCases ) + { + + // Loop through all test cases and create new + // TTestCaseInfo items and append items to aTestCase array + for( TInt i = 0; Case(i).iMethod != NULL; i++ ) + { + + // Allocate new TTestCaseInfo from heap for a testcase definition. + TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo(); + + // PushL TTestCaseInfo to CleanupStack. + CleanupStack::PushL( newCase ); + + // Set number for the testcase. + // When the testcase is run, this comes as a parameter to RunTestCaseL. + newCase->iCaseNumber = i; + + // Set title for the test case. This is shown in UI to user. + newCase->iTitle.Copy( Case(i).iCaseName ); + + // Append TTestCaseInfo to the testcase array. After appended + // successfully the TTestCaseInfo object is owned (and freed) + // by the TestServer. + User::LeaveIfError(aTestCases.Append ( newCase ) ); + + // Pop TTestCaseInfo from the CleanupStack. + CleanupStack::Pop( newCase ); + } + + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// CMpxCollectionTest::RunTestCaseL +// RunTestCaseL is used to run an individual test case specified +// by aTestCase. Test cases that can be run may be requested from +// Test Module by GetTestCases method before calling RunTestCase. +// ----------------------------------------------------------------------------- +// +TInt CMpxCollectionTest::RunTestCaseL( + const TInt aCaseNumber, + const TFileName& /*aConfig*/, + TTestResult& aResult ) + { + + // Return value + TInt execStatus = KErrNone; + + // Get the pointer to test case function + TCaseInfo tmp = Case ( aCaseNumber ); + + // Check that case number was valid + if ( tmp.iMethod != NULL ) + { + iLogger->Log( _L( "Running test for: %S" ), &(tmp.iCaseName) ); + + // Valid case was found, call it via function pointer + iMethod = tmp.iMethod; + execStatus = ( this->*iMethod )( aResult ); + + // Write log information + if ( aResult.iResult == KErrNone ) + { + iLogger->Log( _L( "Result: %S" ), &KTestPassed ); + iLogger->Log( _L( "" ) ); + } + else + { + iLogger->Log( _L( "Result: %S" ), &KTestFailed ); + iLogger->Log( _L( "Description: %S" ), &(aResult.iResultDes) ); + iLogger->Log( _L( "" ) ); + } + } + else + { + // Valid case was not found, return error. + execStatus = KErrNotFound; + } + + // Return case execution status (not the result of the case execution) + return execStatus; + + } + +// ----------------------------------------------------------------------------- +// CMpxCollectionTest::Case +// Returns a test case by number. +// +// This function contains an array of all available test cases +// i.e pair of case name and test function. If case specified by parameter +// aCaseNumber is found from array, then that item is returned. +// +// The reason for this rather complicated function is to specify all the +// test cases only in one place. It is not necessary to understand how +// function pointers to class member functions works when adding new test +// cases. See function body for instructions how to add new test case. +// ----------------------------------------------------------------------------- +// +const TCaseInfo CMpxCollectionTest::Case ( + const TInt aCaseNumber ) const + { + + /** + * To add new test cases, implement new test case function and add new + * line to KCases array specify the name of the case and the function + * doing the test case + * In practice, do following + * 1) Make copy of existing test case function and change its name + * and functionality. Note that the function must be added to + * MpxCollectionTest.cpp file and to MpxCollectionTest.h + * header file. + * 2) Add entry to following KCases array either by using FUNCENTRY or + * ENTRY macro. + * ENTRY macro takes two parameters: test case name and test case + * function name. + * FUNCENTRY macro takes only test case function name as a parameter and uses + * that as a test case name and test case function name. + */ + + static TCaseInfoInternal const KCases[] = + { + // To add new test cases, add new items to this array + ENTRY( "Test0001-OpenL() Collection 1 - NewL Default, OpenL Default + case 11", Test0001L), + //ENTRY( "Test0002-OpenL() blank", Test0002L), + //ENTRY( "Test0003-OpenL() blank", Test0003L), + //ENTRY( "Test0004-OpenL() blank", Test0004L), + //ENTRY( "Test0005-OpenL() blank", Test0005L), + //ENTRY( "Test0006-OpenL() blank", Test0006L), + //ENTRY( "Test0007-OpenL() blank", Test0007L), + //ENTRY( "Test0008-OpenL() blank", Test0008L), + //ENTRY( "Test0009-OpenL() blank", Test0009L), + //ENTRY( "Test0010-OpenL() blank", Test0010L), + ENTRY( "Test0011-OpenL() Collection 2 - NewL(Isolated), OpenL(Default)", Test0011L), + //ENTRY( "Test0012-OpenL() blank", Test0012L), + ENTRY( "Test0013-OpenL() NewL(Isolated), OpenL(EMPXOpenGroupOrPlaylist)", Test0013L), + //ENTRY( "Test0014-OpenL() blank", Test0014L), + ENTRY( "Test0015-OpenL() NewL(Isolated), OpenL(EMPXOpenAllItems)", Test0015L), + //ENTRY( "Test0016-OpenL() blank", Test0016L), + ENTRY( "Test0017-OpenL() NewL(Isolated), OpenL(EMPXOpenNoPlaylist)", Test0017L), + //ENTRY( "Test0018-OpenL() blank", Test0018L), + ENTRY( "Test0019-OpenL() Collection 2 - NewL(Isolated), OpenL(EMPXOpenPlaylistOnly)", Test0019L), + ENTRY( "Test0020-OpenL() Collection 2 - Open(), Close()", Test0020L), + ENTRY( "Test0021-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0021L), + //ENTRY( "Test0022-OpenL() NewL Default, OpenL(KColTestPluginNormIndex,EMPXOpenDefault)", Test0022L), + //ENTRY( "Test0023-OpenL() same as 21", Test0023L), + //ENTRY( "Test0024-OpenL() NewL Default, OpenL(EMPXOpenGroupOrPlaylist)", Test0024L), + //ENTRY( "Test0025-OpenL() NewL Default, OpenL(EMPXOpenAllItems)", Test0025L), + //ENTRY( "Test0026-OpenL() NewL Default, OpenL(EMPXOpenNoPlaylist)", Test0026L), + //ENTRY( "Test0027-OpenL() NewL Default, OpenL(EMPXOpenPlaylistOnly)", Test0027L), + //ENTRY( "Test0028-OpenL() same as 21", Test0028L), + //ENTRY( "Test0029-OpenL() NewL Default, OpenL(0,EMPXOpenDefault)", Test0029L), + //ENTRY( "Test0030-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0030L), + //ENTRY( "Test0031-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0031L), + //ENTRY( "Test0032-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0032L), + //ENTRY( "Test0033-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0033L), + //ENTRY( "Test0034-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0034L), + //ENTRY( "Test0035-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0035L), + ENTRY( "Test0036-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0036L), + //ENTRY( "Test0037-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0037L), + //ENTRY( "Test0038-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0038L), + //ENTRY( "Test0039-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0039L), + //ENTRY( "Test0040-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0040L), + //ENTRY( "Test0041-OpenL() NewL Default, OpenL(EMPXOpenDefault)", Test0041L), + ENTRY( "Test0042-Filters,Path,UID", Test0042L), + //ENTRY( "Test0043- Filters,Path,UID", Test0043L), + //ENTRY( "Test0044- Filters,Path,UID", Test0044L), + //ENTRY( "Test0045- Filters,Path,UID", Test0045L), + //ENTRY( "Test0046- Filters,Path,UID", Test0046L), + //ENTRY( "Test0047- Filters,Path,UID", Test0047L), + //ENTRY( "Test0048- Filters,Path,UID", Test0048L), + //ENTRY( "Test0049- Filters,Path,UID", Test0049L), + //ENTRY( "Test0050- Filters,Path,UID", Test0050L), + //ENTRY( "Test0051- Filters,Path,UID", Test0051L), + //ENTRY( "Test0052- Filters,Path,UID", Test0052L), + //ENTRY( "Test0053- Filters,Path,UID", Test0053L), + ENTRY( "Test0054-Filters,Path,UID", Test0054L), + //ENTRY( "Test0055- PathL()", Test0055L), + //ENTRY( "Test0056- PathL()", Test0056L), + //ENTRY( "Test0057- PathL()", Test0057L), + //ENTRY( "Test0058- PathL()", Test0058L), + //ENTRY( "Test0059- Back()", Test0059L), + //ENTRY( "Test0060- Back()", Test0060L), + //ENTRY( "Test0061- Back()", Test0061L), + //ENTRY( "Test0062- Back()", Test0062L), + //ENTRY( "Test0063- Back()", Test0063L), + //ENTRY( "Test0064- Empty", Test0064L), + //ENTRY( "Test0065- Empty", Test0065L), + //ENTRY( "Test0066- Empty", Test0066L), + //ENTRY( "Test0067- Empty", Test0067L), + //ENTRY( "Test0068- Empty", Test0068L), + //ENTRY( "Test0069- Empty", Test0069L), + ENTRY( "Test0070-AddL()", Test0070L), + //ENTRY( "Test0071- AddL()", Test0071L), + //ENTRY( "Test0072- AddL()", Test0072L), + //ENTRY( "Test0073- AddL()", Test0073L), + //ENTRY( "Test0074- AddL()", Test0074L), + //ENTRY( "Test0075- AddL()", Test0075L), + //ENTRY( "Test0076- AddL()", Test0076L), + //ENTRY( "Test0077- AddL()", Test0077L), + //ENTRY( "Test0078- AddL()", Test0078L), + //ENTRY( "Test0079- AddL()", Test0079L), + //ENTRY( "Test0080- AddL()", Test0080L), + //ENTRY( "Test0081- AddL()", Test0081L), + ENTRY( "Test0082-RemoveL()", Test0082L), + //ENTRY( "Test0083- RemoveL()", Test0083L), + //ENTRY( "Test0084- RemoveL()", Test0084L), + //ENTRY( "Test0085- RemoveL()", Test0085L), + //ENTRY( "Test0086- RemoveL()", Test0086L), + //ENTRY( "Test0087- RemoveL()", Test0087L), + //ENTRY( "Test0088- RemoveL()", Test0088L), + //ENTRY( "Test0089- RemoveL()", Test0089L), + //ENTRY( "Test0090- RemoveL()", Test0090L), + //ENTRY( "Test0091- RemoveL()", Test0091L), + //ENTRY( "Test0092- RemoveL()", Test0092L), + //ENTRY( "Test0093- RemoveL()", Test0093L), + //ENTRY( "Test0094- RemoveL()", Test0094L), + //ENTRY( "Test0095- RemoveL()", Test0095L), + //ENTRY( "Test0096- RemoveL()", Test0096L), + //ENTRY( "Test0097- RemoveL()", Test0097L), + //ENTRY( "Test0098- RemoveL()", Test0098L), + //ENTRY( "Test0099- RemoveL()", Test0099L), + //ENTRY( "Test0100- RemoveL()", Test0100L), + ENTRY( "Test0101-SetSync()", Test0101L), + //ENTRY( "Test0102- SetSync()", Test0102L), + //ENTRY( "Test0103- SetSync()", Test0103L), + //ENTRY( "Test0104- SetSync()", Test0104L), + //ENTRY( "Test0105- SetSync()", Test0105L), + //ENTRY( "Test0106- SetSync()", Test0106L), + //ENTRY( "Test0107- SetSync()", Test0107L), + //ENTRY( "Test0108- SetSync()", Test0108L), + //ENTRY( "Test0109- SetSync()", Test0109L), + ENTRY( "Test0110-SetL()", Test0110L), + //ENTRY( "Test0111- SetL()", Test0111L), + //ENTRY( "Test0112- SetL()", Test0112L), + //ENTRY( "Test0113- SetL()", Test0113L), + //ENTRY( "Test0114- SetL()", Test0114L), + //ENTRY( "Test0115- SetL()", Test0115L), + //ENTRY( "Test0116- SetL()", Test0116L), + //ENTRY( "Test0117- SetL()", Test0117L), + //ENTRY( "Test0118- SetL()", Test0118L), + //ENTRY( "Test0119- SetL()", Test0119L), + //ENTRY( "Test0120- SetL()", Test0120L), + ENTRY( "Test0121-FindAllL()", Test0121L), + //ENTRY( "Test0122- FindAllL()", Test0122L), + //ENTRY( "Test0123- FindAllL()", Test0123L), + //ENTRY( "Test0124- FindAllL()", Test0124L), + //ENTRY( "Test0125- FindAllL()", Test0125L), + //ENTRY( "Test0126- FindAllL()", Test0126L), + //ENTRY( "Test0127- FindAllL()", Test0127L), + //ENTRY( "Test0128- FindAllL()", Test0128L), + //ENTRY( "Test0129- FindAllL()", Test0129L), + //ENTRY( "Test0130- FindAllL()", Test0130L), + //ENTRY( "Test0131- FindAllL()", Test0131L), + //ENTRY( "Test0132- FindAllL()", Test0132L), + //ENTRY( "Test0133- FindAllL()", Test0133L), + //ENTRY( "Test0134- FindAllL()", Test0134L), + //ENTRY( "Test0135- FindAllL()", Test0135L), + //ENTRY( "Test0136- FindAllL()", Test0136L), + //ENTRY( "Test0137- FindAllL()", Test0137L), + //ENTRY( "Test0138- FindAllL()", Test0138L), + //ENTRY( "Test0139- FindAllL()", Test0139L), + //ENTRY( "Test0140- FindAllL()", Test0140L), + ENTRY( "Test0141-MediaL()", Test0141L), + //ENTRY( "Test0142- MediaL()", Test0142L), + //ENTRY( "Test0143- MediaL()", Test0143L), + //ENTRY( "Test0144- MediaL()", Test0144L), + //ENTRY( "Test0145- MediaL()", Test0145L), + //ENTRY( "Test0146- MediaL()", Test0146L), + //ENTRY( "Test0147- MediaL()", Test0147L), + //ENTRY( "Test0148- MediaL()", Test0148L), + //ENTRY( "Test0149- MediaL()", Test0149L), + ENTRY( "Test0150-CommandL()", Test0150L), + //ENTRY( "Test0151- CommandL()", Test0151L), + //ENTRY( "Test0152- CommandL()", Test0152L), + //ENTRY( "Test0153- CommandL()", Test0153L), + //ENTRY( "Test0154- CommandL()", Test0154L), + //ENTRY( "Test0155- CommandL()", Test0155L), + //ENTRY( "Test0156- CommandL()", Test0156L), + //ENTRY( "Test0157- CommandL()", Test0157L), + //ENTRY( "Test0158- CommandL()", Test0158L), + //ENTRY( "Test0159- CommandL()", Test0159L), + //ENTRY( "Test0160- CommandL()", Test0160L), + //ENTRY( "Test0161- CommandL()", Test0161L), + //ENTRY( "Test0162- CommandL()", Test0162L), + //ENTRY( "Test0163- CommandL()", Test0163L), + //ENTRY( "Test0164- CommandL()", Test0164L), + //ENTRY( "Test0165- CommandL()", Test0165L), + //ENTRY( "Test0166- CommandL()", Test0166L), + //ENTRY( "Test0167- CommandL()", Test0167L), + //ENTRY( "Test0168- CommandL()", Test0168L), + //ENTRY( "Test0169- CommandL()", Test0169L), + ENTRY( "Test0170-CommandL()", Test0170L), + //ENTRY( "Test0171- CommandL()", Test0171L), + //ENTRY( "Test0172- CommandL()", Test0172L), + //ENTRY( "Test0173- CommandL()", Test0173L), + //ENTRY( "Test0174- CommandL()", Test0174L), + //ENTRY( "Test0175- CommandL()", Test0175L), + //ENTRY( "Test0176- CommandL()", Test0176L), + //ENTRY( "Test0177- CommandL()", Test0177L), + //ENTRY( "Test0178- CommandL()", Test0178L), + //ENTRY( "Test0179- CommandL()", Test0179L), + //ENTRY( "Test0180- CommandL()", Test0180L), + //ENTRY( "Test0181- CommandL()", Test0181L), + //ENTRY( "Test0182- CommandL()", Test0182L), + //ENTRY( "Test0183- CommandL()", Test0183L), + //ENTRY( "Test0184- CommandL()", Test0184L), + //ENTRY( "Test0185-GetSupportedTypesL()", Test0185L), + //ENTRY( "Test0186-GetSupportedTypesL()", Test0186L), + //ENTRY( "Test0187-GetSupportedCapabilitiesL()", Test0187L), + //ENTRY( "Test0188-GetSupportedCapabilitiesL()", Test0188L), + //ENTRY( "Test0189-GetSupportedCapabilitiesL()", Test0189L), + ENTRY( "Test0190-CollectionIDL()", Test0190L), + ENTRY( "Test0191-CollectionIDL()", Test0191L), + ENTRY( "Test0192-CollectionIDL()", Test0192L), + ENTRY( "Test0193-CollectionIDL()", Test0193L), + ENTRY( "Test0194-NotifyL()", Test0194L), + //ENTRY( "Test0195- NotifyL()", Test0195L), + //ENTRY( "Test0196- NotifyL()", Test0196L), + //ENTRY( "Test0197- NotifyL()", Test0197L), + //ENTRY( "Test0198- NotifyL()", Test0198L), + //ENTRY( "Test0199- NotifyL()", Test0199L), + //ENTRY( "Test0200- NotifyL()", Test0200L), + //ENTRY( "Test0201- NotifyL()", Test0201L), + //ENTRY( "Test0202- NotifyL()", Test0202L) + }; + + // Verify that case number is valid + if( (TUint) aCaseNumber >= sizeof( KCases ) / + sizeof( TCaseInfoInternal ) ) + { + // Invalid case, construct empty object + TCaseInfo null( (const TText*) L"" ); + null.iMethod = NULL; + return null; + } + + // Construct TCaseInfo object and return it + TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName ); + tmp.iMethod = KCases[ aCaseNumber ].iMethod; + return tmp; + } + +// ----------------------------------------------------------------------------- +// Initialize environment before test case +// ----------------------------------------------------------------------------- +void CMpxCollectionTest::InitializeL(CActiveScheduler* scheduler) + { + iMainConsole = CConsoleMain::NewL(scheduler); + } + +// ----------------------------------------------------------------------------- +// Cleanup environment after test +// ----------------------------------------------------------------------------- +void CMpxCollectionTest::Cleanup() + { + if(iMainConsole) + { + delete iMainConsole; + iMainConsole = NULL; + } + } + +// ================================= TEST CASES ================================ + +TInt CMpxCollectionTest::CommonTestL(TInt testIndex, TTestResult& aResult) + { + __UHEAP_MARK; + + InitializeL(iScheduler); //Initialize environment + + // create and push + CCollectionTests* collectionTests = CCollectionTests::NewLC(iMainConsole, + NULL, + KTxtCollectionTests, + iLogger, + testIndex); + + collectionTests->StartNextTestL(); + + if(!collectionTests->IsTestSynchronous(testIndex)) + { + TRAPD(err, iMainConsole->ActivateL(collectionTests)); + + // Test passed/failed + if(KErrNone != err) + { + aResult.iResult = err; + } + else + { + aResult.iResult = collectionTests->GetLatestTestResult(); + } + } + else + { + aResult.iResult = collectionTests->GetLatestTestResult(); + } + + aResult.iResultDes = KTxtCollectionTests; + + CleanupStack::PopAndDestroy(collectionTests); + + Cleanup(); //Cleanup environment + + //iCollectionUtility may take a short time to Close() + User::After(1000000); // 1 second + + __UHEAP_MARKEND; + iLogger->Log( KTxtCollectionTests); + + return aResult.iResult; + } + +// =============================== HELP FUNCTIONS ============================== + + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point +// Returns: CTestModuleBase*: Pointer to Test Module object +// ----------------------------------------------------------------------------- +// +EXPORT_C CTestModuleBase* LibEntryL() + { + return CMpxCollectionTest::NewL(); + } + +// ----------------------------------------------------------------------------- +// SetRequirements handles test module parameters(implements evolution +// version 1 for test module's heap and stack sizes configuring). +// Returns: TInt: Symbian error code. +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, + TUint32& /*aParameterValid*/ ) + { + + /* --------------------------------- NOTE --------------------------------- + USER PANICS occurs in test thread creation when: + 1) "The panic occurs when the value of the stack size is negative." + 2) "The panic occurs if the minimum heap size specified is less + than KMinHeapSize". + KMinHeapSize: "Functions that require a new heap to be allocated will + either panic, or will reset the required heap size to this value if + a smaller heap size is specified". + 3) "The panic occurs if the minimum heap size specified is greater than + the maximum size to which the heap can grow". + Other: + 1) Make sure that your hardware or Symbian OS is supporting given sizes. + e.g. Hardware might support only sizes that are divisible by four. + ------------------------------- NOTE end ------------------------------- */ + + // Normally STIF uses default heap and stack sizes for test thread, see: + // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize. + // If needed heap and stack sizes can be configured here by user. Remove + // comments and define sizes. + +/* + aParameterValid = KStifTestModuleParameterChanged; + + CTestModuleParamVer01* param = CTestModuleParamVer01::NewL(); + // Stack size + param->iTestThreadStackSize= 16384; // 16K stack + // Heap sizes + param->iTestThreadMinHeap = 4096; // 4K heap min + param->iTestThreadMaxHeap = 1048576;// 1M heap max + + aTestModuleParam = param; +*/ + return KErrNone; + + } + +// ----------------------------------------------------------------------------- +// E32Dll is a DLL entry point function +// Returns: KErrNone: No error +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 +GLDEF_C TInt E32Dll( + TDllReason /*aReason*/) // Reason + { + return(KErrNone); + } +#endif +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/src/pathoptionisremote.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/src/pathoptionisremote.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,215 @@ +/* +* Copyright (c) 2002 - 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: MpxCollectionTest test module. +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include +#include "testutility.h" +#include "pathoptionisremote.h" + +// DATA TYPES +//Entry properties +_LIT(KTestRemoteTitle, "Title: %S"); +_LIT(KTestRemoteState, "Remote: %S"); +_LIT(KTestRemoteTrue, "YES"); +_LIT(KTestRemoteFalse, "NO"); + +//CONSTANTS +const TInt KMaxStringSize = 256; + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CPathOptionIsRemote::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CPathOptionIsRemote* CPathOptionIsRemote::NewL(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger, + CMPXCollectionPath* aPath) + { + CPathOptionIsRemote* self = new (ELeave) CPathOptionIsRemote(aConsoleMain, + aParent, + aName, + aLogger); + + CleanupStack::PushL( self ); + self->ConstructL(aPath); + CleanupStack::Pop( self ); + + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +CPathOptionIsRemote::~CPathOptionIsRemote() + { + iLogger->Log(_L("+CPathOptionIsRemote::~CPathOptionIsRemote")); + iCollectionUtility->Close(); + if(iCollectionPath) + delete iCollectionPath; + iLogger->Log(_L("-CPathOptionIsRemote::~CPathOptionIsRemote")); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Initialize the view before display view +// ----------------------------------------------------------------------------- +void CPathOptionIsRemote::InitializeViewL() + { + iLogger->Log(_L("+CPathOptionIsRemoteL::InitializeViewL")); + TBuf outStr; + // TODO: uncomment this after Collection().EntryL() is implemented + /*CMPXCollectionEntry* entry = + iCollectionUtility->Collection().EntryL(*iCollectionPath); + + if( entry ) + { + //TODO: delete entry??? + CleanupStack::PushL(entry); + //Output title + outStr.Format(KTestRemoteTitle, &(entry->Title())); + OutputStringL(outStr); + CleanupStack::PopAndDestroy(entry); + }*/ + + TBool remoteState = + iCollectionUtility->Collection().IsRemote(*iCollectionPath); + if(remoteState) + { + outStr.Format(KTestRemoteState, &KTestRemoteTrue); + } + else + { + outStr.Format(KTestRemoteState, &KTestRemoteFalse); + } + OutputStringL(outStr); + + iLogger->Log(_L("-CPathOptionIsRemoteL::InitializeViewL")); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Cleanup the view before deactivate/destroy view +// ----------------------------------------------------------------------------- +void CPathOptionIsRemote::CleanupViewL() + { + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle number key press +// ----------------------------------------------------------------------------- +void CPathOptionIsRemote::HandleNumKeyL() + { + TKeyCode key = LastKeyPressed(); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle left key press +// ----------------------------------------------------------------------------- +void CPathOptionIsRemote::HandleLeftKeyL() + { + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle right/enter key press +// ----------------------------------------------------------------------------- +void CPathOptionIsRemote::HandleRightKeyL() + { + } + +// ----------------------------------------------------------------------------- +// CCollectionBrowser::HandleCollectionMediaL +// ----------------------------------------------------------------------------- +// +void CPathOptionIsRemote::HandleCollectionMediaL( + const CMPXMedia& /*aMedia*/, + TInt /*aError*/) + { + + } + +// ----------------------------------------------------------------------------- +// CCollectionBrowser::HandleCollectionMessageL +// ----------------------------------------------------------------------------- +// +void CPathOptionIsRemote::HandleCollectionMessageL(const TMPXCollectionMessage& /*aMessage*/) + { + + } + +// ----------------------------------------------------------------------------- +// CCollectionBrowser::HandleCollectionMessageL +// ----------------------------------------------------------------------------- +// +void CPathOptionIsRemote::HandleOpenL(const CMPXMedia& /*aEntries*/, + TInt /*aIndex*/,TBool /*aComplete*/,TInt /*aError*/) + { + + } + +// ----------------------------------------------------------------------------- +// CCollectionBrowser::HandleCollectionMessageL +// ----------------------------------------------------------------------------- +// +void CPathOptionIsRemote::HandleOpenL(const CMPXCollectionPlaylist& /*aPlaylist*/,TInt /*aError*/) + { + + } + +// ----------------------------------------------------------------------------- +// C++ default constructor. +// ----------------------------------------------------------------------------- +CPathOptionIsRemote::CPathOptionIsRemote(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger) + : CTestMenuView(aConsoleMain, aParent, aName) + { + iLogger = aLogger; + iCollectionPath = NULL; + } + +// ----------------------------------------------------------------------------- +// Second phrase constructor +// ----------------------------------------------------------------------------- +void CPathOptionIsRemote::ConstructL(CMPXCollectionPath* aPath) + { + iLogger->Log(_L("+CPathOptionIsRemote::ConstructL")); + iCollectionUtility = MMPXCollectionUtility::NewL( this ); + iCollectionPath = CMPXCollectionPath::NewL(*aPath); + CTestMenuView::ConstructL(); + iLogger->Log(_L("-CPathOptionIsRemote::ConstructL")); + } + +// ----------------------------------------------------------------------------- +// Output string +// ----------------------------------------------------------------------------- +void CPathOptionIsRemote::OutputStringL(const TDesC& aStr) + { + // TestUtility::TestLog(iLogger, _L("%S\n"), &aStr); + AddItemL(aStr); + } + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/src/pathoptionmenu.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/src/pathoptionmenu.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,167 @@ +/* +* Copyright (c) 2002 - 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: MpxCollectionTest test module. +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include "collectionbrowser.h" +#include "pathoptionmenu.h" +#include "pathoptionisremote.h" + +// MACROS + +// DATA TYPES +//Option name - corresponding to each path specific API +_LIT(KTestOptionOpenL, "OpenL"); //0 +_LIT(KTestOptionIsRemote, "IsRemote"); //1 + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CPathOptionMenu::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CPathOptionMenu* CPathOptionMenu::NewL(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger) + { + CPathOptionMenu* self = new (ELeave) CPathOptionMenu(aConsoleMain, + aParent, + aName, + aLogger); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +CPathOptionMenu::~CPathOptionMenu() + { + iLogger->Log(_L("+CPathOptionMenu::~CPathOptionMenu")); + if(iCollectionPath) + delete iCollectionPath; + iLogger->Log(_L("-CPathOptionMenu::~CPathOptionMenu")); + } + +// ----------------------------------------------------------------------------- +// CPathOptionMenu::SetPathL +// ----------------------------------------------------------------------------- +void CPathOptionMenu::SetPathL(CMPXCollectionPath& aPath) + { + iCollectionPath = CMPXCollectionPath::NewL(aPath); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Initialize the view before display view +// ----------------------------------------------------------------------------- +void CPathOptionMenu::InitializeViewL() + { + iLogger->Log(_L("+CPathOptionMenu::InitializeViewL")); + //Add option name + AddItemL(KTestOptionOpenL); //0 + AddItemL(KTestOptionIsRemote); //1 + iLogger->Log(_L("-CPathOptionMenu::InitializeViewL")); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Cleanup the view before deactivate/destroy view +// ----------------------------------------------------------------------------- +void CPathOptionMenu::CleanupViewL() + { + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle number key press +// ----------------------------------------------------------------------------- +void CPathOptionMenu::HandleNumKeyL() + { + TKeyCode key = LastKeyPressed(); + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle left key press +// ----------------------------------------------------------------------------- +void CPathOptionMenu::HandleLeftKeyL() + { + } + +// ----------------------------------------------------------------------------- +// From CTestBaseView +// Handle right/enter key press +// ----------------------------------------------------------------------------- +void CPathOptionMenu::HandleRightKeyL() + { + iLogger->Log(_L("+CPathOptionMenu::HandleRightKeyL")); + switch( CurrentIndex() ) + { + case 0: +// iChild = + // CCollectionBrowser::NewL(iConsoleMain, + // this, + // KTxtCollectionBrowser, + // iLogger, + // iCollectionPath); + break; + case 1: + iChild = + CPathOptionIsRemote::NewL(iConsoleMain, + this, + KTxtPathOptionIsRemote, + iLogger, + iCollectionPath); + break; + } + NextViewL(iChild); + iLogger->Log(_L("-CPathOptionMenu::HandleRightKeyL")); + } + +// ----------------------------------------------------------------------------- +// C++ default constructor. +// ----------------------------------------------------------------------------- +CPathOptionMenu::CPathOptionMenu(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger) + : CTestMenuView(aConsoleMain, aParent, aName) + { + iLogger = aLogger; + iCollectionPath = NULL; + } + +// ----------------------------------------------------------------------------- +// Second phrase constructor +// ----------------------------------------------------------------------------- +void CPathOptionMenu::ConstructL() + { + iLogger->Log(_L("+CPathOptionMenu::ConstructL")); + CTestMenuView::ConstructL(); + iLogger->Log(_L("-CPathOptionMenu::ConstructL")); + } + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/collectiontest/src/testutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/collectiontest/src/testutility.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2002 - 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: Provide common utility function for all test cases +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include "testutility.h" + +// ---------------------------------------------------------------------------------------------------------- +// Test whether aContainer containing all the text object in aArray with aAttr attribues in order +// ---------------------------------------------------------------------------------------------------------- +// +TBool TestUtility::MatchMediaArrayTextObject(const CMPXMedia& aContainer, const MDesC16Array& aArray, + TMPXAttribute& aAttr) + { + TBool match = ValidateMediaArrayObject(aContainer, aArray.MdcaCount()); + if( match ) + { + CMPXMediaArray* contArray = aContainer.Value( TMPXAttribute(KMPXMediaIdContainer,EMPXMediaArrayContents) ); + TInt contCnt = contArray->Count(); + + for(TInt i = 0; i < contCnt; i++) + { + const CMPXMedia* contItem = ( *contArray )[i]; + const TDesC& contText = contItem->ValueText( aAttr ); + if(contItem->IsSupported( aAttr ) == EFalse || aArray.MdcaPoint( i ) != contText ) + { + match = EFalse; + break; + } + } + } + return match; + } + +// ---------------------------------------------------------------------------------------------------------- +// Test whether aMedia1 and aMedia2 support same attribute +// ---------------------------------------------------------------------------------------------------------- +// +TBool TestUtility::ValidateMediaObject(const CMPXMedia& aMedia1, const CMPXMedia& aMedia2, + TMPXAttribute& aAttr) + { + TBool match = ETrue; // assume true + if(!aMedia1.IsSupported(aAttr) || !aMedia2.IsSupported(aAttr)) + { + match = EFalse; + } + return match; + } + +// ---------------------------------------------------------------------------------------------------------- +// Test whether aMedia1 and aMedia2 support same array attribute +// ---------------------------------------------------------------------------------------------------------- +// +TBool TestUtility::ValidateMediaArrayObject(const CMPXMedia& aMedia1, const CMPXMedia& aMedia2) + { + TBool match = ETrue; // assume true + TMPXAttribute arrayAttr(KMPXMediaIdContainer,EMPXMediaArrayContents); + TMPXAttribute arrayCntAttr(KMPXMediaIdContainer,EMPXMediaArrayCount); + if(!aMedia1.IsSupported( arrayAttr ) || + !aMedia1.IsSupported( arrayCntAttr ) || + !aMedia2.IsSupported( arrayAttr ) || + !aMedia2.IsSupported( arrayCntAttr) ) + { + match = EFalse; + } + else + { + // TODO: commented part because a minor bug in CMPXCollectionEngine::ListPluginsL + // where "count" doesn't match array's count + //TInt m1Cnt = *aMedia1.Value( arrayCntAttr ); + //TInt m2Cnt = *aMedia2.Value( arrayCntAttr ); + //if(m1Cnt == m2Cnt) + // { + CMPXMediaArray* m1Array = aMedia1.Value( arrayAttr ); + CMPXMediaArray* m2Array = aMedia1.Value( arrayAttr ); + + //if(m1Array->Count() != m1Cnt || m2Array->Count() != m2Cnt) + if(m1Array->Count() != m2Array->Count()) + { + match = EFalse; + } + // } + //else + // { + // match = EFalse; + // } + } + return match; + } + +// ---------------------------------------------------------------------------------------------------------- +// Test whether aMedia is media array and same count as aArray +// ---------------------------------------------------------------------------------------------------------- +// +TBool TestUtility::ValidateMediaArrayObject(const CMPXMedia& aMedia, TInt aArrayCnt) + { + TBool match = ETrue; // assume true + TMPXAttribute arrayAttr(KMPXMediaIdContainer,EMPXMediaArrayContents); + TMPXAttribute arrayCntAttr(KMPXMediaIdContainer,EMPXMediaArrayCount); + if(!aMedia.IsSupported( arrayAttr ) || + !aMedia.IsSupported( arrayCntAttr ) ) + { + match = EFalse; + } + else + { + // TODO: commented part because a minor bug in CMPXCollectionEngine::ListPluginsL + // where "count" doesn't match array's count + //TInt contCnt = *aMedia.Value( arrayCntAttr ); + //if(contCnt == aArrayCnt) + // { + CMPXMediaArray* contArray = aMedia.Value( arrayAttr ); + TInt contArrayCnt = contArray->Count(); + if(contArrayCnt != aArrayCnt) + { + match = EFalse; + } + // } + //else + // { + // match = EFalse; + // } + } + return match; + } + +/* +// ---------------------------------------------------------------------------------------------------------- +// Log the content of collection path +// ---------------------------------------------------------------------------------------------------------- +// +void TestUtility::LogCollectionPath(CMPXCollectionPath& aPath, CStifLogger* aLogger) + { + TInt levels = aPath.Levels(); + TInt count = aPath.Count(); + aLogger->Log(_L("Collection Path debug: levels= %d, count = %d"), levels, count); + for (TInt i=0; iLog(_L("Collection Path debug: Level[%d] = (index %d, id 0x%08x)"), i, + aPath.Index(i), + aPath.Id(i) ); + } + if (count > 0) + { + TInt index = aPath.Index(); + CMPXCollectionPath* dpath = const_cast(&aPath); + dpath->SetToFirst(); + TInt c = 0; + do + { + aLogger->Log(_L("Collection Path debug top level: item %d = id 0x%08x"), c, dpath->Id()); + } while (++(*dpath) && ++c < 15 ); + dpath->Set(index); + } + } +*/ diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/basetest/bwinscw/basetestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/basetest/bwinscw/basetestu.def Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,14 @@ +EXPORTS + ?EventName@CBaseTest@@MAE?AVTPtrC16@@H@Z @ 1 NONAME ; class TPtrC16 CBaseTest::EventName(int) + ?ConstructL@CBaseTest@@UAEXXZ @ 2 NONAME ; void CBaseTest::ConstructL(void) + ?RemoveExpectedEvent@CBaseTest@@MAEHW4TExpectedEvent@1@@Z @ 3 NONAME ; int CBaseTest::RemoveExpectedEvent(enum CBaseTest::TExpectedEvent) + ??1CBaseTest@@UAE@XZ @ 4 NONAME ; CBaseTest::~CBaseTest(void) + ?RemoveAllExpectedEvents@CBaseTest@@MAEXXZ @ 5 NONAME ; void CBaseTest::RemoveAllExpectedEvents(void) + ?ProcessEvent@CBaseTest@@MAEXW4TExpectedEvent@1@H@Z @ 6 NONAME ; void CBaseTest::ProcessEvent(enum CBaseTest::TExpectedEvent, int) + ?HandleTimeout@CBaseTest@@UAEXH@Z @ 7 NONAME ; void CBaseTest::HandleTimeout(int) + ?SetTimeout@CBaseTest@@MAEHAAVCStifItemParser@@@Z @ 8 NONAME ; int CBaseTest::SetTimeout(class CStifItemParser &) + ??0CBaseTest@@QAE@AAVCTestModuleIf@@@Z @ 9 NONAME ; CBaseTest::CBaseTest(class CTestModuleIf &) + ?AddExpectedEvent@CBaseTest@@MAEXW4TExpectedEvent@1@H@Z @ 10 NONAME ; void CBaseTest::AddExpectedEvent(enum CBaseTest::TExpectedEvent, int) + ?SetAllowedPanic@CBaseTest@@MAEHAAVCStifItemParser@@@Z @ 11 NONAME ; int CBaseTest::SetAllowedPanic(class CStifItemParser &) + ?SetExpectedEvents@CBaseTest@@MAEHAAVCStifItemParser@@@Z @ 12 NONAME ; int CBaseTest::SetExpectedEvents(class CStifItemParser &) + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/basetest/eabi/basetestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/basetest/eabi/basetestu.def Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,21 @@ +EXPORTS + _ZN9CBaseTest10ConstructLEv @ 1 NONAME + _ZN9CBaseTest10SetTimeoutER15CStifItemParser @ 2 NONAME + _ZN9CBaseTest12ProcessEventENS_14TExpectedEventEi @ 3 NONAME + _ZN9CBaseTest13HandleTimeoutEi @ 4 NONAME + _ZN9CBaseTest15SetAllowedPanicER15CStifItemParser @ 5 NONAME + _ZN9CBaseTest16AddExpectedEventENS_14TExpectedEventEi @ 6 NONAME + _ZN9CBaseTest17SetExpectedEventsER15CStifItemParser @ 7 NONAME + _ZN9CBaseTest19RemoveExpectedEventENS_14TExpectedEventE @ 8 NONAME + _ZN9CBaseTest23RemoveAllExpectedEventsEv @ 9 NONAME + _ZN9CBaseTest9EventNameEi @ 10 NONAME + _ZN9CBaseTestC2ER13CTestModuleIf @ 11 NONAME + _ZN9CBaseTestD0Ev @ 12 NONAME + _ZN9CBaseTestD1Ev @ 13 NONAME + _ZN9CBaseTestD2Ev @ 14 NONAME + _ZTI14CSimpleTimeout @ 15 NONAME ; ## + _ZTI9CBaseTest @ 16 NONAME ; ## + _ZTV14CSimpleTimeout @ 17 NONAME ; ## + _ZTV9CBaseTest @ 18 NONAME ; ## + _ZThn48_N9CBaseTest13HandleTimeoutEi @ 19 NONAME ; ## + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/basetest/group/basetest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/basetest/group/basetest.mmp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2002 - 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: Base Class for Scripted Tests +*/ + +#include + +TARGET basetest.dll +TARGETTYPE dll + +UID 0x1000008D 0x10100090 + +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE basetest.cpp +SOURCE timeoutcontroller.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY efsrv.lib +LIBRARY stiftestinterface.lib +LIBRARY testviewframework.lib + +#if defined(ARMCC) +#elif defined(WINSCW) +deffile ../bwinscw/ +#endif + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/basetest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/basetest/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2002 - 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 basetestlib. +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +basetest.mmp + +PRJ_MMPFILES + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/basetest/src/basetest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/basetest/src/basetest.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,295 @@ +/* +* Copyright (c) 2002 - 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: Base Class Scripted STIF cases +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include "basetest.h" + + +// ----------------------------------------------------------------------------- +// CBaseTest::CCollectionHelperTest +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C CBaseTest::CBaseTest( CTestModuleIf& aTestModuleIf ): + CScriptBase( aTestModuleIf ), + iTestModuleIf(aTestModuleIf) + { + } + +// Destructor +EXPORT_C CBaseTest::~CBaseTest() + { + // Delete logger + delete iLog; + delete iTimeoutController; + } + +// ----------------------------------------------------------------------------- +// CBaseTest::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +EXPORT_C void CBaseTest::ConstructL() +{ + iTimeoutController = CSimpleTimeout::NewL (this, iLog); +} + +// ----------------------------------------------------------------------------- +// CBaseTest::EventName +// Return descriptor with the notification description +// ----------------------------------------------------------------------------- +EXPORT_C TPtrC CBaseTest::EventName( TInt aKey ) +{ + static TText* const badKeyword = (TText*)L"BadKeyword"; + static TText* const keywords[] = { + (TText*)L"EColHandleCollectionMessage", + (TText*)L"EColHandleOpen", + (TText*)L"EColHandleAddFileComplete", + (TText*)L"EColHandleRemove", + (TText*)L"EColHandleFindAllComplete", + (TText*)L"EPlaHandlePlaybackMessage1", + (TText*)L"EPlaHandlePlaybackMessage2" + }; + + if( (TUint)aKey >= (sizeof( keywords )/sizeof(TText*)) ) + { + iLog->Log(_L("Keyword out of bounds")); + TPtrC keyword( badKeyword ); + return keyword; + } + else + { + TPtrC keyword( keywords[aKey] ); + return keyword; + } +} + +// ----------------------------------------------------------------------------- +// CBaseTest::AddExpectedEvent +// Add an event to the expected events' list +// ----------------------------------------------------------------------------- +EXPORT_C void CBaseTest::AddExpectedEvent(TExpectedEvent event, TInt ms) +{ + FTRACE(FPrint(_L("CBaseTest::AddExpectedEvent"))); + iExpectedEvents.Append(event); + TPtrC eventName = EventName(event); + iLog->Log(_L("Adding expected event:(0x%02x)%S Total=%d"), event, + &eventName, iExpectedEvents.Count() ); + + if ( iTimeoutController && !iTimeoutController->IsActive() ) + { + if (ms > 0) + { + iTimeoutController->Start( TTimeIntervalMicroSeconds(ms * 1000) ); + } + else + { + iLog->Log(_L("Timeout with default value (1s)")); + iTimeoutController->Start( TTimeIntervalMicroSeconds(1000000) ); + } + } +} + +// ----------------------------------------------------------------------------- +// CBaseTest::RemoveExpectedEvent +// Remove the indicated event from the expected events' list +// Returns: ETrue: Event found. +// EFalse: Event not found. +// ----------------------------------------------------------------------------- +EXPORT_C TBool CBaseTest::RemoveExpectedEvent(TExpectedEvent aEvent) +{ + FTRACE(FPrint(_L("CBaseTest::RemoveExpectedEvent"))); + TBool match = EFalse; + for (TUint i=0; i < iExpectedEvents.Count() ; i++) + { + if (iExpectedEvents[i] == aEvent) + { + iExpectedEvents.Remove(i); + match = ETrue; + break; + } + } + + return match; +} + + +// ----------------------------------------------------------------------------- +// CBaseTest::RemoveAllExpectedEvents +// Remove the indicated event from the expected events' list +// ----------------------------------------------------------------------------- +EXPORT_C void CBaseTest::RemoveAllExpectedEvents() +{ + FTRACE(FPrint(_L("CBaseTest::RemoveAllExpectedEvents"))); + iLog->Log(_L("Removing all expected events")); + + iExpectedEvents.Reset(); + iOcurredEvents.Reset(); +} + + +// ----------------------------------------------------------------------------- +// CBaseTest::ProcessEvent +// Process events. +// ----------------------------------------------------------------------------- +EXPORT_C void CBaseTest::ProcessEvent(TExpectedEvent aEvent, TInt aError) +{ + FTRACE(FPrint(_L("CBaseTest::ProcessExpectedEvent"))); + TPtrC nameEvent = EventName(aEvent); + + // Check for error + if (aError == KErrNone) + { + // Remove the event + if (RemoveExpectedEvent(aEvent)) + { + iLog->Log(_L("Expected Event: (0x%02x)%S has ocurred Total=%d"), + aEvent, &nameEvent,iExpectedEvents.Count()); + } + else + { + iLog->Log(_L("Event: (0x%02x)%S has ocurred"), aEvent, &nameEvent); + return; + } + + // All expected events have ocurred + if (iExpectedEvents.Count() == 0 ) + { + Signal(); + iTimeoutController->Cancel(); + } + } + else + { + iLog->Log(_L("[Error] Event: (0x%02x)%S return with error code=%d"), + aEvent, &nameEvent, aError); + + if (iExpectedEvents.Count() != 0 ) + { + RemoveExpectedEvent(aEvent); + } + + iTimeoutController->Cancel(); + Signal(KErrCallbackErrorCode); + } +} + +// ----------------------------------------------------------------------------- +// CBaseTest::HandleTimeout +// Review if all the expected events have ocurred once the time is over +// ----------------------------------------------------------------------------- +EXPORT_C void CBaseTest::HandleTimeout(TInt aError) +{ + FTRACE(FPrint(_L("CBaseTest::HandleTimeout"))); + // All expected events have ocurred + if (aError != KErrNone) + { + if (iExpectedEvents.Count() == 0 ) + { + iLog->Log(_L("Timing out but events have ocurred")); + Signal(); + } + else + { + RemoveAllExpectedEvents(); + iLog->Log(_L("Timing out and events still pending")); + Signal(KErrEventPending); + } + } + else + { + iLog->Log(_L("Timing out return a error %d"), aError); + Signal(aError); + } +} + +// ----------------------------------------------------------------------------- +// CBaseTest::SetTimeout +// Create a timer and set a timeout +// When the timeout is reached the test case is marked as failed +// It's used rather than the "timeout" keyword in the configuration file +// because in this way the log continues +// ----------------------------------------------------------------------------- +EXPORT_C TInt CBaseTest::SetTimeout( CStifItemParser& aItem ) +{ + FTRACE(FPrint(_L("CBaseTest::SetTimeout"))); + TInt timeout=0; + TInt error = aItem.GetNextInt(timeout) ; + if ( iTimeoutController ) + { + if ( timeout > 0 ) + { + iTimeoutController->Start( TTimeIntervalMicroSeconds(timeout*1000) ); + } + else + { + iTimeoutController->Start( TTimeIntervalMicroSeconds(1000000) ); + } + } + else + { + iLog->Log(_L("Timeout Controller doesn't exist")); + error = KErrTimeoutController; + } + return error; +} + + +// ----------------------------------------------------------------------------- +// Uses the TestModuleBase API to allow a panic as exit reason for a test case +// Returns: Symbian OS errors. +// ----------------------------------------------------------------------------- +EXPORT_C TInt CBaseTest::SetAllowedPanic( CStifItemParser& aItem ) +{ + FTRACE(FPrint(_L("CBaseTest::SetAllowedPanic"))); + TInt error = KErrNone; + TInt panicCode; + TPtrC panicType; + if ( ( KErrNone == aItem.GetNextString(panicType) ) && + ( KErrNone == aItem.GetNextInt(panicCode) ) ) + { + iLog->Log(_L("Allowing panic: %S %d"), &panicType, panicCode); + iTestModuleIf.SetExitReason( CTestModuleIf::EPanic, panicCode ); + iNormalExitReason = EFalse; + } + else + { + iLog->Log(KMsgBadTestParameters); + error = KErrBadTestParameter; + } + return error; +} + +// ----------------------------------------------------------------------------- +// CBaseTest::SetExpectedEvents() +// Returns: Symbian OS errors. +// ----------------------------------------------------------------------------- +EXPORT_C TInt CBaseTest::SetExpectedEvents( CStifItemParser& aItem ) +{ + FTRACE(FPrint(_L("CBaseTest::SetExpectedEvents"))); + TInt error = KErrNone; + TInt event=0; + while ( KErrNone == aItem.GetNextInt(event)) + { + AddExpectedEvent(static_cast(event), 0); // Default timeout value + } + return error; +} diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/basetest/src/timeoutcontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/basetest/src/timeoutcontroller.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2002 - 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: Timeout controller +* +*/ + +#include "timeoutcontroller.h" +#include "debug.h" + +/* +------------------------------------------------------------------------------- +Class: CSimpleTimeout +Method: CSimpleTimeout +Description: Default constructor +C++ default constructor can NOT contain any code, that might leave. +Parameters: None +Return Values: None +Errors/Exceptions: None +Status: Approved +------------------------------------------------------------------------------- +*/ +CSimpleTimeout::CSimpleTimeout() : CActive (CActive::EPriorityStandard) +{ + FTRACE(FPrint(_L("CSimpleTimeout::CSimpleTimeout"))); +} + +// ----------------------------------------------------------------------------- +// CSimpleTimeout::ConstructL() +// Symbian OS second phase constructor. +// ----------------------------------------------------------------------------- +// +void CSimpleTimeout::ConstructL( MTimeoutObserver* aObserver, +CStifLogger* aLogger) +{ + FTRACE(FPrint(_L("CSimpleTimeout::ConstructL"))); + iObserver = aObserver; + iLog = aLogger; + iTimer.CreateLocal(); + iTestCaseTimeout = 0; // Initialize + + // Add to active scheduler + CActiveScheduler::Add ( this ); +} + +// ----------------------------------------------------------------------------- +// CSimpleTimeout::NewL() +// Two-phased constructor. +// Returns: CSimpleTimeout* : pointer to created object +// ----------------------------------------------------------------------------- +// +CSimpleTimeout* CSimpleTimeout::NewL( MTimeoutObserver* aTestClass, +CStifLogger* aLogger) +{ + FTRACE(FPrint(_L("CSimpleTimeout::NewL"))); + CSimpleTimeout* self = new ( ELeave ) CSimpleTimeout(); + CleanupStack::PushL( self ); + self->ConstructL( aTestClass, aLogger); + CleanupStack::Pop( self ); + return self; + +} + +// ----------------------------------------------------------------------------- +// CSimpleTimeout::~CSimpleTimeout() +// Destructor. +// ----------------------------------------------------------------------------- +// +CSimpleTimeout::~CSimpleTimeout() +{ + FTRACE(FPrint(_L("CSimpleTimeout::~CSimpleTimeout"))); + Cancel(); + iTimer.Close(); +} + +// ----------------------------------------------------------------------------- +// CSimpleTimeout::Start() +// Start timeout counting. +// ----------------------------------------------------------------------------- +// +void CSimpleTimeout::Start(TTimeIntervalMicroSeconds aTimeout) +{ + FTRACE(FPrint(_L("CSimpleTimeout::Start"))); + if (IsActive()) + { + Cancel(); + } + + // Request timer + TTime endTime; + endTime.HomeTime(); + endTime = endTime + aTimeout; + + TInt64 miliseconds = aTimeout.Int64(); + miliseconds /= 1000; + + TBuf<30> dateString; + endTime.FormatL(dateString, KFormatTimeStamp); + iLog->Log(_L("Timer=%LD ms, EndTime=%S"), miliseconds, &dateString); + + // Store absolute timeout + iTestCaseTimeout = endTime; + + // Taken from STIF engine + // Note: iTimer.After() method cannot use because there needed + // TTimeIntervalMicroSeconds32 and it is 32 bit. So then cannot create + // timeout time that is long enough. At() uses 64 bit value=>Long enough. + iTimer.At( iStatus, endTime ); + SetActive(); +} + +// ----------------------------------------------------------------------------- +// CSimpleTimeout::Stop() +// Start timeout counting. +// ----------------------------------------------------------------------------- +// +void CSimpleTimeout::Stop() +{ + FTRACE(FPrint(_L("CSimpleTimeout::Stop"))); + if (IsActive()) + { + Cancel(); + } +} + +// ----------------------------------------------------------------------------- +// CSimpleTimeout::RunL() +// RunL handles completed timeouts. +// ----------------------------------------------------------------------------- +// +void CSimpleTimeout::RunL() +{ + FTRACE(FPrint(_L("CSimpleTimeout::RunL"))); + iLog->Log(_L("CSimpleTimeout::RunL")); + TTime timeout; + timeout.HomeTime(); + // Handle the abort case when system time gets changed, but timeout is + // still valid. All other cases should timeout since they invalidate the + // logic of the timers. + if ( iStatus == KErrAbort) + { + if ( iTestCaseTimeout > timeout ) + { + RDebug::Print( _L( "Absolute timer still valid. Restaring timer. iStatus: %d" ), iStatus.Int() ); + // Start new timer + iStatus = KErrNone; // reset value + iTimer.At ( iStatus, iTestCaseTimeout ); // restart timer + SetActive(); + } + else + { + // Absolute timer no longer valid. Must timeout. + iLog->Log(_L("Absolute timeout no longer valid")); + iObserver->HandleTimeout(KErrNone); + } + + } + else + { + // Status was not KErrAbort. Timing out! + // iLog->Log(_L("CSimpleTimeout::RunL - Timeout !!"), iTimeout); + iLog->Log(_L("Timing out")); + iObserver->HandleTimeout(KErrNone); + } + +} + +// ----------------------------------------------------------------------------- +// CSimpleTimeout::DoCancel() +// Cancel active request. +// ----------------------------------------------------------------------------- +// +void CSimpleTimeout::DoCancel() +{ + FTRACE(FPrint(_L("CSimpleTimeout::DoCancel"))); + iTimer.Cancel(); +} + +// ----------------------------------------------------------------------------- +// CSimpleTimeout::RunError() +// Handle errors. Just let framework handle errors because +// RunL does not leave. +// Returns: Symbian OS error code +// ----------------------------------------------------------------------------- +// +TInt CSimpleTimeout::RunError( TInt aError ) +{ + FTRACE(FPrint(_L("CSimpleTimeout::RunError"))); + iLog->Log(_L("Timeout error %d"), aError); + iObserver->HandleTimeout(aError); + return aError; +} + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2002 - 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 common subsystem +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +#include "../testplugins/group/bld.inf" +#include "../testviewframework/group/bld.inf" +#include "../basetest/group/bld.inf" + +PRJ_MMPFILES + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/inc/basetest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/inc/basetest.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,169 @@ +/* +* Copyright (c) 2002 - 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: Base Class for Scripted Tests +* +*/ + +#ifndef BASETEST_H +#define BASETEST_H + +#include +#include +#include +#include "TimeoutController.h" +#include "debug.h" + + +// CONSTANTS +const TInt KErrBadTestParameter= -1000; // Error on configuration file + +const TInt KErrEventPending =-2000; // Timeout and not callback +const TInt KErrCallbackErrorCode = -2001; // Callback return error code +const TInt KErrUnexpectedValue =-2002; // Unexpected value at setting +const TInt KExpectedFrequencyChange = -2003; // Is not finding more than one station +const TInt KErrTimeoutController = -2007; // Unexpected notification + +const TInt KSmallTimeout = 1000; +const TInt KMediumTimeout = 4000; +const TInt KLargeTimeout = 100000; + + +_LIT( KMsgBadTestParameters, "[Error] No valid test case parameters"); + +_LIT( KTestFile, "c:\\Blackbird.aac"); +_LIT( KTestFileMimeType, "audio/aac" ); +_LIT( KRenameOldUri, "c:\\Blackbird.aac"); +_LIT( KRenameNewUri, "c:\\data\\Blackbird.aac"); + +/** +* CBaseTest class for STIF Test Framework TestScripter. +* +*/ +class CBaseTest : public CScriptBase, public MTimeoutObserver + { + public: + + // Update EventName() whenever you update this + enum TExpectedEvent + { + EColHandleCollectionMessage, + EColHandleOpen, + EColHandleAddFileComplete, + EColHandleRemove, + EColHandleFindAllComplete, + + EPlaHandlePlaybackMessage1, + EPlaHandlePlaybackMessage2 + }; + + IMPORT_C CBaseTest( CTestModuleIf& aTestModuleIf ); + IMPORT_C virtual ~CBaseTest(); + + IMPORT_C virtual void ConstructL(); + + public: + + // From MTimeoutObserver + + /** + * @since 3.2 + * @param none + * Review if all the expected events have ocurred once the time is over + */ + IMPORT_C virtual void HandleTimeout(TInt error); + + protected: + + /** + * Maps a event with a descriptor with its name + * @since S60 3.2 + */ + IMPORT_C virtual TPtrC EventName( TInt aKey ); + + /** + * Set an event as expected and set default timeout + * @since S60 3.2 + */ + IMPORT_C virtual void AddExpectedEvent(TExpectedEvent event, TInt ms); + + + /** + * Unset an event as expected + * @since S60 3.2 + */ + IMPORT_C virtual TBool RemoveExpectedEvent(TExpectedEvent event); + + + /** + * @since S60 3.2 + * @param none + * Removes all expected events + */ + IMPORT_C virtual void RemoveAllExpectedEvents(); + + /** + * Verify that the event was expected, removes it from the list + * Signal the TestScripter with the returned error code + * @since S60 3.2 + */ + IMPORT_C virtual void ProcessEvent(TExpectedEvent aEvent, TInt aError); + + /* + * Test methods are listed below. + */ + + /** + * Sets a timeout different since the default + * @since S60 3.2 + * @param aItem Script line containing parameters. + * @return Symbian OS error code. + */ + IMPORT_C virtual TInt SetTimeout( CStifItemParser& aItem ); + + /** + * + * @since S60 3.2 + * @param aItem Script line containing parameters. + * @return Symbian OS error code. + */ + IMPORT_C virtual TInt SetExpectedEvents( CStifItemParser& aItem ); + + /** + * + * @since S60 3.2 + * @param aItem Script line containing parameters. + * @return Symbian OS error code. + */ + IMPORT_C virtual TInt SetAllowedPanic( CStifItemParser& aItem ); + + protected: + + // reference to TestModuleIf + CTestModuleIf& iTestModuleIf; + + // Active object with a timer to timeout the test case + CSimpleTimeout * iTimeoutController; + + // Indicates if the test case use a normal exit reason + TBool iNormalExitReason; + + // List of expected events + RArray iExpectedEvents; + + // List of notification event (by the callback) + RArray iOcurredEvents; + }; + +#endif // BASETEST_H + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/inc/debug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/inc/debug.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2002 - 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: Central place for nice debug-type macros & functions +* +*/ + +#ifndef DEBUG_H +#define DEBUG_H + +//INCLUDES +#include +#define FTRACE(a) {a;} + +/** +* Declare the FPrint function +* @since Series 60 2.7 +* @return none +*/ +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); + #ifdef _DEBUG + RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3); + #endif +} +#endif // DEBUG_H + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/inc/timeoutcontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/inc/timeoutcontroller.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,135 @@ +/* +* Copyright (c) 2002 - 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: Implements timeout for asynchronous operations. +* +*/ + +#include +#include +#include +#include + + +/* This class is used to notify the observer +* about the timeout +*/ +class MTimeoutObserver +{ + public: // New functions + + /** + * Timeout + */ + virtual void HandleTimeout(TInt error) = 0; +}; + + +_LIT(KFormatTimeStamp, "%:0%J%:1%T%:2%S%.%*C4%:3%+B"); + + +/* This class is used for extra time controlling +* The STIF timeout isn't enough +*/ +class CSimpleTimeout : public CActive +{ + public: // Enumerations + // None + + private: // Enumerations + // None + + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CSimpleTimeout* NewL( MTimeoutObserver* aObserver, CStifLogger* aLogger); + + /** + * Destructor. + */ + ~CSimpleTimeout(); + + public: // New functions + + /** + * Starts timeout counting + */ + void Start(TTimeIntervalMicroSeconds aTimeout); + + /** + * Cancel timeout counting + */ + void Stop(); + + + public: // Functions from base classes + + /** + * RunL derived from CActive handles the completed requests. + */ + void RunL(); + + /** + * DoCancel derived from CActive handles the cancel + */ + void DoCancel(); + + /** + * RunError derived from CActive handles errors from active handler. + */ + TInt RunError( TInt aError ); + + protected: // New functions + // None + + protected: // Functions from base classes + // None + + private: + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(MTimeoutObserver* aObserver, CStifLogger* aLogger); + + /** + * C++ constructor. + */ + CSimpleTimeout(); + + public: // Data + // None + + protected: // Data + // None + + private: // Data + MTimeoutObserver* iObserver; + RTimer iTimer; + + // Storage for testcase timeout. + TTime iTestCaseTimeout; + CStifLogger* iLog; + + public: // Friend classes + // None + + protected: // Friend classes + // None + + private: // Friend classes + // None + +}; diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2002 - 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 testplugins subsystem +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +#include "../testcollectionplugin/group/bld.inf" +#include "../testplaybackplugin/group/bld.inf" + +PRJ_MMPFILES + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/inc/testcollectionplugintype.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/inc/testcollectionplugintype.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2002 - 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: define collection collection plugin type enum +* +*/ + +#ifndef TESTCOLLECTIONPLUGINTYPE_H +#define TESTCOLLECTIONPLUGINTYPE_H + +#include "testcommonpluginuids.h" + +// Collection Plugin Test Types. +// +enum TCollectionTestPluginType + { + ECollectionTestPluginType = KCollectionTestPluginType, + ECollectionTestPluginType2 = KCollectionTestPluginType2, + ECollectionTestPluginType3 = KCollectionTestPluginType3 + }; + + +#endif // TESTCOLLECTIONPLUGINTYPE_H diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/inc/testcommonpluginuids.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/inc/testcommonpluginuids.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2002 - 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: define commonly used uids +* +*/ + +#ifndef TESTCOMMONPLUGINUIDS_H +#define TESTCOMMONPLUGINUIDS_H + +#define KCollectionTestPlugin 0xE0000101 // dll uid +#define KCollectionTestPluginImpId 0xE0000102 // implementation uid +#define KCollectionTestPluginType 0xE0000103 // refer TCollectionTestPluginType +#define KCollectionTestPlugin2 0xE0000111 // dll uid +#define KCollectionTestPluginImpId2 0xE0000112 // implementation uid +#define KCollectionTestPluginType2 0xE0000113 // refer TCollectionTestPluginType +#define KCollectionTestPlugin3 0xE0000121 // dll uid +#define KCollectionTestPluginImpId3 0xE0000122 // implementation uid +#define KCollectionTestPluginType3 0xE0000123 // refer TCollectionTestPluginType + +#define KPlaybackTestPlugin 0xE0000201 // dll uid +#define KPlaybackTestPluginImpId 0xE0000202 // implementation uid +#define KPlaybackTestPluginType 0xE0000203 // refer TPlaybackTestPluginType +#define KPlaybackTestPlugin2 0xE0000211 // dll uid +#define KPlaybackTestPluginImpId2 0xE0000212 // implementation uid +#define KPlaybackTestPluginType2 0xE0000213 // refer TPlaybackTestPluginType +#define KPlaybackTestPlugin3 0xE0000221 // dll uid +#define KPlaybackTestPluginImpId3 0xE0000222 // implementation uid +#define KPlaybackTestPluginType3 0xE0000223 // refer TPlaybackTestPluginType + +#define KViewTestPlugin 0xE0000301 // dll uid +#define KViewTestPluginImpId 0xE0000302 // implementation uid +#define KViewTestPluginType 0xE0000303 + +#define KViewTestPlugin2 0xE0000304 // dll uid +#define KViewTestPlugin2ImpId 0xE0000305 // implementation uid +#define KViewTestPluginType2 0xE0000306 + +#define KViewTestPlugin3 0xE0000307 // dll uid +#define KViewTestPlugin3ImpId 0xE0000308 // implementation uid +#define KViewTestPluginType3 0xE0000309 + +#define KViewTestPlugin4 0xE000030A // dll uid +#define KViewTestPlugin4ImpId 0xE000030B // implementation uid +#define KViewTestPluginType4 0xE000030C +#define KViewTestPlugin4BetterMatch 0xE000030D // dll uid +#define KViewTestPlugin4BetterMatchImpId 0xE000030E // implementation uid +#define KViewTestPlugin4BetterMatchCriteria 0xE000030F + +#define KViewTestPlugin5Low 0xE0000311 // dll uid +#define KViewTestPlugin5LowImpId 0xE0000312 // implementation uid +#define KViewTestPluginType5 0xE0000313 +#define KViewTestPlugin5High 0xE0000314 // dll uid +#define KViewTestPlugin5HighImpId 0xE0000315 // implementation uid + +#define KViewTestPlugin6 0xE0000317 // dll uid +#define KViewTestPlugin6ImpId 0xE0000318 // implementation uid +#define KViewTestPluginType6 0xE0000319 + + +#define KPlaylistTestPluginM3u 0xE000031A // dll uid +#define KPlaylistTestPluginM3uImpId 0xE000031B // implementation uid + +#endif // TESTCOMMONPLUGINUIDS_H + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/inc/testplaybackplugintype.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/inc/testplaybackplugintype.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2002 - 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: define playback plugin type enum +* +*/ + +#ifndef TESTPLAYBACKPLUGINTYPE_H +#define TESTPLAYBACKPLUGINTYPE_H + +#include "testcommonpluginuids.h" + +// Collection Plugin Test Types. +// +enum TPlaybackTestPluginType + { + EPlaybackTestPluginType = KPlaybackTestPluginType, + EPlaybackTestPluginType2 = KPlaybackTestPluginType2, + EPlaybackTestPluginType3 = KPlaybackTestPluginType3 + }; + + +#endif // TESTPLAYBACKPLUGINTYPE_H + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/inc/testviewplugintype.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/inc/testviewplugintype.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2002 - 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: define view plugin type enum +* +*/ + +#ifndef TESTVIEWPLUGINTYPE_H +#define TESTVIEWPLUGINTYPE_H + +#include "testcommonpluginuids.h" + +// View Plugin Test Types. +// +enum TViewTestPluginType + { + EViewPluginTypeTest = KViewPluginTypeTest, + EViewPluginTypeTest2 = KViewPluginTypeTest2, + EViewPluginTypeTest3 = KViewPluginTypeTest3, + EViewPluginTypeTest4 = KViewPluginTypeTest4, + EViewPluginTypeTest5 = KViewPluginTypeTest5, + EViewPluginTypeTest6 = KViewPluginTypeTest6 + }; + +enum TViewTestPluginMatchCriteria + { + EViewPluginMatchCriteria4 = KViewTestPlugin4BetterMatchCriteria + }; + +#endif // TESTVIEWPLUGINTYPE_H diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/data/e0000101.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/data/e0000101.rss Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2002 - 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: Resource file +* +*/ + +#include +#include +#include "testcommonpluginuids.h" +#include "testcollectionplugintype.h" + +/** + * The opaque_data syntax is made up of three parts: + * a list of Uids for resolving the view plugin, feature flags, priority. + * + *

uid1;uid2;uid3

+ * uid*: Supported plugin types. + * E.g. if podcast plugin may support music plugin as well, KMPXColPluginMusic + * + * uid + * uid: plugin type uid. + * E.g. for music plugin will be: 0x101FFCDA + * + * flags [optional] + * flags: sum of the required feature flags, not used now + * + * priority [optional] + * priority: a value of type TMPXCollectionPluginPriorities. This value determines + * the returning order when several plugins can support the same set of Uids. + * Default value of this field is EMPXCollectionPluginPriorityal. + */ + +RESOURCE REGISTRY_INFO theInfo + { + dll_uid = KCollectionTestPlugin; + + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMPXCollectionPluginInterfaceUid; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KCollectionTestPluginImpId; + version_no = 1; + display_name = "TestCollectionPlugin"; + default_data = ""; + opaque_data = "*.ts;.tp" + ""ECollectionPluginTypeTest"" + "

"EMPXCollectionPluginTemporary"

" + ""EMPXCollectionPluginPriorityLow""; + } + }; + } + }; + } + +// End of file diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,28 @@ +/* +* Copyright (c) 2002 - 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 Collection test plugin +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +testcollectionplugin.mmp + +PRJ_MMPFILES + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/group/testcollectionplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/group/testcollectionplugin.mmp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2002 - 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: Collection test plugin project specification +* +*/ + +#include +#include +#include + +#include "../../inc/testcommonpluginuids.h" + +TARGET collectiontestplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KCollectionTestPlugin + +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE testcollectionplugin.cpp +SOURCE testcollectionpluginproxy.cpp + +SOURCEPATH ../data +START RESOURCE e0000101.rss +TARGET testcollectionplugin.rsc +END + +USERINCLUDE ../inc +USERINCLUDE ../../inc +USERINCLUDE ../../../testviewframework/inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY BAFL.lib +LIBRARY flogger.lib +LIBRARY mpxcommon.lib + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/inc/testcollectionplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/inc/testcollectionplugin.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,228 @@ +/* +* Copyright (c) 2002 - 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 testcollectionplugin interface +* +*/ + +#ifndef TESTCOLLECTIONPLUGIN_H +#define TESTCOLLECTIONPLUGIN_H + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CMPXMedia; +class CMPXMediaArray; + +// CONSTANTS + +// CLASS DECLARATION + +/** +* CCollectionTestPlugin class +* +*/ +NONSHARABLE_CLASS(CTestCollectionPlugin) : public CMPXCollectionPlugin + { +public: // Constructors and destructor + + /** + * Two-phased constructor + * @param aInitParams: initialization parameters + * @return: object constructed + */ + static CTestCollectionPlugin* NewL (TAny* aInitParams); + + /** + * Destructor + */ + virtual ~CTestCollectionPlugin(); + +public: // from base clase + /** + * From CMPXCollectionPlugin + * Navigates to the given path + * @param aPath: a path + * @param aAttrs, attributes requested + * @param aFilter, filter to apply or NULL if none + */ + void OpenL(const CMPXCollectionPath& aPath, + const TArray& aAttrs, + CMPXFilter* aFilter); + + /** + * From CMPXCollectionPlugin + * Get the extended properties of the current file (async) + * @param aPath: a path + * @param aAttrs: array of attributes requested + * @param aCaps platsec capabilities of client requesting media; plug-in should also + * verify its process capabilities + * @aParam aSpecs, specifications for attributes + */ + void MediaL(const CMPXCollectionPath& aPath, + const TArray& aAttrs, + const TArray& aCaps, + CMPXAttributeSpecs* aSpecs); + + /** + * From CMPXCollectionPlugin + * Cancel outstanding request + */ + void CancelRequest (); + + /** + * From CMPXCollectionPlugin + * Executes the given command on the collection + * @param aCmd: a command + * @param aArg: a Argument + */ + void CommandL (TMPXCollectionCommand aCmd, TInt aArg); + + /** + * From CMPXCollectionPlugin + * Executes a command + * + * @param aCmd a command + */ + void CommandL(CMPXCommand& aCmd); + + /** + * From CMPXCollectionPlugin + * Adds an item (song or playlist) to the collection + * @param aMedia: Properties of the item + */ + void AddL (const CMPXMedia& aMedia); + + /** + * From CMPXCollectionPlugin + * Remove an item from the collection database using the given path + * Note that the selection indicies are hidden within the path + * @param aPath: path to the item to be removed + * + */ + void RemoveL (const CMPXCollectionPath& aPath); + + /** + * From CMPXCollectionPlugin + * Remove an item from the collection database using the given media properties + * @param aMedia: Properties of the item that is to be removed. It may cantain URI only + * or meta data, all of items matched properties will be removed. + */ + void RemoveL (const CMPXMedia& aMedia); + + /** + * From CMPXCollectionPlugin + * Sets/updates the media for an item in the collection + * @param aMedia: new property values for the item + */ + void SetL (const CMPXMedia& aMedia); + + /** + * From CMPXCollectionPlugin + * Find the items matching the media specifications + * @param aCriteria: Properties of the item that is to be found + * @param aAttrs: Requested attributes to return + */ + void FindAllL (const CMPXMedia& aCriteria, const TArray& aAttrs); + + /** + * From CMPXCollectionPlugin + * Find the items matching the media specifications + * @param aCriteria: Properties of the item that is to be found + * @param aAttrs: Requested attributes to return + * @return results of the search + */ + CMPXMedia* FindAllSyncL(const CMPXMedia& aCriteria, + const TArray& aAttrs); + + /** + * From CMPXCollectionPlugin + * Get the list of supported capabilities + * @return: TCollectionCapability, bitmask of supported capabilities + */ + TCollectionCapability GetCapabilities (); + +private: + /** + * Constructor + */ + CTestCollectionPlugin (); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL (); + + /** + * Append media into aMediaArray base on aIdArray Info + */ + void AddMediaL(CMPXMediaArray& aMediaArray, + const RArray aIdArray, + const TArray& aAttrs); + + /** + * Add specify attribute to Media + */ + void AddAttrbuteL(CMPXMedia& aMedia, + const TInt aId, + const TDesC& aTitle, + const TDesC& aUri, + const TArray& aAttrs); + + /** + * Add specify attribute to Media specific for Playback framework + * test cases + */ + void AddAttributePlaybackFwTestL(CMPXMedia& aMedia, + const TInt aId, + const TArray& aAttrs); + /** + * Filter out media in aMediaArray which match any one attribute in aFilter + */ + void FilterMediaArray(CMPXMediaArray& aMediaArray, CMPXFilter* aFilter); + + /** + * Fill up media with change message + */ + void FillItemChangeMessageL(CMPXMessage& aMessage, + TMPXItemId aId, + TMPXChangeEventType aChangeType, + TMPXGeneralCategory aCategory); + + /** + * Adding specific attribute + */ + void AddAttributeGeneralTypeL(CMPXMedia& aMedia, const TInt aId); + void AddAttributeGeneralCategoryL(CMPXMedia& aMedia, const TInt aId); + void AddAttributeGeneralDurationL(CMPXMedia& aMedia, const TInt aId); + void AddAttributeGeneralLastPlaybackPositionL(CMPXMedia& aMedia, const TInt aId); + void AddAttributeMusicArtistL(CMPXMedia& aMedia, const TInt aId); + void AddAttributeDrmTypeL(CMPXMedia& aMedia, const TInt aId); + void AddAttributeDrmProtectedL(CMPXMedia& aMedia, const TInt aId); + void AddAttributeDrmRightsStatusL(CMPXMedia& aMedia, const TInt aId); + +private: // data + }; + +#endif // TESTCOLLECTIONPLUGIN_H + + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/src/testcollectionplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/src/testcollectionplugin.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,1289 @@ +//* +* Copyright (c) 2002 - 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 collection test plugin interface +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "testcommonpluginuids.h" +#include "testcollectionplugin.h" + +// CONSTANTS +_LIT(KFolder, "mpxt"); +_LIT(KFile, "CFwCollection.txt"); + +#define LOG1(a) RFileLogger::Write(KFolder, KFile, EFileLoggingModeAppend, a) +#define LOG2(a,b) RFileLogger::WriteFormat(KFolder, KFile, EFileLoggingModeAppend, a, b) +#define LOG3(a,b,c) RFileLogger::WriteFormat(KFolder, KFile, EFileLoggingModeAppend, a, b, c) +#define LOG4(a,b,c,d) RFileLogger::WriteFormat(KFolder, KFile, EFileLoggingModeAppend, a, b, c,d) + + +// =========================================== LOCAL FUNCTIONS ============================================== +// print out (index, id) for each level and the first 15 ids at top level +LOCAL_C void LogPath( const CMPXCollectionPath& aPath )\ + { + TInt levels = aPath.Levels(); + TInt count = aPath.Count(); + LOG3(_L("Collection Path debug: levels= %d, count = %d"), levels, count); + for (TInt i=0; i 0) + { + TInt index = aPath.Index(); + CMPXCollectionPath* dpath = const_cast(&aPath); + dpath->SetToFirst(); + TInt c = 0; + do + { + LOG3(_L("Collection Path debug top level: item %d = id 0x%08x"), c, dpath->Id()); + } while (++(*dpath) && ++c < 15 ); + dpath->Set(index); + } + } + + +// =========================================== MEMBER FUNCTIONS ============================================= +// ---------------------------------------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------------------------------------- +// +CTestCollectionPlugin* CTestCollectionPlugin::NewL (TAny* /*aInitParams*/) + { + CTestCollectionPlugin* self = new (ELeave) CTestCollectionPlugin(); + CleanupStack::PushL (self); + self->ConstructL (); + CleanupStack::Pop (self); + return self; + } + +// ---------------------------------------------------------------------------------------------------------- +// Destructor. +// ---------------------------------------------------------------------------------------------------------- +// +CTestCollectionPlugin::~CTestCollectionPlugin () + { + } + +// ---------------------------------------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------------------------------------- +// +CTestCollectionPlugin::CTestCollectionPlugin () + { + } + +// ---------------------------------------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::ConstructL () + { + } + +// ---------------------------------------------------------------------------------------------------------- +// Navigates to the given path +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::OpenL(const CMPXCollectionPath& aPath, + const TArray& aAttrs, + CMPXFilter* aFilter) + { + LOG1(_L("CTestCollectionPlugin::OpenL")); + LogPath( aPath ); + TMPXOpenMode openMode = aPath.OpenNextMode(); + TInt idIndex = aPath.Levels() - 1; + LOG2(_L("TMPXOpendMode=%d"), openMode); + LOG2(_L("aFilter=%x"), aFilter); + + RArray supportedIds; + CleanupClosePushL(supportedIds); + supportedIds.AppendL(KMPXMediaIdContainer); + supportedIds.AppendL(KMPXMediaIdGeneral); + + CMPXMedia* entries = CMPXMedia::NewL(supportedIds.Array()); + CleanupStack::PopAndDestroy(&supportedIds); + CleanupStack::PushL(entries); + entries->SetTObjectValueL(TMPXAttribute(KMPXMediaIdGeneral,EMPXMediaGeneralId), aPath.Id(idIndex)); + + if(aPath.Levels() == 1) + { + // Plugin's root level + RArray ids; + CleanupClosePushL( ids ); + ids.Append( 11 ); + ids.Append( 12 ); + ids.Append( 13 ); + ids.Append( 990 ); // for Playback Framework Test + RArray attrs; + CleanupClosePushL( attrs ); + attrs.Append( KMPXMediaGeneralId ); + attrs.Append( KMPXMediaGeneralUri ); + attrs.Append( KMPXMediaGeneralTitle ); + + CMPXMediaArray* array=CMPXMediaArray::NewL(); + CleanupStack::PushL( array ); + + const TArray& tempRef = aAttrs.Count() == 0? attrs.Array() : aAttrs; + AddMediaL(*array, ids, tempRef); + FilterMediaArray(*array, aFilter); + + entries->SetCObjectValueL (TMPXAttribute(KMPXMediaIdContainer,EMPXMediaArrayContents),array); + entries->SetTObjectValueL (TMPXAttribute(KMPXMediaIdContainer,EMPXMediaArrayCount),array->Count()); + + iObs->HandleOpen (entries, KErrNone); + CleanupStack::PopAndDestroy(3, &ids); // attrs, array, ids + } + else if(aPath.Levels() == 2) + { + // Opening plugin's root menu + TInt topLevId = aPath.Id(1); + RArray ids; + CleanupClosePushL( ids ); + RArray attrs; + CleanupClosePushL( attrs ); + CMPXMediaArray* array=CMPXMediaArray::NewL(); + CleanupStack::PushL( array ); + + attrs.Append( KMPXMediaGeneralId ); + attrs.Append( KMPXMediaGeneralUri ); + attrs.Append( KMPXMediaGeneralTitle ); + if(topLevId == 11) + { + ids.Append( 211 ); + ids.Append( 212 ); + ids.Append( 213 ); + } + else if(topLevId == 12) + { + ids.Append( 221 ); + } + else if(topLevId == 13) + { + ids.Append( 231 ); + ids.Append( 232 ); + } + else if(topLevId == 990) + { + ids.Append( 9901 ); + ids.Append( 9902 ); + ids.Append( 9903 ); + ids.Append( 9904 ); + ids.Append( 9905 ); + ids.Append( 9906 ); + ids.Append( 9907 ); + } + const TArray& tempRef = aAttrs.Count() == 0? attrs.Array() : aAttrs; + AddMediaL(*array, ids, tempRef); + FilterMediaArray(*array, aFilter); + + entries->SetCObjectValueL (TMPXAttribute(KMPXMediaIdContainer,EMPXMediaArrayContents),array); + entries->SetTObjectValueL (TMPXAttribute(KMPXMediaIdContainer,EMPXMediaArrayCount),array->Count()); + + iObs->HandleOpen (entries, KErrNone); + CleanupStack::PopAndDestroy(3, &ids); // attrs, array, ids + } + else if(aPath.Levels() == 3) + { + // Opening plugin's 2nd + TInt secLevId = aPath.Id(2); + + RArray ids; + CleanupClosePushL( ids ); + RArray attrs; + CleanupClosePushL( attrs ); + CMPXMediaArray* array=CMPXMediaArray::NewL(); + CleanupStack::PushL( array ); + + attrs.Append( KMPXMediaGeneralId ); + attrs.Append( KMPXMediaGeneralUri ); + attrs.Append( KMPXMediaGeneralTitle ); + switch( secLevId ) + { + case 211: + ids.Append( 3111 ); + break; + case 212: + ids.Append( 3121 ); + break; + case 213: + ids.Append( 3131 ); + break; + case 221: + // Empty + break; + case 231: + ids.Append( 3311 ); + break; + case 232: + ids.Append( 3321 ); + break; + }; + const TArray& tempRef = aAttrs.Count() == 0? attrs.Array() : aAttrs; + AddMediaL(*array, ids, tempRef); + FilterMediaArray(*array, aFilter); + + entries->SetCObjectValueL (TMPXAttribute(KMPXMediaIdContainer,EMPXMediaArrayContents),array); + entries->SetTObjectValueL (TMPXAttribute(KMPXMediaIdContainer,EMPXMediaArrayCount),array->Count()); + + iObs->HandleOpen (entries, KErrNone); + CleanupStack::PopAndDestroy(3, &ids); // attrs, array, ids + } + else + { + User::Leave( KErrNotFound ); + } + CleanupStack::PopAndDestroy( entries ); + } + +// ---------------------------------------------------------------------------------------------------------- +// Get the extended properties of the current file (async) +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::MediaL (const CMPXCollectionPath& aPath, + const TArray& aAttrs, + const TArray& aCaps, + CMPXAttributeSpecs* aSpecs) + { + LOG1(_L("CTestCollectionPlugin::MediaL")); + LogPath( aPath ); + TMPXOpenMode openMode = aPath.OpenNextMode(); + //TInt idIndex = aPath.Levels() - 1; + LOG2(_L("TMPXOpendMode=%d"), openMode); + LOG2(_L("aAttrs.Count()=%d"), aAttrs.Count()); + LOG2(_L("aCaps.Count()=%d"), aCaps.Count()); + LOG2(_L("aSpecs=0x%x"), aSpecs); + + switch( (TInt)aPath.Id(1) ) + { + case 14: // Test0146 + { + iObs->HandleMedia(NULL, KErrNone); + break; + } + case 15: // Test0147 + { + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + iObs->HandleMedia(media, KErrNone); + CleanupStack::PopAndDestroy( media ); + break; + } + case 16: // Test0148 + { + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + iObs->HandleMedia(media, KErrNotFound); + CleanupStack::PopAndDestroy( media ); + break; + } + case 17: // Test0149 + { + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + (*media) = *aSpecs; + iObs->HandleMedia(media, KErrNone); + CleanupStack::PopAndDestroy( media ); + break; + } + case 990: // Test data for playback framework teests + { + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + + switch( (TInt)aPath.Id(2) ) + { + case 9901: + AddAttrbuteL(*media, 9901, _L("song9901"), _L("\\song9901.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9901, aAttrs); + break; + case 9902: + AddAttrbuteL(*media, 9902, _L("song9902"), _L("\\song9902.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9902, aAttrs); + break; + case 9903: + AddAttrbuteL(*media, 9903, _L("song9903"), _L("\\song9903.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9903, aAttrs); + break; + case 9904: + AddAttrbuteL(*media, 9904, _L("song9904"), _L("\\song9904.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9904, aAttrs); + break; + case 9905: + AddAttrbuteL(*media, 9905, _L("song9905"), _L("\\song9905.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9905, aAttrs); + break; + case 9906: + AddAttrbuteL(*media, 9906, _L("song9906"), _L("\\song9906.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9906, aAttrs); + break; + case 9907: + AddAttrbuteL(*media, 9907, _L("song9907"), _L("\\song9907.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9907, aAttrs); + break; + }; + iObs->HandleMedia(media, KErrNone); + CleanupStack::PopAndDestroy( media ); + break; + } + default: + User::Leave( KErrNotFound ); + }; + } + +// ---------------------------------------------------------------------------------------------------------- +// Cancel outstanding request +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::CancelRequest() + { + LOG1(_L("CTestCollectionPlugin::CancelRequest")); + } + +// ---------------------------------------------------------------------------------------------------------- +// Executes the given command on the collection +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::CommandL(TMPXCollectionCommand aCmd, TInt aArg ) + { + LOG1(_L("CTestCollectionPlugin::CommandL")); + LOG3(_L("TMPXCollectionCommand=%d; aArg=%d"), aCmd, aArg); + switch( aCmd ) + { + case EMcCmdClose: + LOG1( _L("McCmdClose command received")); + break; + case EMcCmdRefresh: + LOG1( _L("EMcCmdRefresh command received")); + break; + case EMcCmdRemoveAll: + LOG1( _L("EMcCmdRemoveAll command received")); + break; + case EMcCloseCollection: + LOG1( _L("EMcCloseCollection command received")); + break; + case EMcReOpenCollection: + LOG1( _L("EMcReOpenCollection command received")); + break; + case EMcRefreshStarted: + LOG1( _L("EMcRefreshStarted command received")); + break; + case EMcRefreshEnded: + LOG1( _L("EMcRefreshEnded command received")); + break; + case EMcCmdReCreateDB: + LOG1( _L("EMcCmdReCreateDB command received")); + break; + case EMcCmdSelect: + LOG1( _L("EMcCmdSelect command received")); + break; + case EMcCmdDbCorrupted: + LOG1( _L("EMcCmdDbCorrupted command received")); + break; + case EMcCmdCollectionInit: + LOG1( _L("EMcCmdCollectionInit command received")); + break; + case EMcCmdCollectionResyn: + LOG1( _L("EMcCmdCollectionResyn command received")); + break; + default: + break; + }; + } + +// ---------------------------------------------------------------------------------------------------------- +// Executes the given command on the collection +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::CommandL(CMPXCommand& aCmd) + { + LOG1(_L("CTestCollectionPlugin::CommandL")); + const TDesC& title = aCmd.ValueText( KMPXMediaGeneralTitle ); + TMPXCommandId cmdId = aCmd.ValueTObjectL(KMPXCommandGeneralId); + LOG2(_L("CommandId = %d"), cmdId); + + if(title == _L("CollectionPluginTest0175") ) + { + } + else if(title == _L("CollectionPluginTest0176") ) + { + iObs->HandleCommandComplete(NULL, KErrNone); + } + else if(title == _L("CollectionPluginTest0177") ) + { + iObs->HandleCommandComplete(NULL, KErrGeneral); + } + else if(title == _L("CollectionPluginTest0183") ) + { + } + else if(title == _L("CollectionPluginTest0184") ) + { + CMPXCommand* newCmd = CMPXCommand::NewL(); + CleanupStack::PushL( newCmd ); + *newCmd = aCmd; + iObs->HandleCommandComplete(newCmd, KErrNone); + CleanupStack::PopAndDestroy( newCmd ); + } + else + { + TBool syncOp(EFalse); + if( aCmd.IsSupported(KMPXCommandGeneralDoSync) ) + { + syncOp = *aCmd.Value(KMPXCommandGeneralDoSync); + } + + switch( cmdId ) + { + case KMPXCommandIdCollectionRetrieveUriForDeletion: + { // TODO + LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionRetrieveUriForDeletion")); + //DoRetrieveUriForDeletionL(aCmd); + break; + } + case KMPXCommandIdCollectionRemove: + { + LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionRemove")); + //DoRemovePathL(aCmd); + break; + } + case KMPXCommandIdCollectionRemoveMedia: + { + LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionRemoveMedia")); + //DoRemoveMediaL(aCmd); + break; + } + case KMPXCommandIdCollectionCleanupDeletedMedias: + { + LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionCleanupDeletedMedias")); + //DoCleanupDeletedMediasL(aCmd); + break; + } + case KMPXCommandIdCollectionAdd: + { + LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectioAdd")); + + CMPXMedia& media = *aCmd.Value(KMPXCommandColAddMedia); + AddL(media); + break; + } + case KMPXCommandIdCollectionSet: + { + LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionSet")); + + CMPXMedia& media = *aCmd.Value(KMPXCommandColSetMedia); + SetL( media ); + break; + } + case KMPXCommandIdCollectionCompleteDelete: + { + LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionCompleteDelete")); + //DoHandleDeleteCompleteL( aCmd ); + break; + } + default: + { + User::Panic(_L("CTestCollectionPlugin::CommandL panic"), 1); // magic number + } + } + if (!syncOp) + { + iObs->HandleCommandComplete( NULL, KErrNone ); + } + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Adds an item (song or playlist) to the collection +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddL (const CMPXMedia& aMedia) + { + LOG1(_L("CTestCollectionPlugin::AddL")); + CMPXMessage* message = CMPXMessage::NewL(); + CleanupStack::PushL( message ); + + const TDesC& title = aMedia.ValueText( KMPXMediaGeneralTitle ); + + if(title == _L("CollectionPluginTest0078") ) + { + FillItemChangeMessageL(*message, 78, EMPXItemInserted, EMPXOther); + } + else if(title == _L("CollectionPluginTest0079")) + { + FillItemChangeMessageL(*message, 79, EMPXItemInserted, EMPXSong); + } + else if(title == _L("CollectionPluginTest0080")) + { + FillItemChangeMessageL(*message, 80, EMPXItemInserted, EMPXPlaylist); + } + else + { + User::Panic(_L("CTestCollectionPlugin::AddL panic"), 1); // magic number + } + iObs->HandleMessage( *message ); + CleanupStack::PopAndDestroy( message ); + } + +// ---------------------------------------------------------------------------------------------------------- +// Remove an item from the collection database using the given path +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::RemoveL (const CMPXCollectionPath& aPath) + { + LOG1(_L("CTestCollectionPlugin::RemoveL")); + LogPath( aPath ); + CDesCArrayFlat* fp = new (ELeave) CDesCArrayFlat(8); + CleanupStack::PushL( fp ); + switch( aPath.Levels() ) + { + case 2: + if(aPath.Id() == 14) + { // Test0091 + iObs->HandleRemove( *fp, KErrNotFound ); + } + break; + case 3: + if(aPath.Id() == 212) + { // Test0090 + fp->AppendL( _L("\\song3121.ts") ); + fp->AppendL( _L("\\song3122.ts") ); + fp->AppendL( _L("\\song3123.tp") ); + iObs->HandleRemove( *fp, KErrNone ); + } + break; + case 4: + if(aPath.Id() == 3111) + { // Test0088 + fp->AppendL( _L("\\song3111.ts") ); + iObs->HandleRemove( *fp, KErrNone ); + } + break; + default: + User::Panic(_L("CTestCollectionPlugin::RemoveL panic"), 1); // magic number + } + CleanupStack::PopAndDestroy( fp ); + } + +// ---------------------------------------------------------------------------------------------------------- +// Remove an item from the collection database using the given media properties +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::RemoveL (const CMPXMedia& aMedia) + { + LOG1(_L("CTestCollectionPlugin::RemoveL")); + const TDesC& title = aMedia.ValueText( KMPXMediaGeneralTitle ); + + // a list of change event messages a result of the item being removed + CMPXMessageArray* itemChangedMessages = CMPXMessageArray::NewL(); + CleanupStack::PushL(itemChangedMessages); + + if(title == _L("CollectionPluginTest0099") ) + { + CMPXMessage* message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + FillItemChangeMessageL(*message, 99, EMPXItemDeleted, EMPXSong); + itemChangedMessages->AppendL( *message ); + CleanupStack::PopAndDestroy(message); + } + else if(title == _L("CollectionPluginTest0100") ) + { + CMPXMessage* message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + FillItemChangeMessageL(*message, 100, EMPXItemDeleted, EMPXSong); + itemChangedMessages->AppendL( *message ); + CleanupStack::PopAndDestroy(message); + message = NULL; + message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + FillItemChangeMessageL(*message, 100, EMPXItemDeleted, EMPXSong); + itemChangedMessages->AppendL( *message ); + CleanupStack::PopAndDestroy(message); + } + else + { + User::Panic(_L("CTestCollectionPlugin::RemoveL panic"), 1); // magic number + } + + CMPXMessage* message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + + message->SetTObjectValueL( + TMPXAttribute(KMPXMessageContentIdGeneral, EMPXMessageGeneralId), KMPXMessageIdItemChanged); + message->SetCObjectValueL( + TMPXAttribute(KMPXMessageIdContainer, EMPXMessageArrayContents), itemChangedMessages); + message->SetTObjectValueL( + TMPXAttribute(KMPXMessageIdContainer, EMPXMessageArrayCount), itemChangedMessages->Count()); + + iObs->HandleMessage( *message ); + CleanupStack::PopAndDestroy(2, itemChangedMessages); // message, itemChangedMessages + } + +// ---------------------------------------------------------------------------------------------------------- +// Sets/updates the media for an item in the collection +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::SetL (const CMPXMedia& aMedia) + { + LOG1(_L("CTestCollectionPlugin::SetL")); + const TDesC& title = aMedia.ValueText( KMPXMediaGeneralTitle ); + + // a list of change event messages a result of the item being removed + CMPXMessageArray* itemChangedMessages = CMPXMessageArray::NewL(); + CleanupStack::PushL(itemChangedMessages); + + if(title == _L("CollectionPluginTest0108") ) + { + CMPXMessage* message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + FillItemChangeMessageL(*message, 108, EMPXItemModified, EMPXSong); + itemChangedMessages->AppendL( *message ); + CleanupStack::PopAndDestroy(message); + } + else if(title == _L("CollectionPluginTest0109") ) + { + CMPXMessage* message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + FillItemChangeMessageL(*message, 109, EMPXItemModified, EMPXSong); + itemChangedMessages->AppendL( *message ); + CleanupStack::PopAndDestroy(message); + message = NULL; + message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + FillItemChangeMessageL(*message, 109, EMPXItemModified, EMPXSong); + itemChangedMessages->AppendL( *message ); + CleanupStack::PopAndDestroy(message); + } + else if(title == _L("CollectionPluginTest0119") ) + { + CMPXMessage* message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + FillItemChangeMessageL(*message, 119, EMPXItemModified, EMPXSong); + itemChangedMessages->AppendL( *message ); + CleanupStack::PopAndDestroy(message); + } + else if(title == _L("CollectionPluginTest0120") ) + { + CMPXMessage* message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + FillItemChangeMessageL(*message, 120, EMPXItemModified, EMPXSong); + itemChangedMessages->AppendL( *message ); + CleanupStack::PopAndDestroy(message); + message = NULL; + message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + FillItemChangeMessageL(*message, 120, EMPXItemModified, EMPXSong); + itemChangedMessages->AppendL( *message ); + CleanupStack::PopAndDestroy(message); + } + else + { + // Playback Framework may call this function + //User::Panic(_L("CTestCollectionPlugin::SetL panic"), 1); // magic number + } + + CMPXMessage* message = CMPXMessage::NewL(); + CleanupStack::PushL(message); + + message->SetTObjectValueL( + TMPXAttribute(KMPXMessageContentIdGeneral, EMPXMessageGeneralId), KMPXMessageIdItemChanged); + message->SetCObjectValueL( + TMPXAttribute(KMPXMessageIdContainer, EMPXMessageArrayContents), itemChangedMessages); + message->SetTObjectValueL( + TMPXAttribute(KMPXMessageIdContainer, EMPXMessageArrayCount), itemChangedMessages->Count()); + + iObs->HandleMessage( *message ); + CleanupStack::PopAndDestroy(2, itemChangedMessages); // message, itemChangedMessages + } + +// ---------------------------------------------------------------------------------------------------------- +// Find the items matching the media specifications +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::FindAllL(const CMPXMedia& aCriteria, const TArray& aAttrs) + { + LOG1(_L("CTestCollectionPlugin::FindAllL")); + const TDesC& title = aCriteria.ValueText( KMPXMediaGeneralTitle ); + if(title == _L("CollectionPluginTest0128") || + title == _L("CollectionPluginTest0129") ) + { + // Return exact copy + CMPXMedia* media = CMPXMedia::NewL(); + (*media) = aCriteria; + CleanupStack::PushL( media ); + media->SetTObjectValueL(KMPXMediaGeneralSize, aAttrs.Count()); + iObs->HandleFindAll(media, KErrNone); + CleanupStack::PopAndDestroy( media ); + } + else if(title == _L("CollectionPluginTest0130") ) + { + // Return error + CMPXMedia* media = CMPXMedia::NewL(); + (*media) = aCriteria; + CleanupStack::PushL( media ); + media->SetTObjectValueL(KMPXMediaGeneralSize, aAttrs.Count()); + iObs->HandleFindAll(media, KErrArgument); + CleanupStack::PopAndDestroy( media ); + } + else + { + User::Panic(_L("CTestCollectionPlugin::FindAllL panic"), 1); // magic number + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Find the items matching the media specifications +// ---------------------------------------------------------------------------------------------------------- +// +CMPXMedia* CTestCollectionPlugin::FindAllSyncL(const CMPXMedia& aCriteria, const TArray& aAttrs) + { + LOG1(_L("CTestCollectionPlugin::FindAllSyncL")); + const TDesC& title = aCriteria.ValueText( KMPXMediaGeneralTitle ); + CMPXMedia* media = NULL; + if(title == _L("CollectionPluginTest0138") || + title == _L("CollectionPluginTest0139")) + { + // Return exact copy + media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + (*media) = aCriteria; + media->SetTObjectValueL(KMPXMediaGeneralSize, aAttrs.Count()); + CleanupStack::Pop( media ); + } + else if(title == _L("CollectionPluginTest0140") ) + { + media = NULL; + } + else + { + User::Panic(_L("CTestCollectionPlugin::FindAllL panic"), 1); // magic number + } + return media; + } + +// ---------------------------------------------------------------------------------------------------------- +// Get the list of supported capabilities +// ---------------------------------------------------------------------------------------------------------- +// +TCollectionCapability CTestCollectionPlugin::GetCapabilities() + { + LOG1(_L("CTestCollectionPlugin::GetCapabilities - EMcNotModifiable")); + return EMcNotModifiable; + } + +// ---------------------------------------------------------------------------------------------------------- +// Add specify attribute to Media +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddMediaL(CMPXMediaArray& aMediaArray, + const RArray aIdArray, + const TArray& aAttrs) + { + TInt idCnt = aIdArray.Count(); + for(TInt i = 0; i < idCnt; i++) + { + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + switch( aIdArray[i] ) + { + case 11: + AddAttrbuteL(*media, 11, _L("level11"), KNullDesC, aAttrs); + break; + case 12: + AddAttrbuteL(*media, 12, _L("level12"), KNullDesC, aAttrs); + break; + case 13: + AddAttrbuteL(*media, 13, _L("level13"), KNullDesC, aAttrs); + break; + case 211: + AddAttrbuteL(*media, 211, _L("level211"), KNullDesC, aAttrs); + break; + case 212: + AddAttrbuteL(*media, 212, _L("level212"), KNullDesC, aAttrs); + break; + case 213: + AddAttrbuteL(*media, 213, _L("level213"), KNullDesC, aAttrs); + break; + case 221: + AddAttrbuteL(*media, 221, _L("level221"), KNullDesC, aAttrs); + break; + case 231: + AddAttrbuteL(*media, 231, _L("level231"), KNullDesC, aAttrs); + break; + case 232: + AddAttrbuteL(*media, 232, _L("level232"), KNullDesC, aAttrs); + break; + case 3111: + AddAttrbuteL(*media, 3111, _L("song3111"), _L("\\song3111.ts"), aAttrs); + break; + case 3121: + AddAttrbuteL(*media, 3121, _L("song3121"), _L("\\song3121.ts"), aAttrs); + break; + case 3131: + AddAttrbuteL(*media, 3131, _L("playlist3131"), _L("\\playlist3131.tp"), aAttrs); + break; + case 3311: + AddAttrbuteL(*media, 3311, _L("song3311"), _L("\\song3311.ts"), aAttrs); + break; + case 3321: + AddAttrbuteL(*media, 3321, _L("playlist3321"), _L("\\playlist3321.tp"), aAttrs); + break; + case 990: + AddAttrbuteL(*media, 990, _L("level990"), KNullDesC, aAttrs); + break; + case 9901: + AddAttrbuteL(*media, 9901, _L("song9901"), _L("\\song9901.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9901, aAttrs); + break; + case 9902: + AddAttrbuteL(*media, 9902, _L("song9902"), _L("\\song9902.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9902, aAttrs); + break; + case 9903: + AddAttrbuteL(*media, 9903, _L("song9903"), _L("\\song9903.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9903, aAttrs); + break; + case 9904: + AddAttrbuteL(*media, 9904, _L("song9904"), _L("\\song9904.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9904, aAttrs); + break; + case 9905: + AddAttrbuteL(*media, 9905, _L("song9905"), _L("\\song9905.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9905, aAttrs); + break; + case 9906: + AddAttrbuteL(*media, 9906, _L("song9906"), _L("\\song9906.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9906, aAttrs); + break; + case 9907: + AddAttrbuteL(*media, 9907, _L("song9907"), _L("\\song9907.ts"), aAttrs); + AddAttributePlaybackFwTestL(*media, 9907, aAttrs); + break; + }; + aMediaArray.AppendL( media ); + CleanupStack::Pop( media ); + } + } + + +// ---------------------------------------------------------------------------------------------------------- +// Add specify attribute to Media +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddAttrbuteL(CMPXMedia& aMedia, + const TInt aId, + const TDesC& aTitle, + const TDesC& aUri, + const TArray& aAttrs) + { + TInt attrCnt = aAttrs.Count(); + for(TInt i = 0; i < attrCnt; i++) + { + if(aAttrs[i].ContentId() == KMPXMediaIdGeneral) + { + TInt attrId = aAttrs[i].AttributeId(); + if(attrId & EMPXMediaGeneralId) + { + aMedia.SetTObjectValueL(KMPXMediaGeneralId, aId); + } + if(attrId & EMPXMediaGeneralTitle) + { + aMedia.SetTextValueL(KMPXMediaGeneralTitle, aTitle); + + } + if(attrId & EMPXMediaGeneralUri) + { + aMedia.SetTextValueL(KMPXMediaGeneralUri, aUri); + } + } + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Add specify attribute to Media specific for Playback framework +// test cases +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddAttributePlaybackFwTestL(CMPXMedia& aMedia, + const TInt aId, + const TArray& aAttrs) + { + TInt attrCnt = aAttrs.Count(); + for(TInt i = 0; i < attrCnt; i++) + { + TInt attrId = aAttrs[i].AttributeId(); + if(aAttrs[i].ContentId() == KMPXMediaIdGeneral) + { + if(attrId & EMPXMediaGeneralType) + { + AddAttributeGeneralTypeL(aMedia, aId); + } + if(attrId & EMPXMediaGeneralCategory) + { + AddAttributeGeneralCategoryL(aMedia, aId); + } + if(attrId & EMPXMediaGeneralDuration) + { + AddAttributeGeneralDurationL(aMedia, aId); + } + if(attrId & EMPXMediaGeneralLastPlaybackPosition) + { + AddAttributeGeneralLastPlaybackPositionL(aMedia, aId); + } + } + else if(aAttrs[i].ContentId() == KMPXMediaIdMusic) + { + if(attrId & EMPXMediaMusicArtist) + { + AddAttributeMusicArtistL(aMedia, aId); + } + } + else if(aAttrs[i].ContentId() == KMPXMediaIdDrm) + { + if(attrId & EMPXMediaDrmType) + { + AddAttributeDrmTypeL(aMedia, aId); + } + if(attrId & EMPXMediaDrmProtected) + { + AddAttributeDrmProtectedL(aMedia, aId); + } + if(attrId & EMPXMediaDrmRightsStatus) + { + AddAttributeDrmRightsStatusL(aMedia, aId); + } + } + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Filter out media in aMediaArray which match aFilter +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::FilterMediaArray(CMPXMediaArray& aMediaArray, CMPXFilter* aFilter) + { + if(aFilter ) + { + TArray filterAttr = aFilter->Attributes(); + TInt arrCnt = aMediaArray.Count(); + for(TInt i = arrCnt-1; i >= 0; i--) // Remove from the back + { + CMPXMedia* media = aMediaArray[i]; + for(TInt ii = 0; ii < filterAttr.Count(); ii++) + { + TMPXAttribute attr = filterAttr[ii]; + if( media->IsSupported( attr ) ) + { + TBool match = EFalse; + if(attr == KMPXMediaGeneralId) + { + TInt filterId = *aFilter->Value( attr ); + TInt mediaId = *media->Value( attr ); + if(filterId == mediaId) + match = ETrue; + } + else if(attr == KMPXMediaGeneralTitle || attr == KMPXMediaGeneralUri) + { + const TDesC& filterText = aFilter->ValueText( attr ); + const TDesC& mediaText = media->ValueText( attr ); + if(filterText == mediaText) + match = ETrue; + } + if( match ) + { + aMediaArray.Remove( i ); + break; + } + } + } + } + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Fill up media with change message +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::FillItemChangeMessageL(CMPXMessage& aMessage, + TMPXItemId aId, + TMPXChangeEventType aChangeType, + TMPXGeneralCategory aCategory) + { + LOG1( _L("Preparing HandleMessage callback") ); + aMessage.SetTObjectValueL( + TMPXAttribute(KMPXMessageContentIdGeneral, EMPXMessageGeneralId), KMPXMessageIdItemChanged); + + aMessage.SetTObjectValueL( + TMPXAttribute(KMPXMessageIdItemChanged, EMPXMessageCollectionId), TUid::Uid(KCollectionTestPluginImpId)); + + aMessage.SetTObjectValueL( + TMPXAttribute(KMPXMessageIdItemChanged, EMPXMessageChangeEventType), aChangeType); + + aMessage.SetTObjectValueL( + TMPXAttribute(KMPXMessageIdItemChanged, EMPXMessageMediaGeneralCategory), aCategory); + + aMessage.SetTObjectValueL( + TMPXAttribute(KMPXMessageIdItemChanged, EMPXMessageMediaGeneralId), aId); + } + + +// ---------------------------------------------------------------------------------------------------------- +// Adding specific attribute +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddAttributeGeneralTypeL(CMPXMedia& aMedia, const TInt aId) + { + switch( aId ) + { + case 9901: + case 9902: + case 9903: + case 9904: + case 9905: + case 9906: + case 9907: + aMedia.SetTObjectValueL(KMPXMediaGeneralType, EMPXItem); + break; + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Adding specific attribute +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddAttributeGeneralCategoryL(CMPXMedia& aMedia, const TInt aId) + { + switch( aId ) + { + case 9901: + case 9902: + case 9903: + case 9904: + case 9905: + case 9906: + case 9907: + aMedia.SetTObjectValueL(KMPXMediaGeneralCategory, EMPXSong); + break; + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Adding specific attribute +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddAttributeGeneralDurationL(CMPXMedia& aMedia, const TInt aId) + { + switch( aId ) + { + case 9901: + aMedia.SetTObjectValueL(KMPXMediaGeneralDuration, 0); // 0sec + break; + case 9902: + aMedia.SetTObjectValueL(KMPXMediaGeneralDuration, 1000); // 1sec + break; + case 9903: + aMedia.SetTObjectValueL(KMPXMediaGeneralDuration, 2000); // 2sec + break; + case 9904: + aMedia.SetTObjectValueL(KMPXMediaGeneralDuration, 5000); // 5sec + break; + case 9905: + aMedia.SetTObjectValueL(KMPXMediaGeneralDuration, 10000); // 10sec + break; + case 9906: + aMedia.SetTObjectValueL(KMPXMediaGeneralDuration, 20000); // 20sec + break; + case 9907: + aMedia.SetTObjectValueL(KMPXMediaGeneralDuration, 15000); // 15sec + break; + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Adding specific attribute +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddAttributeGeneralLastPlaybackPositionL(CMPXMedia& aMedia, const TInt aId) + { + switch( aId ) + { + case 9901: + aMedia.SetTObjectValueL(KMPXMediaGeneralLastPlaybackPosition, 0); // 0sec + break; + case 9902: + aMedia.SetTObjectValueL(KMPXMediaGeneralLastPlaybackPosition, 0); // 0sec + break; + case 9903: + aMedia.SetTObjectValueL(KMPXMediaGeneralLastPlaybackPosition, 1000); // 1sec + break; + case 9904: + aMedia.SetTObjectValueL(KMPXMediaGeneralLastPlaybackPosition, 2500); // 2.5sec + break; + case 9905: + aMedia.SetTObjectValueL(KMPXMediaGeneralLastPlaybackPosition, 0); // 0sec + break; + case 9906: + aMedia.SetTObjectValueL(KMPXMediaGeneralLastPlaybackPosition, 0); // 0sec + break; + case 9907: + aMedia.SetTObjectValueL(KMPXMediaGeneralLastPlaybackPosition, 0); // 0sec + break; + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Adding specific attribute +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddAttributeMusicArtistL(CMPXMedia& aMedia, const TInt aId) + { + switch( aId ) + { + case 9901: + aMedia.SetTextValueL(KMPXMediaMusicArtist, _L("artist9901")); + break; + case 9902: + aMedia.SetTextValueL(KMPXMediaMusicArtist, _L("artist9902")); + break; + case 9903: + aMedia.SetTextValueL(KMPXMediaMusicArtist, _L("artist9903")); + break; + case 9904: + aMedia.SetTextValueL(KMPXMediaMusicArtist, _L("artist9904")); + break; + case 9905: + aMedia.SetTextValueL(KMPXMediaMusicArtist, _L("artist9905")); + break; + case 9906: + aMedia.SetTextValueL(KMPXMediaMusicArtist, _L("artist9906")); + break; + case 9907: + aMedia.SetTextValueL(KMPXMediaMusicArtist, _L("artist9907")); + break; + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Adding specific attribute +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddAttributeDrmTypeL(CMPXMedia& aMedia, const TInt aId) + { + switch( aId ) + { + case 9901: + // Specify nothing + break; + case 9902: + // Specify nothing + break; + case 9903: + aMedia.SetTObjectValueL(KMPXMediaDrmType, EMPXDrmTypeOMA); + break; + case 9904: + aMedia.SetTObjectValueL(KMPXMediaDrmType, EMPXDrmTypeWMA); + break; + case 9905: + // Specify nothing + break; + case 9906: + // Specify nothing + break; + case 9907: + // Specify nothing + break; + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Adding specific attribute +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddAttributeDrmProtectedL(CMPXMedia& aMedia, const TInt aId) + { + switch( aId ) + { + case 9901: + aMedia.SetTObjectValueL(KMPXMediaDrmProtected, EFalse); + break; + case 9902: + aMedia.SetTObjectValueL(KMPXMediaDrmProtected, ETrue); + break; + case 9903: + aMedia.SetTObjectValueL(KMPXMediaDrmProtected, EFalse); + break; + case 9904: + aMedia.SetTObjectValueL(KMPXMediaDrmProtected, ETrue); + break; + case 9905: + aMedia.SetTObjectValueL(KMPXMediaDrmProtected, EFalse); + break; + case 9906: + aMedia.SetTObjectValueL(KMPXMediaDrmProtected, EFalse); + break; + case 9907: + aMedia.SetTObjectValueL(KMPXMediaDrmProtected, EFalse); + break; + } + } + +// ---------------------------------------------------------------------------------------------------------- +// Adding specific attribute +// ---------------------------------------------------------------------------------------------------------- +// +void CTestCollectionPlugin::AddAttributeDrmRightsStatusL(CMPXMedia& aMedia, const TInt aId) + { + switch( aId ) + { + case 9901: + // Specify nothing + break; + case 9902: + aMedia.SetTObjectValueL(KMPXMediaDrmRightsStatus, EMPXDrmRightsFull); + break; + case 9903: + aMedia.SetTObjectValueL(KMPXMediaDrmRightsStatus, EMPXDrmRightsExpired); + break; + case 9904: + aMedia.SetTObjectValueL(KMPXMediaDrmRightsStatus, EMPXDrmRightsPreview); + break; + case 9905: + // Specify nothing + break; + case 9906: + // Specify nothing + break; + case 9907: + // Specify nothing + break; + } + } + +// End of file diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/src/testcollectionpluginproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testcollectionplugin/src/testcollectionpluginproxy.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2002 - 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: Standard proxy of the ECOM plugin +* +*/ + +#include +#include "testcollectionplugin.h" +#include "testcommonpluginuids.h" + +#if (!defined IMPLEMENTATION_PROXY_ENTRY) +typedef TAny* TProxyNewLPtr; +#define IMPLEMENTATION_PROXY_ENTRY(aUid,aFuncPtr) {{aUid},(TProxyNewLPtr)(aFuncPtr)} +#endif + +// ---------------------------------------------------------------------------- +// The list of implementations +// ---------------------------------------------------------------------------- +// +const TImplementationProxy ImplementationTable[] = + { IMPLEMENTATION_PROXY_ENTRY(KCollectionTestPluginImpId, + CTestCollectionPlugin::NewL) }; + +// ---------------------------------------------------------------------------- +// The proxy of implementations +// ---------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) + { + aTableCount=sizeof(ImplementationTable)/sizeof(TImplementationProxy); + return ImplementationTable; + } + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/data/e0000201.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/data/e0000201.rss Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2002 - 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: Resource file +* +*/ + +/* + * The opaque_data syntax is made up of three parts: + * a list of Uids for resolving the view plugin, feature flags, priority. + * + *

uid1;uid2;uid3

+ * uid*: Supported plugin types. + * E.g. if podcast plugin may support music plugin as well, + * KMPXColPluginMusic + * + * uid + * uid: plugin type uid. + * E.g. for music plugin will be: 0x101FFCDA + * + * flags [optional] + * flags: sum of the required feature flags, not used now + * + * priority [optional] + * priority: a value of type TMPXCollectionPluginPriorities. This value + * determines the returning order when several plugins can + * support the same set of Uids. + * Default value of this field is EMPXCollectionPluginPriorityNormal. + */ + +#include +#include +#include "testcommonpluginuids.h" +#include "testplaybackplugintype.h" + +RESOURCE REGISTRY_INFO theInfo +{ + dll_uid = KPlaybackTestPlugin; + + interfaces = + { + INTERFACE_INFO + { + interface_uid = KMPXPlaybackPluginInterfaceUid; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = KPlaybackTestPluginImpId; + version_no = 1; + display_name = "TestPlaybackPlugin"; + default_data = + "video/x-pn-realvideo;" + "application/x-pn-realmedia;" + "video/3gpp2;" + "video/3gpp"; + opaque_data = + ".rm;.3gp" + ""EPbUnknown"" + ""EMPXPlaybackPluginPriorityHighest"" + ""MPXPlaybackPluginVersion2""; + } + }; + } + }; +} + + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2002 - 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 Playback test plugin +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +testplaybackplugin.mmp + +PRJ_MMPFILES + +// End of File + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/group/testplaybackplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/group/testplaybackplugin.mmp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2002 - 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: Playback test plugin project specification +* +*/ + +#include +#include +#include + +#include "../../inc/testcommonpluginuids.h" + +TARGET testplaybackplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D KPlaybackTestPlugin + +VENDORID VID_DEFAULT +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE testplaybackplugin.cpp +SOURCE testplaybackpluginproxy.cpp + +SOURCEPATH ../data +START RESOURCE e0000201.RSS +TARGET testplaybackplugin.rsc +END + +USERINCLUDE ../inc +USERINCLUDE ../../inc + +APP_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY BAFL.lib +LIBRARY flogger.lib +LIBRARY mpxcommon.lib + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/inc/testplaybackplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/inc/testplaybackplugin.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2002 - 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 testplaybackplugin interface +* +*/ + +#ifndef _CTESTPLAYBACKPLUGIN_H_ +#define _CTESTPLAYBACKPLUGIN_H_ + +// +// INCLUDES +// +#include +#include + + +// +// CLASS DECLARATION +// + +/* + * CTestPlaybackPlugin class + * + */ + +NONSHARABLE_CLASS( CTestPlaybackPlugin ) : public CMPXPlaybackPluginVersion2 +{ + public: + // + // Constructors and destructor + // + + /* + * Two-phased constructor. + * @param aInitParams, initialization parameter + * @return a pointer to the created instance + */ + static CTestPlaybackPlugin* NewL(TAny* aInitParams); + + /* + * Destructor + * Destroy the object and release all memory objects + */ + ~CTestPlaybackPlugin(); + + /* + * Returns the current file handle iFile + */ + RFile GetFileHandle(); + + /** + * Initializes a file for playback. + * + * @since S60 9.2 + * @param aUri URI of the item + * @param aType the mime type of the item + * @param aAccessPoint the access point + */ + void InitStreamingL(const TDesC& aUri, const TDesC8& aType, TInt aAccessPoint); + + /** + * Initializes a file handle for playback. + * + * @since S60 9.2 + * @param aFile file handle of a file + * @param aAccessPoint the access point + */ + void InitStreamingL(RFile& aFile, TInt aAccessPoint); + +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + /** + * Initializes a file handle for playback. + * + * @since S60 9.2 + * @param aFile 64 bit file handle of a file + * @param aAccessPoint the access point + */ + void InitStreaming64L(RFile64& aFile, TInt aAccessPoint); + + /** + * Initializes a song for playback. + * + * @since S60 9.2 + * @param aFile 64 bit file handle of a song + */ + void Initialise64L(RFile64& aSong); +#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + + private: + // + // CMPXPlaybackPlugin Implementation + // + + /* + * Set observer + * + * @param aObs observer + */ + void SetObserver( MMPXPlaybackPluginObserver& aObs ); + + /* + * Initializes a clip for playback + * @param aSong the song path + */ + void InitialiseL( const TDesC& aSong ); + + /* + * Initializes a song for playback + * @param aFile file handle of a song + */ + void InitialiseL( RFile& aFile ); + + /* + * Executes a command on the selected song + * @param aCmd a command + * @param aData, data + */ + void CommandL( CMPXCommand& aCmd ); + + // Supposedly being deprecated + // We're forced to implement this as its declared as a + // pure virtual function by the MPX framework + void CommandL(TMPXPlaybackCommand aCmd, TInt aData=0); + + /* + * Sets a property of the plugin + * @param aProperty a property + * @param aValue the value of the setting + */ + void SetL( TMPXPlaybackProperty aProperty , TInt aValue ); + + /* + * Gets a property of the plugin (async) + * @param aProperty a property + */ + void PropertyL( TMPXPlaybackProperty aProperty ) const; + + /* + * Gets a list of sub players + * @return a list of names of sub players + */ + void SubPlayerNamesL(); + + /* + * Select a sub player + * @param aIndex index to the sub player + */ + void SelectSubPlayerL( TInt aIndex ); + + /* + * Returns current sub player name + * @return friendly name of the current the sub player + */ + const TDesC& SubPlayerName(); + + /* + * Current sub player index + * @return index to the sub player + */ + TInt SubPlayerIndex() const; + + /* + * Media properties of the current file (async) + * @param aAttrs attributes requested + */ + void MediaL( const TArray& aAttrs ); + + /* + * Cancel async request + */ + void CancelRequest(); + + private: + /* + * C++ default constructor + */ + CTestPlaybackPlugin(); + + /* + * the second phase constructor ConstructL to safely construct things + * that can leave + */ + void ConstructL(); + + private: + + HBufC* iClipName; + RFs iFs; + RFile iFile; +}; + +#endif diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/src/testplaybackplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/src/testplaybackplugin.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,278 @@ +/* +* Copyright (c) 2002 - 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: CTestPlaybackPlugin implementation +* +*/ + +// +// INCLUDE FILES +// +#include +#include +#include +#include +#include +#include +#include +#include "testplaybackplugin.h" + +// +// CONSTANTS +// +const TUid KLocalPlaybackUid = { 0x10282556 }; + + +// ============================ MEMBER FUNCTIONS =============================== + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CTestPlaybackPlugin* CTestPlaybackPlugin::NewL( TAny* /*aInitParams*/ ) +{ + CTestPlaybackPlugin* p = new (ELeave) CTestPlaybackPlugin(); + CleanupStack::PushL(p); + p->ConstructL(); + CleanupStack::Pop(p); + return p; +} + +// ---------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::ConstructL() +{ + User::LeaveIfError( iFs.Connect() ); + iFs.ShareProtected(); +} + +// ---------------------------------------------------------------------------- +// C++ constructor +// ---------------------------------------------------------------------------- +// +CTestPlaybackPlugin::CTestPlaybackPlugin() +{ +} + +// ---------------------------------------------------------------------------- +// Destructor +// ---------------------------------------------------------------------------- +// +CTestPlaybackPlugin::~CTestPlaybackPlugin() +{ + iFile.Close(); + iFs.Close(); +} + +// ---------------------------------------------------------------------------- +// Set observer +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::SetObserver( MMPXPlaybackPluginObserver& aObs ) +{ + iObs = &aObs; +} + +// ---------------------------------------------------------------------------- +// Initializes a clip for playback from a file name +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::InitialiseL( const TDesC& aSong ) +{ + delete iClipName; + iClipName = NULL; + iClipName = aSong.AllocL(); + + iFile.Close(); + + TInt err = iFile.Open( iFs, aSong, EFileRead | EFileShareReadersOrWriters ); + + // + // Remap KErrNotReady to KErrNotFound, because it is referencing a drive + // that is not existent + // + if ( KErrNotReady == err ) + { + err = KErrNotFound; + } + + // if aSong is an streaming link and contains one of the streaming schemas + // eg. rtsp:// , http:// etc. then a file handle can not be opened + // ignore KErrBadName + if (err != KErrBadName) + { + User::LeaveIfError( err ); + } +} + +// ---------------------------------------------------------------------------- +// Initializes a clip for playback from a file handle +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::InitialiseL( RFile& aSong ) +{ + delete iClipName; + iClipName = NULL; + iClipName = HBufC::NewL( KMaxFileName ); + TPtr ptr = iClipName->Des(); + aSong.FullName( ptr ); + + iFile.Close(); + User::LeaveIfError( iFile.Duplicate( aSong )); +} + +/** +* Initializes a file for playback. +* +* @since S60 9.2 +* @param aUri URI of the item +* @param aType the mime type of the item +* @param aAccessPoint the access point +*/ +void CTestPlaybackPlugin::InitStreamingL(const TDesC& /*aUri*/, + const TDesC8& /*aType*/, TInt /*aAccessPoint*/) + { + } + +/** +* Initializes a file handle for playback. +* +* @since S60 9.2 +* @param aFile file handle of a file +* @param aAccessPoint the access point +*/ +void CTestPlaybackPlugin::InitStreamingL(RFile& /*aFile*/, TInt /*aAccessPoint*/) + { + } + +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API +/** +* Initializes a file handle for playback. +* +* @since S60 9.2 +* @param aFile 64 bit file handle of a file +* @param aAccessPoint the access point +*/ +void CTestPlaybackPlugin::InitStreaming64L(RFile64& /*aFile*/, TInt /*aAccessPoint*/) + { + } + +/** +* Initializes a song for playback. +* +* @since S60 9.2 +* @param aFile 64 bit file handle of a song +*/ +void CTestPlaybackPlugin::Initialise64L(RFile64& /*aSong*/) + { + } +#endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API + +// ---------------------------------------------------------------------------- +// Executes a command on the selected song +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::CommandL( CMPXCommand& /*aCmd*/ ) +{ +} + + +// ---------------------------------------------------------------------------- +// Executes a command on the selected song +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::CommandL(TMPXPlaybackCommand /*aCmd*/, TInt /*aData*/) +{ +} + + +// ---------------------------------------------------------------------------- +// Sets a property of the plugin +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::SetL( TMPXPlaybackProperty /*aProperty*/, TInt /*aValue*/ ) +{ +} + +// ---------------------------------------------------------------------------- +// Gets a property of the plugin (async) +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::PropertyL( TMPXPlaybackProperty /*aProperty*/ ) const +{ +} + +// ---------------------------------------------------------------------------- +// Gets a list of sub players, UPnP only +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::SubPlayerNamesL() +{ + iObs->HandleSubPlayerNames( KLocalPlaybackUid, NULL, ETrue, KErrNone ); +} + +// ---------------------------------------------------------------------------- +// Select a sub player +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::SelectSubPlayerL( TInt /*aIndex*/ ) +{ + User::Leave( KErrNotSupported ); +} + +// ---------------------------------------------------------------------------- +// Returns current sub player name +// ---------------------------------------------------------------------------- +// +const TDesC& CTestPlaybackPlugin::SubPlayerName() +{ + return KNullDesC; +} + +// ---------------------------------------------------------------------------- +// Current sub player index +// ---------------------------------------------------------------------------- +// +TInt CTestPlaybackPlugin::SubPlayerIndex() const +{ + return KErrNotFound; +} + +// ---------------------------------------------------------------------------- +// Gets media properties +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::MediaL( const TArray& /*aAttrs*/ ) +{ +} + +// ---------------------------------------------------------------------------- +// Cancel request +// ---------------------------------------------------------------------------- +// +void CTestPlaybackPlugin::CancelRequest() +{ +} + +// ---------------------------------------------------------------------------- +// CTestPlaybackPlugin::GetFileHandle() +// ---------------------------------------------------------------------------- +// +RFile CTestPlaybackPlugin::GetFileHandle() +{ + return iFile; +} + +// End of file diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/src/testplaybackpluginproxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testplugins/testplaybackplugin/src/testplaybackpluginproxy.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2002 - 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: Standard proxy of the ECOM plugin +* +*/ + +#include +#include "testcommonpluginuids.h" +#include "testplaybackplugin.h" + +#if ( ! defined IMPLEMENTATION_PROXY_ENTRY ) +typedef TAny* TProxyNewLPtr; +#define IMPLEMENTATION_PROXY_ENTRY(aUid,aFuncPtr) \ + { {aUid}, (TProxyNewLPtr)(aFuncPtr) } +#endif + +// ---------------------------------------------------------------------------- +// The list of implementations +// ---------------------------------------------------------------------------- +// +const TImplementationProxy ImplementationTable[] = + { IMPLEMENTATION_PROXY_ENTRY( KPlaybackTestPluginImpId, + CTestPlaybackPlugin::NewL ) }; + +// ---------------------------------------------------------------------------- +// The proxy of implementations +// ---------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) +{ + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; +} + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/bwinscw/testviewframeworku.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/bwinscw/testviewframeworku.def Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,41 @@ +EXPORTS + ?DeleteItem@CTestMenuView@@IAEXH@Z @ 1 NONAME ; void CTestMenuView::DeleteItem(int) + ?NewL@CConsoleMain@@SAPAV1@PAVCActiveScheduler@@@Z @ 2 NONAME ; class CConsoleMain * CConsoleMain::NewL(class CActiveScheduler *) + ??1CTestBaseView@@UAE@XZ @ 3 NONAME ; CTestBaseView::~CTestBaseView(void) + ?TestLog@TestUtility@@SAXPAVCStifLogger@@V?$TRefByValue@$$CBVTDesC16@@@@ZZ @ 4 NONAME ; void TestUtility::TestLog(class CStifLogger *, class TRefByValue, ...) + ?ConstructL@CTestMenuView@@IAEXXZ @ 5 NONAME ; void CTestMenuView::ConstructL(void) + ??0CTestMenuView@@IAE@PAVCConsoleMain@@PAVCTestBaseView@@ABVTDesC16@@@Z @ 6 NONAME ; CTestMenuView::CTestMenuView(class CConsoleMain *, class CTestBaseView *, class TDesC16 const &) + ??1CTestPlaybackView@@UAE@XZ @ 7 NONAME ; CTestPlaybackView::~CTestPlaybackView(void) + ?CurrentPosition@CTestMenuView@@IAEHXZ @ 8 NONAME ; int CTestMenuView::CurrentPosition(void) + ?SetParent@CTestBaseView@@QAEXPAV1@@Z @ 9 NONAME ; void CTestBaseView::SetParent(class CTestBaseView *) + ?CurrentIndex@CTestMenuView@@IAEHXZ @ 10 NONAME ; int CTestMenuView::CurrentIndex(void) + ?UpdateSongInfo@CTestPlaybackView@@QAEXABVTDesC16@@0@Z @ 11 NONAME ; void CTestPlaybackView::UpdateSongInfo(class TDesC16 const &, class TDesC16 const &) + ?NewL@CTestPlaybackView@@SAPAV1@PAVCConsoleMain@@PAVCTestBaseView@@ABVTDesC16@@PAVCStifLogger@@@Z @ 12 NONAME ; class CTestPlaybackView * CTestPlaybackView::NewL(class CConsoleMain *, class CTestBaseView *, class TDesC16 const &, class CStifLogger *) + ?ItemCount@CTestMenuView@@IBEHXZ @ 13 NONAME ; int CTestMenuView::ItemCount(void) const + ?DisplayViewL@CTestMenuView@@UAEXXZ @ 14 NONAME ; void CTestMenuView::DisplayViewL(void) + ?Parent@CTestBaseView@@QAEPAV1@XZ @ 15 NONAME ; class CTestBaseView * CTestBaseView::Parent(void) + ?StateChanged@CTestPlaybackView@@QAEXW4TTestPlaybackState@@@Z @ 16 NONAME ; void CTestPlaybackView::StateChanged(enum TTestPlaybackState) + ?UpdateProgress@CTestPlaybackView@@QAEXHH@Z @ 17 NONAME ; void CTestPlaybackView::UpdateProgress(int, int) + ??1CTestMenuView@@UAE@XZ @ 18 NONAME ; CTestMenuView::~CTestMenuView(void) + ?Stop@CConsoleMain@@QAEXXZ @ 19 NONAME ; void CConsoleMain::Stop(void) + ?SelectL@CTestMenuView@@UAEXW4TKeyCode@@AAH@Z @ 20 NONAME ; void CTestMenuView::SelectL(enum TKeyCode, int &) + ?UpdateItemIndex@CTestPlaybackView@@QAEXHH@Z @ 21 NONAME ; void CTestPlaybackView::UpdateItemIndex(int, int) + ?Name@CTestBaseView@@QBEABVTDesC16@@XZ @ 22 NONAME ; class TDesC16 const & CTestBaseView::Name(void) const + ?SetName@CTestBaseView@@QAEXABVTDesC16@@@Z @ 23 NONAME ; void CTestBaseView::SetName(class TDesC16 const &) + ?ActivateL@CConsoleMain@@QAEXPAVCTestBaseView@@@Z @ 24 NONAME ; void CConsoleMain::ActivateL(class CTestBaseView *) + ?CurrentViewDoneL@CTestBaseView@@IAEXXZ @ 25 NONAME ; void CTestBaseView::CurrentViewDoneL(void) + ??0CTestBaseView@@IAE@PAVCConsoleMain@@PAV0@ABVTDesC16@@@Z @ 26 NONAME ; CTestBaseView::CTestBaseView(class CConsoleMain *, class CTestBaseView *, class TDesC16 const &) + ?PrintMulti@CTestMenuView@@IAEXABVTDesC16@@@Z @ 27 NONAME ; void CTestMenuView::PrintMulti(class TDesC16 const &) + ?LastKeyPressed@CTestMenuView@@IAE?AW4TKeyCode@@XZ @ 28 NONAME ; enum TKeyCode CTestMenuView::LastKeyPressed(void) + ?ItemL@CTestMenuView@@IAE?AVTPtrC16@@H@Z @ 29 NONAME ; class TPtrC16 CTestMenuView::ItemL(int) + ?AddObserver@CTestPlaybackView@@QAEXPAVMTestPlaybackViewObserver@@@Z @ 30 NONAME ; void CTestPlaybackView::AddObserver(class MTestPlaybackViewObserver *) + ?ItemsCreated@CTestMenuView@@IAEHXZ @ 31 NONAME ; int CTestMenuView::ItemsCreated(void) + ?TimerUpdate@CTestMenuView@@UAEXXZ @ 32 NONAME ; void CTestMenuView::TimerUpdate(void) + ?UpdateVolume@CTestPlaybackView@@QAEXHH@Z @ 33 NONAME ; void CTestPlaybackView::UpdateVolume(int, int) + ?NextViewL@CTestBaseView@@IAEXPAV1@@Z @ 34 NONAME ; void CTestBaseView::NextViewL(class CTestBaseView *) + ?ConvertStrToDecL@TestUtility@@SAHABVTDesC16@@@Z @ 35 NONAME ; int TestUtility::ConvertStrToDecL(class TDesC16 const &) + ?ReadString@CTestMenuView@@IAEXAAVTDes16@@@Z @ 36 NONAME ; void CTestMenuView::ReadString(class TDes16 &) + ?AddItemL@CTestMenuView@@IAEXABVTDesC16@@@Z @ 37 NONAME ; void CTestMenuView::AddItemL(class TDesC16 const &) + ?ReadString@CConsoleMain@@QAEXAAVTDes16@@@Z @ 38 NONAME ; void CConsoleMain::ReadString(class TDes16 &) + ?Print@CTestMenuView@@IAEXABVTDesC16@@@Z @ 39 NONAME ; void CTestMenuView::Print(class TDesC16 const &) + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/eabi/testviewframeworku.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/eabi/testviewframeworku.def Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,62 @@ +EXPORTS + _ZN11TestUtility16ConvertStrToDecLERK7TDesC16 @ 1 NONAME + _ZN11TestUtility7TestLogEP11CStifLogger11TRefByValueIK7TDesC16Ez @ 2 NONAME + _ZN12CConsoleMain10ReadStringER6TDes16 @ 3 NONAME + _ZN12CConsoleMain4NewLEP16CActiveScheduler @ 4 NONAME + _ZN12CConsoleMain4StopEv @ 5 NONAME + _ZN12CConsoleMain9ActivateLEP13CTestBaseView @ 6 NONAME + _ZN13CTestBaseView16CurrentViewDoneLEv @ 7 NONAME + _ZN13CTestBaseView6ParentEv @ 8 NONAME + _ZN13CTestBaseView7SetNameERK7TDesC16 @ 9 NONAME + _ZN13CTestBaseView9NextViewLEPS_ @ 10 NONAME + _ZN13CTestBaseView9SetParentEPS_ @ 11 NONAME + _ZN13CTestBaseViewC2EP12CConsoleMainPS_RK7TDesC16 @ 12 NONAME + _ZN13CTestBaseViewD0Ev @ 13 NONAME + _ZN13CTestBaseViewD1Ev @ 14 NONAME + _ZN13CTestBaseViewD2Ev @ 15 NONAME + _ZN13CTestMenuView10ConstructLEv @ 16 NONAME + _ZN13CTestMenuView10DeleteItemEi @ 17 NONAME + _ZN13CTestMenuView10PrintMultiERK7TDesC16 @ 18 NONAME + _ZN13CTestMenuView10ReadStringER6TDes16 @ 19 NONAME + _ZN13CTestMenuView11TimerUpdateEv @ 20 NONAME + _ZN13CTestMenuView12CurrentIndexEv @ 21 NONAME + _ZN13CTestMenuView12DisplayViewLEv @ 22 NONAME + _ZN13CTestMenuView12ItemsCreatedEv @ 23 NONAME + _ZN13CTestMenuView14LastKeyPressedEv @ 24 NONAME + _ZN13CTestMenuView15CurrentPositionEv @ 25 NONAME + _ZN13CTestMenuView5ItemLEi @ 26 NONAME + _ZN13CTestMenuView5PrintERK7TDesC16 @ 27 NONAME + _ZN13CTestMenuView7SelectLE8TKeyCodeRi @ 28 NONAME + _ZN13CTestMenuView8AddItemLERK7TDesC16 @ 29 NONAME + _ZN13CTestMenuViewC2EP12CConsoleMainP13CTestBaseViewRK7TDesC16 @ 30 NONAME + _ZN13CTestMenuViewD0Ev @ 31 NONAME + _ZN13CTestMenuViewD1Ev @ 32 NONAME + _ZN13CTestMenuViewD2Ev @ 33 NONAME + _ZN17CTestPlaybackView11AddObserverEP25MTestPlaybackViewObserver @ 34 NONAME + _ZN17CTestPlaybackView12StateChangedE18TTestPlaybackState @ 35 NONAME + _ZN17CTestPlaybackView12UpdateVolumeEii @ 36 NONAME + _ZN17CTestPlaybackView14UpdateProgressEii @ 37 NONAME + _ZN17CTestPlaybackView14UpdateSongInfoERK7TDesC16S2_ @ 38 NONAME + _ZN17CTestPlaybackView15UpdateItemIndexEii @ 39 NONAME + _ZN17CTestPlaybackView4NewLEP12CConsoleMainP13CTestBaseViewRK7TDesC16P11CStifLogger @ 40 NONAME + _ZN17CTestPlaybackViewD0Ev @ 41 NONAME + _ZN17CTestPlaybackViewD1Ev @ 42 NONAME + _ZN17CTestPlaybackViewD2Ev @ 43 NONAME + _ZNK13CTestBaseView4NameEv @ 44 NONAME + _ZNK13CTestMenuView9ItemCountEv @ 45 NONAME + _ZTI12CConsoleMain @ 46 NONAME ; ## + _ZTI13CTestBaseView @ 47 NONAME ; ## + _ZTI13CTestMenuView @ 48 NONAME ; ## + _ZTI14CConsoleReader @ 49 NONAME ; ## + _ZTI14CScrollerTimer @ 50 NONAME ; ## + _ZTI17CTestPlaybackView @ 51 NONAME ; ## + _ZTV12CConsoleMain @ 52 NONAME ; ## + _ZTV13CTestBaseView @ 53 NONAME ; ## + _ZTV13CTestMenuView @ 54 NONAME ; ## + _ZTV14CConsoleReader @ 55 NONAME ; ## + _ZTV14CScrollerTimer @ 56 NONAME ; ## + _ZTV17CTestPlaybackView @ 57 NONAME ; ## + _ZThn4_N13CTestMenuView11TimerUpdateEv @ 58 NONAME ; ## + _ZThn4_N13CTestMenuView12DisplayViewLEv @ 59 NONAME ; ## + _ZThn4_N13CTestMenuView7SelectLE8TKeyCodeRi @ 60 NONAME ; ## + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2002 - 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 testviewframework. +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS +../inc/testbaseview.h APP_LAYER_PLATFORM_EXPORT_PATH(testbaseview.h) +../inc/consolemain.h APP_LAYER_PLATFORM_EXPORT_PATH(consolemain.h) +../inc/testutility.h APP_LAYER_PLATFORM_EXPORT_PATH(testutility.h) + +//testplaybackview +../inc/testplaybackviewobserver.h APP_LAYER_PLATFORM_EXPORT_PATH(testplaybackviewobserver.h) +../inc/testplaybackview.h APP_LAYER_PLATFORM_EXPORT_PATH(testplaybackview.h) + +//testmenuview +../inc/testmenuview.h APP_LAYER_PLATFORM_EXPORT_PATH(testmenuview.h) + + +PRJ_TESTMMPFILES +testviewframework.mmp + +PRJ_MMPFILES + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/group/testviewframework.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/group/testviewframework.mmp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2002 - 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: mmp file for TestViewFramework +* +*/ + +#include + +TARGET testviewframework.dll +TARGETTYPE dll +UID 0x1000008D 0x101FFCD4 +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +SOURCEPATH ../src +SOURCE consolemain.cpp +SOURCE consolereader.cpp +SOURCE scrollertimer.cpp +SOURCE testbaseview.cpp +SOURCE testutility.cpp +SOURCE testplaybackview.cpp +SOURCE testmenuview.cpp + +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE + + +LIBRARY euser.lib +LIBRARY bafl.lib +LIBRARY stiftestinterface.lib + +LANG SC + +#if defined(ARMCC) +#elif defined(WINSCW) +deffile ../bwinscw/ +#endif diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/inc/consolemain.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/inc/consolemain.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,139 @@ +/* +* Copyright (c) 2002 - 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: console manipulation +* +*/ + +#ifndef CCONSOLEMAIN_H +#define CCONSOLEMAIN_H + +// INCLUDE FILES +#include +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CTestBaseView; +class CScrollerTimer; +class CConsoleReader; + +/** +* console manipulation class +* +* @lib TestViewFramework.lib +*/ +class CConsoleMain :public CBase + { + public: + + /** + * Two-phased constructor + * @return object of CConsoleMain + */ + IMPORT_C static CConsoleMain* NewL(CActiveScheduler* aScheduler); + + /** + * Destructor of CConsoleMain + */ + virtual ~CConsoleMain(); + + /** + * Start + * @param aView, activate a root view in console + */ + IMPORT_C void ActivateL( CTestBaseView* aRootView ); + + /** + * Stop ScrollerTimer and ConsoleReader + */ + IMPORT_C void Stop(); + + /** + * Reads user input into the start of the descriptor aDes + * @param aDes, descriptor to store input string + */ + IMPORT_C void ReadString( TDes& aDes ); + + + + public: // New functions + + /** + * Return current menu + * @return reference of current shown menu + */ + CTestBaseView* CurrentView(); + + /** + * Return pointer to console + * @return reference to console + */ + CConsoleBase* GetConsole(); + + /** + * Called from timer to perform scrolling + */ + void TimerUpdate(); + + /** + * Process keystokes. + */ + void KeyPressedL(); + + private: //Friend class + friend class CTestBaseView; + + private: + + /** + * C++ default constructor. + */ + CConsoleMain(CActiveScheduler* aScheduler); + + /** + * the second phase constructor ConstructL to safely construct things + * that can leave + */ + void ConstructL(); + + /** + * Call by CTestBaseView + * Actiavte the child view + * @param aChild, a new child view + */ + void NextViewL(CTestBaseView* aChild); + + /** + * Call by CTestBaseView + * Indicate the current is done, go back parent view + */ + void CurrentViewDoneL(); + + private: // Data + CConsoleBase* iConsole; // Pointer to console + + CTestBaseView* iCurrentView; // Current view + + CScrollerTimer* iScroller; // Scroll text + + CConsoleReader* iReader; // Console reader + + CActiveScheduler* iScheduler; // Uses an active scheduler + + TBool iSchedulerStarted; + }; + +#endif diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/inc/consolereader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/inc/consolereader.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,91 @@ +/* +* Copyright (c) 2002 - 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: Obtain input from console or output to console +* +*/ + +#ifndef CCONSOLEREADER_H +#define CCONSOLEREADER_H + +// INCLUDES +#include +#include + +// FORWARD DECLARATIONS +class CConsoleMain; + +/** +* console read class +* +* @lib AddonMenu.lib +*/ +class CConsoleReader + :public CActive + { + public: // Constructors and destructor + + /** + * Two-phased constructor + * @param aMain, main console + * @param aConsole, console + * @return object of CConsoleReader + */ + static CConsoleReader* NewL( CConsoleMain* aMain, + CConsoleBase* aConsole ); + + /** + * Start + */ + void Start(); + + /** + * Destructor of CConsoleReader. + */ + virtual ~CConsoleReader(); + + + public: // Functions from base classes + + /** + * RunL derived from CActive handles the completed requests. + */ + void RunL(); + + /** + * DoCancel derived from CActive handles the Cancel + */ + void DoCancel(); + + private: + + /** + * C++ default constructor. + * @param aMain, main console + * @param aConsole, console + */ + CConsoleReader( CConsoleMain* aMain, + CConsoleBase* aConsole ); + + /** + * the second phase constructor ConstructL to safely construct things + * that can leave + */ + void ConstructL(); + + private: // Data + CConsoleBase* iConsole; // Pointer to console + CConsoleMain* iMain; // Backpointer + }; + +#endif diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/inc/rrefarray.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/inc/rrefarray.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2002 - 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: RRefArray +* +*/ + +#ifndef RREFARRAY_H +#define RREFARRAY_H + +// INCLUDES +#include + +// CLASS DECLARATION +/** +* Array class for references. +*/ +template +class RRefArray + :public RPointerArrayBase + { + public: + inline RRefArray():RPointerArrayBase(){}; + inline void Close(){ RPointerArrayBase::Close(); }; + inline TInt Count() const{ return RPointerArrayBase::Count(); }; + inline T const& operator[](TInt anIndex) const + { return *( ( T* ) At(anIndex)); }; + inline T& operator[](TInt anIndex) + { return *( ( T* ) At(anIndex)); }; + inline TInt Append( T const& anEntry ) + { return RPointerArrayBase::Append(( TAny*) &anEntry); }; + inline TInt Insert( T const& anEntry, TInt aPos ) + { return RPointerArrayBase::Insert(( TAny*) &anEntry, aPos ); }; + inline void Remove( TInt anIndex ) + { RPointerArrayBase::Remove( anIndex ); }; + inline void Reset(){ RPointerArrayBase::Reset(); }; + private: + RArray iArray; + }; + + +#endif // RREFARRAY_H + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/inc/scrollertimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/inc/scrollertimer.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2002 - 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: Scrolling menu with timer +* +*/ + +#ifndef CSCROLLERTIMER_H +#define CSCROLLERTIMER_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CConsoleMain; + +/** +* scrolling timer class +* +* @lib AddonMenu.lib +*/ +class CScrollerTimer + :public CActive + { + + public: // Constructors and destructor + + /** + * Two-phased constructor + * @param aMain, main console + * @return object of CScrollerTimer + */ + static CScrollerTimer* NewL( CConsoleMain* aMain ); + + /** + * Destructor of CModule. + */ + virtual ~CScrollerTimer(); + + public: // New functions + + /** + * Start + */ + void Start(); + + public: // Functions from base classes + + /** + * RunL derived from CActive handles the completed requests. + */ + void RunL(); + + /** + * DoCancel derived from CActive handles the Cancel + */ + void DoCancel(); + + /** + * RunError + */ + TInt RunError ( TInt aError ); + + private: + + /** + * C++ default constructor. + */ + CScrollerTimer(); + + /** + * the second phase constructor ConstructL to safely construct things + * that can leave + * @param aMain, main console + */ + void ConstructL( CConsoleMain* aMain ); + + private: // Data + CConsoleMain* iMain; // Pointer to main console + RTimer iTimer; // timer object + + }; + +#endif diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/inc/testbaseview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/inc/testbaseview.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,148 @@ +/* +* Copyright (c) 2002 - 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 console for menu selection +* +*/ + +#ifndef TESTBASEVIEW_H +#define TESTBASEVIEW_H + +// INCLUDE FILES +#include +#include +#include + +// FORWARD DECLARATION +template class RRefArray; +class CConsoleMain; + +// CLASS DECLARATION + +/** +* Abstract View class - contains functions which must be derived +* +* @lib TestViewFramework.lib +*/ +class MTestBaseView + { + public: + + /** + * Initialize the view before display view + * NOTE: Must be derived + */ + virtual void InitializeViewL() = 0; + + /** + * Cleanup the child view before deactivate/destroy view + * NOTE: Must be derived + */ + virtual void CleanupViewL() = 0; + + /** + * Display this view + * NOTE: Must be derived + */ + virtual void DisplayViewL() = 0; + + /** + * Process keypresses on this view - called by ConsoleMain + * @param aSelection, key pressed + * @param aContinue, whether to continue or stop scheduler + * NOTE: Must be derived + */ + virtual void SelectL( TKeyCode aSelection, TBool& aContinue ) = 0; + + /** + * Update display from timer - called by ConsoleMain + * NOTE: Must be derived + */ + virtual void TimerUpdate() = 0; + + }; + + +/** +* View class - Console base +* +* @lib TestViewFramework.lib +*/ +class CTestBaseView :public CBase, public MTestBaseView + { + public: + /** + * Destructor + */ + IMPORT_C virtual ~CTestBaseView(); + + /** + * Return menu name + * @return descriptor of current menu's name + */ + IMPORT_C const TDesC& Name() const; + + /** + * Set the menu name + * @param aName, menu name to be set + */ + IMPORT_C void SetName( const TDesC& aName ); + + /** + * Set parent menu + * @param aMenu, parent menu of current menu + */ + IMPORT_C void SetParent( CTestBaseView* aView ); + + /** + * Get the parent view + * @return reference of parent view + */ + IMPORT_C CTestBaseView* Parent(); + + + protected: + /** + * Make sure DisplayViewBase() is call in the beginning + * of DisplayViewL() call + */ + void DisplayViewBase() + { if(iChild) { CleanupViewL(); delete iChild; iChild = NULL; }}; + + /** + * C++ default constructor + */ + IMPORT_C CTestBaseView(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName); + + /** + * Signal CConsoleMain that a new child view is created + */ + IMPORT_C void NextViewL(CTestBaseView* aChild); + + /** + * Signal CConsoleMain that current view is done, go back parent + */ + IMPORT_C void CurrentViewDoneL(); + + protected: // Data + CConsoleBase* iConsole; // Pointer to console + CConsoleMain* iConsoleMain; // Pointer to console main + CTestBaseView* iParent; // Pointer to parent view + CTestBaseView* iChild; //Pointer to child view + TName iName; // View name + + }; + +#endif //TESTVIEW_H diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/inc/testmenuview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/inc/testmenuview.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2002 - 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: part of testviewframework. +* +*/ + +#ifndef TESTMENUVIEW_H +#define TESTMENUVIEW_H + +//INCLUDES +#include +#include "testbaseview.h" + + +// FORWARD DECLARATION +class CConsoleMain; + +// CLASS DECLARATION + +/** +* Abstract View class - contains functions which must be derived +*/ +class MTestMenuView + { + public: + + /** + * Handle number key press + * NOTE: Must be derived + */ + virtual void HandleNumKeyL() = 0; + + /** + * Handle left key press + * NOTE: Must be derived + */ + virtual void HandleLeftKeyL() = 0; + + /** + * Handle right/enter key press + * NOTE: Must be derived + */ + virtual void HandleRightKeyL() = 0; + }; + +/** +* Menu View class - Console base +*/ +class CTestMenuView :public CTestBaseView, public MTestMenuView + { + public: + /** + * Destructor + */ + IMPORT_C virtual ~CTestMenuView(); + + + public: //Implement abstract function from base classes + /** + * From: CTestBaseView + * Display view + */ + IMPORT_C void DisplayViewL(); + + /** + * From: CTestBaseView + * Process keypresses on this menu - called by ConsoleMain + * @param aSelection, key pressed + * @param aContinue, whether to continue or stop scheduler + */ + IMPORT_C void SelectL( TKeyCode aSelection, TBool& aContinue ); + + /** + * From: CTestBaseView + * Update display from timer - called by ConsoleMain + */ + IMPORT_C void TimerUpdate(); + + + protected: + + /** + * C++ default constructor + */ + IMPORT_C CTestMenuView(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName); + + + /** + * NOTE: This function must be call within deriving class ConstructL + * the second phase constructor ConstructL to safely construct things + * that can leave + * @param aConsole, console to display menu + * @param aParent, parent menu + * @param aName, name of current menu to be set + * @param aLastMenu, whether the current has child menu + */ + IMPORT_C void ConstructL(); + + protected: + /** + * Print line + * @param aPrint, descriptor of message to be printed + */ + IMPORT_C void Print( const TDesC& aPrint); + + /** + * Multi line print if message exceeds one line + * @param aPrint, descriptor of message to be printed + */ + IMPORT_C void PrintMulti( const TDesC& aPrint ); + + /** + * Add item to menu + * @param aItem, item of current menu + */ + IMPORT_C void AddItemL ( const TDesC& aItem ); + + /** + * Delete an item from menu + * @param aIndex, index of item to be deleted + */ + IMPORT_C void DeleteItem ( TInt aIndex ); + + /** + * Get last key pressed + * @return code of last key pressed + */ + IMPORT_C TKeyCode LastKeyPressed(); + + /** + * Determine whether there are items added to iItems + * @return whether item is empty + */ + IMPORT_C TBool ItemsCreated(); + + /** + * Get the position that the cursor is point to in the items + * @return index of current cursor pointing item in iItems + */ + IMPORT_C TInt CurrentIndex(); + + /** + * Get the position that the cursor is point to on the screen + * @return index of current cursor pointing item on screen + */ + IMPORT_C TInt CurrentPosition(); + + /** + * Get the item + * @return reference of item + */ + IMPORT_C TPtrC ItemL(TInt aIndex); + + /** + * Count the number of items in the current menu + * @return number of items in the current menu + */ + IMPORT_C TInt ItemCount() const; + + /** + * Reads user input into the start of the descriptor aDes + * @param aDes, descriptor to store input string + */ + IMPORT_C void ReadString( TDes& aDes ); + + protected: // New functions + + /** + * Append text before original text. + */ + void AppendBefore( TInt aLineNum, TDes& aLine ); + + protected: // Data + CDesCArrayFlat* iItems; // View items + + TInt iPosOnScreen; // Position on display + TInt iFirst; // First displayed item + TInt iLast; // Last displayed item + TInt iItemCount; // Last Item + TSize iSize; // Display size + TInt iScreenSize; // "Work area" size + TInt iDirection; // Scrolling direction + TInt iStart; // Scrolling position + TInt iPrevPos; // Previous position in scrolling + TKeyCode iKey; // Last key pressed + + }; + + +#endif //TESTMENUVIEW_H diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/inc/testplaybackview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/inc/testplaybackview.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,178 @@ +/* +* Copyright (c) 2002 - 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 view displaying basic playback state and feature +* +*/ + +#ifndef TESTPLAYBACKVIEW_H +#define TESTPLAYBACKVIEW_H + +/* INCLUDES */ +#include "testBaseview.h" +#include "testplaybackviewobserver.h" + +/* DATA TYPE */ +_LIT(KTxtTestPlaybackView, "TestPlaybackView"); + +/* FORWARD DECLARATION*/ +class MTestPlaybackViewObserver; + +/** + * UI of playback test + * + * @lib testplaybackutility.lib + * @since S60 v3.0 + */ +class CTestPlaybackView : public CTestBaseView + { +public: + + IMPORT_C static CTestPlaybackView* NewL(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger); + + IMPORT_C virtual ~CTestPlaybackView(); + + /** + * Add observer + * @since S60 v3.0 + * @param aObs an observer to add + */ + IMPORT_C void AddObserver(MTestPlaybackViewObserver* aObs); + + /** + * Update current index in the playlist + * @param aIndex current index + * @param aTotalItem total index + */ + IMPORT_C void UpdateItemIndex(TInt aIndex, TInt aTotalItem); + + /** + * Update position in the song + * @param aPosition position + * @param aDuration duration + */ + IMPORT_C void UpdateProgress(TInt aPosition, TInt aDuration); + + /** + * Update volume + * @param aVolume current volume + * @param @aMaxVolume maximum volume + */ + IMPORT_C void UpdateVolume(TInt aVolume, TInt aMaxVolume); + + /** + * Update artist and song name + * @param aArtist artist name + * @param aSongName song name + */ + IMPORT_C void UpdateSongInfo(const TDesC& aArtist, const TDesC& aSongName); + + /** + * Handles state changes in playbackutility + */ + IMPORT_C void StateChanged(TTestPlaybackState aState); + +// from base class CTestBaseView + /** + * Initialization of a view before first time activation + */ + void InitializeViewL(); + + /** + * Cleanup the child view before deactivate/destroy view + */ + void CleanupViewL(); + + /** + * Display this view + */ + void DisplayViewL(); + + /** + * Process keypresses on this view - called by ConsoleMain + * @param aSelection, key pressed + * @param aContinue, whether to continue or stop scheduler + */ + void SelectL( TKeyCode aSelection, TBool& aContinue ); + + /** + * Update display from timer - called by ConsoleMain + */ + void TimerUpdate(); + + +protected: //protected class + class TPlaybackStatus + { + public: + TBool iBackwardSeek; + TBool iForwardSeek; + TBool iPlaying; + TBool iPause; + TInt iVolume; + TInt iMaxVolume; + TInt iProgressPos; + TInt iProgressDur; + TInt iItemIndex; + TInt iMaxItems; + }; + +private: + + CTestPlaybackView(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger); + + void ConstructL(); + + /** + * The following functions redraw the playback view + * base one iCurrentStatus except song info + */ + void RedrawIndex(); + void RedrawProgress(); + void RedrawVolume(); + void RedrawPlayerStatue(); + +private: //data + /** + * Screen size + */ + TSize iDisplaySize; + + /** + * Player status + */ + TPlaybackStatus iCurrentStatus; + + /** + * Send user command to View observer + * Not own. + */ + MTestPlaybackViewObserver* iTestPlaybackViewObs; + + /** + * Logger purpose + * Not own. + */ + CStifLogger* iLogger; + + + }; + +#endif //TESTPLAYBACKVIEW_H + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/inc/testplaybackviewobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/inc/testplaybackviewobserver.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2002 - 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: handle callback messages return from testplaybackview +* +*/ + +#ifndef TESTPLAYBACKVIEWOBSERVER_H +#define TESTPLAYBACKVIEWOBSERVER_H + + +/* TestPlaybackView commands. Refer TMPXPlaybackCommand if possible*/ +enum TTestPlaybackViewCommand + { + ETPbViewCmdPlay, + ETPbViewCmdPause, + ETPbViewCmdStop, + ETPbViewCmdNext, + ETPbViewCmdPrevious, + ETPbViewCmdStartSeekForward, + ETPbViewCmdStartSeekBackward, + ETPbViewCmdStopSeeking, + ETPbViewCmdIncreaseVolume, + ETPbViewCmdDecreaseVolume, + ETPbViewCmdClose, + ETPbViewCmdEnd, + }; + +/* TestPlaybackView playback state. Refer TMPXPlaybackState if possible*/ +enum TTestPlaybackState + { + ETPbStateNotInitialised, + ETPbStateInitialising, + ETPbStatePlaying, + ETPbStatePaused, + ETPbStateStopped, + ETPbStateSeekingForward, + ETPbStateSeekingBackward, + ETPbStateShuttingDown, + ETPbStateBuffering, + ETPbStateDownloading, + ETPbStatEnd, + }; + +/** + * Handle callback message from CTestPlaybackView + * + * This interface class serves as generalized message issued from + * view class. + * + * @lib testplaybackutility.lib + * @since S60 v3.0 + */ +class MTestPlaybackViewObserver + { +public: + + /** + * Handle View received command + * @param aCmd a command received in view + */ + virtual void HandleUiCommandL(TTestPlaybackViewCommand aCmd) = 0; + + }; + + +#endif // TESTPLAYBACKVIEWOBSERVER_H diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/inc/testutility.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/inc/testutility.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,48 @@ +/* +* Copyright (c) 2002 - 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: Help tools +* +*/ + +#ifndef TESTUTILITY_H +#define TESTUTILITY_H + +#include +#include + +// FORWARD DECLARATION +class CStifLogger; + +class TestUtility + { + public: + /** + * Convert a string to decemial + * @param aStr a string to convert + */ + IMPORT_C static TInt ConvertStrToDecL(const TDesC& aStr); + + /** + * Log message to RDebug and Stiftestlogger if any + * @param aLogger a STIF logger to use (can be NULL) + * @param aFmt a string contains parameter list + * @param ... + */ + IMPORT_C static void TestLog(CStifLogger* aLogger, + TRefByValue< const TDesC > aFmt, + ...); + + }; + +#endif //TESTUTILITY_H diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/src/consolemain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/src/consolemain.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,298 @@ +/* +* Copyright (c) 2002 - 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: CConsoleMain class implementation +* +*/ + +// INCLUDES +#include "testbaseview.h" +#include "consolereader.h" +#include "scrollertimer.h" +#include "consolemain.h" + +// CONSTANTS +_LIT(KNameTxt,"TEST FRAMEWORK"); + +// --------------------------------------------------------------------------- +// Class: CConsoleMain +// Method: NewL +// Description: Construct the console main class +// Parameters: None +// Return Values: CConsoleMain* New object +// --------------------------------------------------------------------------- +// +EXPORT_C CConsoleMain* CConsoleMain::NewL(CActiveScheduler* aScheduler) + { + + CConsoleMain* self = new ( ELeave ) CConsoleMain(aScheduler); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + + } + +// --------------------------------------------------------------------------- +// Method: ActivateL +// Description: Activate a view and start the view handling +// Parameters: aRootView, a root view of test app +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CConsoleMain::ActivateL( CTestBaseView* aRootView ) + { + + iReader = CConsoleReader::NewL( this, iConsole ); + iScroller = CScrollerTimer::NewL ( this ); + + // Construct keystroke reader + iScroller->Start(); + + // Print the main menu + iCurrentView = aRootView; + iCurrentView->DisplayViewL(); + + // Start to process keyboard events + iReader->Start(); + + iSchedulerStarted = TRUE; + iScheduler->Start(); + } + +// --------------------------------------------------------------------------- +// Method: Stop +// Description: Stop refreshing menu and the timer +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CConsoleMain::Stop() + { + if(iReader) + { + iReader->Cancel(); + delete iReader; + iReader = NULL; + } + + if(iScroller) + { + iScroller->Cancel(); + delete iScroller; + iScroller = NULL; + } + + if(iSchedulerStarted) + { + iScheduler->Stop(); + iSchedulerStarted = FALSE; + } + } + +// --------------------------------------------------------------------------- +// Method: ReadString +// Description: Reads user input into the start of the descriptor aDes +// Parameters: TDes& aDes :out: a user input string +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CConsoleMain::ReadString( TDes& aDes ) + { + TChar inputKey; + TInt count = 0; + + aDes.Zero(); + for (;;) + { + inputKey = (TInt) iConsole->Getch(); + + if ( inputKey == EKeyEnter || inputKey == EKeyOK ) + { + break; + } + + if(inputKey == EKeyBackspace) + { + if (count > 0) + { + iConsole->Printf(_L("%C"), (TInt)inputKey); + aDes.Delete(--count,1); + } + } + else if(inputKey.IsPrint()) + { + iConsole->Printf(_L("%C"), (TInt)inputKey); + aDes.Append(inputKey); + count++; + } + } + } + +// --------------------------------------------------------------------------- +// Method: ~CConsoleMain +// Description: Destructor +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +CConsoleMain::~CConsoleMain( ) + { + delete iReader; + + delete iScroller; + + delete iConsole; + } + +// --------------------------------------------------------------------------- +// Method: CurrentView +// Description: Return current View +// Parameters: None +// Return Values: CTestBaseView iCurrentView +// --------------------------------------------------------------------------- +// +CTestBaseView* CConsoleMain::CurrentView() + { + return iCurrentView; + } + +// --------------------------------------------------------------------------- +// Method: GetConsole +// Description: Returns the console +// Parameters: None +// Return Values: CConsoleBase* Console +// --------------------------------------------------------------------------- +// +CConsoleBase* CConsoleMain::GetConsole() + { + return iConsole; + } + +// --------------------------------------------------------------------------- +// Method: TimerUpdate +// Description: Updates current menu from timer +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +void CConsoleMain::TimerUpdate() + { + iCurrentView->TimerUpdate(); + } + + +// --------------------------------------------------------------------------- +// Method: KeyPressed +// Description: Process keyboard events. Print new menu +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +void CConsoleMain::KeyPressedL() + { + + TBool cont = ETrue; + + // Read the key + TKeyCode key = iConsole->KeyCode(); + + // Let the menu handle the key press + TRAPD( err, + iCurrentView->SelectL( key, cont ); + ); + if( err != KErrNone ) + { + User::InfoPrint( + _L("Processing keystroke failed") ); + } + + if( iCurrentView ) + { + iCurrentView->DisplayViewL(); + // For next key event + iReader->Start(); + } + } + +// --------------------------------------------------------------------------- +// Method: CConsoleMain +// Description: Constructor. +// Initialize non-zero member variables. +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +CConsoleMain::CConsoleMain(CActiveScheduler* aScheduler) + { + iScheduler = aScheduler; + iSchedulerStarted = FALSE; + } + +// --------------------------------------------------------------------------- +// Method: ConstructL +// Description: Second level constructor. +// Construct the console +// Construct module and case containers +// Retrieve command line parameters +// Connect to test engine +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +void CConsoleMain::ConstructL( ) + { + // Construct the console + iConsole = Console::NewL( KNameTxt, + TSize( KConsFullScreen, KConsFullScreen ) ); + + iConsole->Printf(_L("\nViewTest Framework\n")); + } + +// --------------------------------------------------------------------------- +// Method: NextViewL +// Description: activate child view +// Parameters: aChild, a child view +// Return Values: None +// --------------------------------------------------------------------------- +// +void CConsoleMain::NextViewL(CTestBaseView* aChild) + { + iCurrentView = aChild; + + // Start to process keyboard events + //<-iReader-StartL() will be call in CConsoleMain::KeyPressedL() + // otherwise, Panic because of activiting an activated CActive + //iReader->StartL(); + } + +// --------------------------------------------------------------------------- +// Method: CurrentViewDoneL +// Description: Remove current view and active parent view if any +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +void CConsoleMain::CurrentViewDoneL() + { + //iCurrentView = (iCurrentView) ? iCurrentView->Parent() : NULL; + if(iCurrentView != NULL) + { + Stop(); + } + } + + + + + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/src/consolereader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/src/consolereader.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,214 @@ +/* +* Copyright (c) 2002 - 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: CConsoleReader class implementation +* +*/ + +#include "consolereader.h" +#include "consolemain.h" + +/* +------------------------------------------------------------------------------- + + Class: CConsoleReader + + Method: CConsoleReader + + Description: Constructor. + + Parameters: CConsoleMain* aMain: in: Pointer to main console + CConsoleBase* aConsole: in: Console pointer + + Return Values: None + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +CConsoleReader::CConsoleReader( CConsoleMain* aMain, + CConsoleBase* aConsole ): + CActive( EPriorityStandard ) + { + + iMain = aMain; + iConsole = aConsole; + + CActiveScheduler::Add( this ); + + } + +/* +------------------------------------------------------------------------------- + + Class: CConsoleReader + + Method: ~CConsoleReader + + Description: Destructor + + Parameters: None + + Return Values: None + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +CConsoleReader::~CConsoleReader( ) + { + + Cancel(); + + } + +/* +------------------------------------------------------------------------------- + + Class: CConsoleReader + + Method: ConstructL + + Description: Second level constructor. + + Parameters: None + + Return Values: None + + Errors/Exceptions: + + Status: Draft + +------------------------------------------------------------------------------- +*/ +void CConsoleReader::ConstructL( ) + { + } + +/* +------------------------------------------------------------------------------- + + Class: CConsoleReader + + Method: DoCancel + + Description: Cancel request + + Parameters: None + + Return Values: None + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +void CConsoleReader::DoCancel() + { + + iConsole->ReadCancel(); + + } + +/* +------------------------------------------------------------------------------- + + Class: CConsoleReader + + Method: NewL + + Description: Construct the console main class + + Parameters: CConsoleMain* aMain: in: Pointer to main console + CConsoleBase* aConsole: in: Console pointer + + Return Values: CConsoleReader* New object + + Errors/Exceptions: Leaves if memory allocation fails or + ConstructL leaves. + + Status: Draft + +------------------------------------------------------------------------------- +*/ +CConsoleReader* CConsoleReader::NewL( CConsoleMain* aMain, + CConsoleBase* aConsole ) + { + + CConsoleReader* self = + new ( ELeave ) CConsoleReader( aMain, aConsole ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + + } + +/* +------------------------------------------------------------------------------- + + Class: CConsoleReader + + Method: RunL + + Description: Process keyboard events. Print new menu + + Parameters: None + + Return Values: None + + Errors/Exceptions: Leaves if SelectL leaves + + Status: Draft + +------------------------------------------------------------------------------- +*/ +void CConsoleReader::RunL() + { + + User::LeaveIfError(iStatus.Int()); + iMain->KeyPressedL(); + + } + +/* +------------------------------------------------------------------------------- + + Class: CConsoleReader + + Method: Start + + Description: Construct menu objects and start the menu handling + + Parameters: None + + Return Values: None + + Errors/Exceptions: + + Status: Draft + +------------------------------------------------------------------------------- +*/ +void CConsoleReader::Start( ) + { + + // Start to process keyboard events + iConsole->Read(iStatus); + SetActive(); + } diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/src/scrollertimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/src/scrollertimer.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,242 @@ +/* +* Copyright (c) 2002 - 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: CScrollerTimer class implementation +* +*/ + +#include "scrollertimer.h" +#include "consolemain.h" + +// CONSTANTS +const TInt KScrollPeriod = 300000; // Scrolling speed + +/* +------------------------------------------------------------------------------- + + Class: CScrollerTimer + + Method: ConstructL + + Description: Second level constructor + + Parameters: CConsoleMain* :in: Pointer to main console + + Return Values: None + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +void CScrollerTimer::ConstructL( CConsoleMain* aMain ) + { + + // Store module information + iMain = aMain; + iTimer.CreateLocal(); + + CActiveScheduler::Add ( this ); + + } + +/* +------------------------------------------------------------------------------- + + Class: CScrollerTimer + + Method: CScrollerTimer + + Description: Constructor. + + Parameters: None + + Return Values: None + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +CScrollerTimer::CScrollerTimer() : CActive (CActive::EPriorityStandard) + { + + } + +/* +------------------------------------------------------------------------------- + + Class: CScrollerTimer + + Method: ~CScrollerTimer + + Description: None + + Parameters: None + + Return Values: None + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +CScrollerTimer::~CScrollerTimer( ) + { + + Cancel(); + iTimer.Close(); + + } + +/* +------------------------------------------------------------------------------- + + Class: CScrollerTimer + + Method: DoCancel + + Description: None + + Parameters: None + + Return Values: None + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +void CScrollerTimer::DoCancel( ) + { + + iTimer.Cancel(); + + } + +/* +------------------------------------------------------------------------------- + + Class: CScrollerTimer + + Method: NewL + + Description: Construct a new CScrollerTimer object + + Parameters: CConsoleMain* :in: Pointer to main console + + Return Values: CScrollerTimer* New CScrollerTimer object + + Errors/Exceptions: Leaves if memory allocation or ConstructL leaves + + Status: Draft + +------------------------------------------------------------------------------- +*/ +CScrollerTimer* CScrollerTimer::NewL( CConsoleMain* aMain ) + { + + CScrollerTimer* self = new ( ELeave ) CScrollerTimer(); + CleanupStack::PushL( self ); + self->ConstructL( aMain ); + CleanupStack::Pop( self ); + return self; + + } + +/* +------------------------------------------------------------------------------- + + Class: CScrollerTimer + + Method: RunError + + Description: None + + Parameters: None + + Return Values: None + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +TInt CScrollerTimer::RunError( TInt aError) + { + + return aError; + + } + +/* +------------------------------------------------------------------------------- + + Class: CScrollerTimer + + Method: RunL + + Description: None + + Parameters: None + + Return Values: None + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +void CScrollerTimer::RunL( ) + { + + iMain->TimerUpdate(); + + // Restart request + SetActive(); + iTimer.After ( iStatus, KScrollPeriod ); + + } + +/* +------------------------------------------------------------------------------- + + Class: CScrollerTimer + + Method: StartL + + Description: None + + Parameters: None + + Return Values: None + + Errors/Exceptions: None + + Status: Draft + +------------------------------------------------------------------------------- +*/ +void CScrollerTimer::Start( ) + { + + SetActive(); + iTimer.After ( iStatus, KScrollPeriod ); + + } diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/src/testbaseview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/src/testbaseview.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,147 @@ +/* +* Copyright (c) 2002 - 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: TestView module implementation +* +*/ + +// INCLUDE FILES +#include +#include "testBaseview.h" +#include "consolemain.h" + +// +//=========================================================================== * +// Implementation for Class CTestBaseView * +//=========================================================================== * +// + +// --------------------------------------------------------------------------- +// Method: ~CTestBaseView +// Description: Destructor +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C CTestBaseView::~CTestBaseView() + { + if(iChild) + delete iChild; + + } + +// --------------------------------------------------------------------------- +// Method: Name +// Description: Returns menu name +// Parameters: None +// Return Values: TDesC& - View Name +// --------------------------------------------------------------------------- +// +EXPORT_C const TDesC& CTestBaseView::Name( ) const + { + return iName; + } + +// --------------------------------------------------------------------------- +// Method: SetName +// Description: Sets menu name +// Parameters: TDesC& aName :in: Name to be set +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestBaseView::SetName ( const TDesC& aName ) + { + iName = aName; + } + +// --------------------------------------------------------------------------- +// Method: SetParent +// Description: Sets menu parent menu. +// Parameters: CTestBaseView* aMenu :in: Parent View +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestBaseView::SetParent ( CTestBaseView* aView ) + { + iParent = aView; + } + +// --------------------------------------------------------------------------- +// Method: Parent +// Description: Get the parent view +// Parameters: None +// Return Values: CTestBaseView* Parent view +// --------------------------------------------------------------------------- +// +EXPORT_C CTestBaseView* CTestBaseView::Parent() + { + return iParent; + } + +// --------------------------------------------------------------------------- +// Method: CTestBaseView +// Description: Default Constructor +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C CTestBaseView::CTestBaseView(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName) + { + iConsole = aConsoleMain->GetConsole(); + iConsoleMain = aConsoleMain; + iParent = aParent; + iChild = NULL; + iName = aName; + } + +// --------------------------------------------------------------------------- +// Method: NextViewL +// Description: Creating child view +// Parameters: aChild - a new child view +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestBaseView::NextViewL(CTestBaseView* aChild) + { + iConsoleMain->NextViewL(aChild); + } + +// --------------------------------------------------------------------------- +// Method: NextViewL +// Description: Creating child view +// Parameters: aChild - a new child view +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestBaseView::CurrentViewDoneL() + { + iConsoleMain->CurrentViewDoneL(); + } + +// ================= OTHER EXPORTED FUNCTIONS ================================= + +// ----------------------------------------------------------------------------- +// E32Dll is a DLL entry point function +// Returns: KErrNone: No error +// ----------------------------------------------------------------------------- +// +#ifndef EKA2 +GLDEF_C TInt E32Dll( + TDllReason /*aReason*/) // Reason + { + return(KErrNone); + + } +#endif diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/src/testmenuview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/src/testmenuview.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,598 @@ +/* +* Copyright (c) 2002 - 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: part of testviewframework. +* +*/ + +// INCLUDE FILES +#include +#include "testbaseview.h" +#include "consolemain.h" +#include "testmenuview.h" + +// CONSTANTS +const TInt KMenuOverhead = 4; // overhead +const TInt KMaxLineLength = 80; // Longest supported line length +const TInt KArrGranularity = 4; // DesC array granularity + +// LOCAL FUNCTION PROTOTYPES +LOCAL_C void LimitedAppend( TDes& aOriginal, const TDesC& aAppend); + +// ==================== LOCAL FUNCTIONS ======================================= + +LOCAL_C void LimitedAppend( TDes& aOriginal, const TDesC& aAppend) + { + + TInt spaceLeft = aOriginal.MaxLength() - aOriginal.Length(); + + if (spaceLeft > aAppend.Length()) + { + aOriginal.Append ( aAppend ); + } + else + { + aOriginal.Append ( aAppend.Left ( spaceLeft ) ); + } + + } + +// +//=========================================================================== * +// Implementation for Class CTestBaseView * +//=========================================================================== * +// + +// --------------------------------------------------------------------------- +// Method: ~CTestMenuView +// Description: Destructor +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C CTestMenuView::~CTestMenuView() + { + iItems->Reset(); + delete iItems; + } + +// --------------------------------------------------------------------------- +// Method: DisplayViewL +// Description: Prints the menu +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestMenuView::DisplayViewL() + { + CTestBaseView::DisplayViewBase(); + + TBuf line; + + // Clear display + iConsole->ClearScreen(); + + // Print menu title and header + Print( Name() ); + + TInt oldItemCount = iItemCount; + + iItemCount = ItemCount(); + + // If first time in view, update start and end positions + if( (iFirst == iLast) || // First time here.. + ( iLast >= iItemCount ) || + ( oldItemCount != iItemCount ) ) // View size changed + { + iLast = iItemCount - 1; + iPosOnScreen = 0; + + // If "overflow", then adjust the end + if (iLast > iScreenSize ) + { + iLast = iScreenSize; + } + } + + // Print items + for ( TInt i = iFirst; i <= iLast; i++ ) + { + line.Zero(); + // Append text before line + AppendBefore( i, line ); + // Get the menu line + LimitedAppend ( line, ItemL(i) ); + // Print the line + Print(line); + } + } + +// ----------------------------------------------------------------------------- +// Method: SelectL +// Description: Process keypresses in view. updates position +// Parameters: TKeyCode aSelection :in: Key +// TBool& aContinue :out: Has user pressed "Quit" +// Return Values: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTestMenuView::SelectL( TKeyCode aSelection, TBool& aContinue ) + { + iKey = aSelection; + +// iConsole->Printf(_L("%d"),iKey); + + switch ( (TInt) aSelection ) + { + // SelectL item + case EKeyEnter: + case EKeyRightArrow: + HandleRightKeyL(); + break; + // Going back + case EKeyLeftArrow: + HandleLeftKeyL(); + break; + // Number key + case 92: // '1' + case 97: // '2' + case 100: // '3' + // case '2': + // case '3': + // case '4': + // case '5': + // case '6': + // case '7': + // case '8': + // case '9': + // case '0': + HandleNumKeyL(); + break; + // Go down + case EKeyDownArrow: + if ( iFirst + iPosOnScreen == iItemCount - 1 ) + { + // If end of the list, go to beginning + iLast = iLast - iFirst; + iFirst = 0; + iPosOnScreen = 0; + } + else + { + if ( iPosOnScreen == iScreenSize ) + { + // If in end of screen, update items + if ( iLast != (iItemCount - 1) ) + { + // If not end of the list, then update first and last + // but do not update position in screen. + iLast++; + iFirst++; + } + } + else + { + // Going down "in-screen", no need to update items + iPosOnScreen++; + } + } + break; + + // Go Up + case EKeyUpArrow: + if ( iFirst + iPosOnScreen == 0 ) + { + // If in the beginning of the list + + if ( iItemCount <= iScreenSize ) + { + // Wrap around when the list is not full + iPosOnScreen = iItemCount-1; + } + else + { + // Wrap around when there are more items than + // can be shown at once. + iPosOnScreen = iScreenSize; + iLast = iItemCount-1; + iFirst = iItemCount - iPosOnScreen - 1; + } + } + else if ( iPosOnScreen == 0 ) + { + // If not at the beginning of the list, then update first and + // last but do not update position in screen. + if ( iFirst != 0 ) + { + iLast--; + iFirst--; + } + } + else + { + // Going up "in-screen", no need to update items + iPosOnScreen--; + } + + break; + + // Additional keys + case EKeyHome: + iPosOnScreen = 0; + iFirst = 0; + iLast = iScreenSize; + + if (iLast > iItemCount-1 ) + { + iLast = iItemCount-1; + } + break; + + case EKeyEnd: + iPosOnScreen = iScreenSize; + iLast = iItemCount-1; + iFirst = iLast - iScreenSize; + + if (iFirst < 0) + { + iFirst = 0; + iPosOnScreen = iLast-1; + } + break; + + case EKeyPageUp: + iFirst = iFirst - iScreenSize - 1; + iLast = iLast - iScreenSize - 1; + + if ( iFirst < 0 ) + { + iFirst = 0; + iPosOnScreen = 0; + iLast = iScreenSize; + if (iLast > iItemCount-1 ) + { + iLast = iItemCount-1; + } + } + break; + + case EKeyPageDown: + iFirst = iFirst + iScreenSize + 1; + iLast = iLast + iScreenSize + 1; + + // Going too far + if (iLast > iItemCount-1) + { + iLast = iItemCount-1; + iFirst = iLast - iScreenSize; + iPosOnScreen = iScreenSize; + } + + // Ok, list is smaller than screen + if (iFirst < 0 ) + { + iFirst = 0; + iLast = iItemCount-1; + iPosOnScreen = iLast; + } + + break; + case EKeyEscape: + aContinue = EFalse; + CurrentViewDoneL(); + return; + default: // Bypass the keypress + break; + } + // Continue normally and keep in the same menu + aContinue = ETrue; + } + +// ----------------------------------------------------------------------------- +// Method: TimerUpdate +// Description: TimerUpdate +// Parameters: None +// Return Values: None +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTestMenuView::TimerUpdate() + { + TInt count = ItemCount(); + // If list is empty, do not scroll. + if ( count < 1 ) + { + return; + } + else if( iFirst + iPosOnScreen > count ) + { + iFirst = iPosOnScreen = 0; + } + + // If item selection is updated, then restart scrolling + if (iPrevPos != iFirst + iPosOnScreen) + { + iPrevPos = iFirst + iPosOnScreen; + iStart = 0; + iDirection = 1; + } + + // If menu item have not been changed after last timer, then + // start scrolling + TName name(KNullDesC); + TRAPD(err, name = ItemL(iFirst + iPosOnScreen)); + if(err != KErrNone) + return; + if ( name.Length() > iSize.iWidth) + { + + TInt y = iConsole->WhereY(); + TInt x = iConsole->WhereX(); + TBuf<80> iTmp; + + iStart = iStart + iDirection; + + // "Right end" + if ( iStart + iSize.iWidth > name.Length() +KMenuOverhead ) + { + iStart--; + iDirection = -1; + } + + // "Left end" + if ( iStart == -1 ) + { + iStart++; + iDirection = 1; + } + + iTmp=_L(" *"); + LimitedAppend( iTmp, name.Mid ( iStart ) ); + + iConsole->SetPos( 0, iPosOnScreen+1); + iConsole->Printf ( iTmp.Left( iSize.iWidth -2 ) ); + + iConsole->SetPos(x,y); + } + } + +// --------------------------------------------------------------------------- +// Method: CTestMenuView +// Description: C++ default constructor +// Parameters: CConsoleMain* aConsole :in: Pointer to main console +// CTestBaseView* aParent :in: Parent View +// const TDesC& aName :in: Menu name +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C CTestMenuView::CTestMenuView(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName) + : CTestBaseView(aConsoleMain, aParent, aName) + { + iDirection = 1; + iPrevPos = -1; // Invalid starting value + } + +// --------------------------------------------------------------------------- +// Method: ConstructL +// Description: Second level constructor. +// Parameters: None +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestMenuView::ConstructL() + { + iItems = new (ELeave) CDesCArrayFlat(KArrGranularity); + + // Get display size + const TInt KOverHead = 5; + iSize = iConsole->ScreenSize(); + iScreenSize = iSize.iHeight - KOverHead; // Size available for menus + + InitializeViewL(); + } + +// --------------------------------------------------------------------------- +// Method: Print +// Description: Prints one line text and changes to next line. If line is +// too long, overhead is not printed.. +// Parameters: TDesC& aPrint :in: Text to be printed +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestMenuView::Print( const TDesC& aPrint ) + { + iConsole->Printf( aPrint.Left( iSize.iWidth - KMenuOverhead ) ); + iConsole->Printf(_L("\n")); + } + +// --------------------------------------------------------------------------- +// Method: PrintMulti +// Description: Prints text. If line is too long, it will be continued to +// following lines. +// Parameters: const TDesC& aPrint :in: Text to print +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestMenuView::PrintMulti( const TDesC& aPrint ) + { + // Get current line + const TInt KMenuOverHead = 2; + TInt y = iConsole->WhereY(); + + const TInt KLineLen =iSize.iWidth - 4; + TBuf oneLine; + + // Loop through the line + for (TInt i = 0; i < aPrint.Length(); i++) + { + oneLine.Append( aPrint[i] ); + + // Print one line + if (oneLine.Length() == KLineLen ) + { + oneLine.Append (_L("\n")); + iConsole->Printf(oneLine); + oneLine=_L(""); + y++; + } + + // Prevent display scrolling + if ( y == iScreenSize + KMenuOverHead ) + { + oneLine=_L(""); + break; + } + } + + // Print last part if required + if ( oneLine.Length() != 0 ) + { + oneLine.Append (_L("\n")); + iConsole->Printf(oneLine); + } + } + +// --------------------------------------------------------------------------- +// Method: AddItem +// Description: Add new item to menu +// Parameters: TDesC& aItem :in: descriptor to be added +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestMenuView::AddItemL(const TDesC& aItem) + { + iItems->AppendL(aItem); + } + +// --------------------------------------------------------------------------- +// Method: DeleteItem +// Description: Delete an item from menu +// Parameters: TInt aIndex :in: position of item in Items +// Return Values: None +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestMenuView::DeleteItem( TInt aIndex ) + { + iItems->Delete(aIndex); + iItems->Compress(); + } + +// --------------------------------------------------------------------------- +// Method: LastKeyPressed +// Description: Returns last key pressed +// Parameters: None +// Return Values: TKeyCode The last key pressed +// --------------------------------------------------------------------------- +// +EXPORT_C TKeyCode CTestMenuView::LastKeyPressed() + { + return iKey; + } +// --------------------------------------------------------------------------- +// Method: ItemsCreated +// Description: Determine whether there are items added to iItems +// Parameters: None +// Return Values: TBool Whether iItems contain content +// --------------------------------------------------------------------------- +// +EXPORT_C TBool CTestMenuView::ItemsCreated() + { + return ( iItems->Count() != 0 ); + } + +// --------------------------------------------------------------------------- +// Method: CurrentIndex +// Description: Get the position that the cursor is point to in the items +// Parameters: None +// Return Values: TInt Position of cursor in items array +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CTestMenuView::CurrentIndex() + { + return iFirst + iPosOnScreen; + } + +// --------------------------------------------------------------------------- +// Method: CurrentPosition +// Description: Get the position that the cursor is point to on the screen +// Parameters: None +// Return Values: TInt Position of cursor on screen +// --------------------------------------------------------------------------- +// +EXPORT_C TInt CTestMenuView::CurrentPosition() + { + return iPosOnScreen; + } + +// --------------------------------------------------------------------------- +// Method: Menu +// Description: Get the item +// Parameters: TInt aIndex :in index of the entry +// Return Values: TDesC& entry descriptor +// --------------------------------------------------------------------------- +// +EXPORT_C TPtrC CTestMenuView::ItemL(TInt aIndex) + { + if(aIndex < 0 || iItemCount <= aIndex) + { + User::Leave(KErrArgument); + } + //return iItems->operator[](iFirst + aIndex); + return iItems->operator[](aIndex); + } + +// ----------------------------------------------------------------------------- +// Method: ItemCount +// Count the number of items in the current view +// ----------------------------------------------------------------------------- +// +EXPORT_C TInt CTestMenuView::ItemCount() const + { + return iItems->Count(); + } + +// ----------------------------------------------------------------------------- +// Method: ReadString +// Reads user input into the start of the descriptor aDes +// ----------------------------------------------------------------------------- +// +EXPORT_C void CTestMenuView::ReadString( TDes& aDes ) + { + iConsoleMain->ReadString(aDes); + } + +// ----------------------------------------------------------------------------- +// Method: AppendBefore +// Description: Append text before line. +// Parameters: TInt aLine :in: line number +// TDes& aLine :in: line text +// Return Values: None +// ----------------------------------------------------------------------------- +// +void CTestMenuView::AppendBefore( TInt aLineNum, TDes& aLine ) + { + if( ( aLine.MaxLength() - aLine.Length() ) < 2 ) + { + return; + } + + // If printing active line, print the marker + if ( aLineNum == iPosOnScreen + iFirst ) + { + aLine.Append( _L(" *") ); + } + else + { + aLine.Append( _L(" ") ); + } + } diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/src/testplaybackview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/src/testplaybackview.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,400 @@ +/* +* Copyright (c) 2002 - 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 view displaying basic playback state and feature +* +*/ + +#include +#include +#include "testplaybackviewobserver.h" +#include "testplaybackview.h" + +// CONSTANTS +_LIT(KSpacer, " "); +_LIT(KPlay, " Play-1 "); +_LIT(KPlaySel, "(Play-1)"); +_LIT(KBackward, " <<-2 "); +_LIT(KForward, " >>-3 "); +_LIT(KStop, " Stop-4 "); +_LIT(KStopSel, "(Stop-4)"); +_LIT(KFastRewind, " FR-5 "); +_LIT(KFastRewindSel, "(FR-5)"); +_LIT(KFastForward, " FF-6 "); +_LIT(KFastForwardSel, "(FF-6)"); +_LIT(KPause, " Pause-7 "); +_LIT(KPauseSel, "(Pause-7)"); + +_LIT(KExit, "Exit-Esc" ); + +const TInt KSongInfoYOffset = 10; +const TInt KDisplayScreenWidthOffset = 10; + +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// Symbian 2-phrase constructor +// --------------------------------------------------------------------------- +// +EXPORT_C CTestPlaybackView* CTestPlaybackView::NewL(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger) + { + CTestPlaybackView* self = new (ELeave) CTestPlaybackView(aConsoleMain, + aParent, + aName, + aLogger); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + + } + +// --------------------------------------------------------------------------- +// C++ destructor +// --------------------------------------------------------------------------- +// +EXPORT_C CTestPlaybackView::~CTestPlaybackView() + { + } + +// --------------------------------------------------------------------------- +// Add observer +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestPlaybackView::AddObserver(MTestPlaybackViewObserver* aObs) + { + iTestPlaybackViewObs = aObs; + } + +// --------------------------------------------------------------------------- +// Update current index +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestPlaybackView::UpdateItemIndex(TInt aIndex, TInt aTotalItem) + { + iCurrentStatus.iItemIndex = aIndex; + iCurrentStatus.iMaxItems = aTotalItem; + RedrawIndex(); + } + +// --------------------------------------------------------------------------- +// Update position in the song +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestPlaybackView::UpdateProgress(TInt aPosition, TInt aDuration) + { + iCurrentStatus.iProgressPos = aPosition; + iCurrentStatus.iProgressDur = aDuration; + RedrawProgress(); + } + +// --------------------------------------------------------------------------- +// Update volume +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestPlaybackView::UpdateVolume(TInt aVolume, TInt aMaxVolume) + { + iCurrentStatus.iVolume = aVolume; + iCurrentStatus.iMaxVolume = aMaxVolume; + RedrawVolume(); + } + +// --------------------------------------------------------------------------- +// Update artist and song name +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestPlaybackView::UpdateSongInfo(const TDesC& aArtist, + const TDesC& aSongName) + { + TInt y = iDisplaySize.iHeight/ 2 - 2; + //erase previous text + for(TInt i = 0; i < iDisplaySize.iWidth; i++) + { + iConsole->SetPos(i,y); + iConsole->Printf(_L(" ")); + iConsole->SetPos(i,y+1); + iConsole->Printf(_L(" ")); + } + iConsole->SetPos( + Max((iDisplaySize.iWidth - aArtist.Length())/2, 0), y++); + iConsole->Printf(_L("%S"), &aArtist); + iConsole->SetPos( + Max((iDisplaySize.iWidth - aSongName.Length())/2, 0), y); + iConsole->Printf(_L("%S"), &aSongName); + //DisplayViewL(); + } + +// --------------------------------------------------------------------------- +// Handles state changes in playbackutility +// --------------------------------------------------------------------------- +// +EXPORT_C void CTestPlaybackView::StateChanged(TTestPlaybackState aState) + { + + switch(aState) + { + case ETPbStateInitialising: + UpdateSongInfo(KNullDesC, _L("Opening file")); + case ETPbStateShuttingDown: + case ETPbStateBuffering: + case ETPbStateDownloading: + case ETPbStateStopped: + case ETPbStateNotInitialised: + iCurrentStatus.iPlaying = iCurrentStatus.iForwardSeek + = iCurrentStatus.iBackwardSeek = iCurrentStatus.iPause = EFalse; + break; + case ETPbStatePaused: + iCurrentStatus.iPlaying = iCurrentStatus.iForwardSeek + = iCurrentStatus.iBackwardSeek = EFalse; + iCurrentStatus.iPause = ETrue; + break; + case ETPbStatePlaying: + iCurrentStatus.iPause = iCurrentStatus.iForwardSeek + = iCurrentStatus.iBackwardSeek = EFalse; + iCurrentStatus.iPlaying = ETrue; + break; + case ETPbStateSeekingForward: + iCurrentStatus.iBackwardSeek = EFalse; + iCurrentStatus.iForwardSeek = ETrue; + break; + case ETPbStateSeekingBackward: + iCurrentStatus.iForwardSeek = EFalse; + iCurrentStatus.iBackwardSeek = ETrue; + break; + } + RedrawPlayerStatue(); + } + +// --------------------------------------------------------------------------- +// From class CTestBaseView. +// Initialization of a view before first time activation +// --------------------------------------------------------------------------- +// +void CTestPlaybackView::InitializeViewL() + { + iConsole->ClearScreen(); + RedrawProgress(); + RedrawVolume(); + UpdateSongInfo(KNullDesC, KNullDesC); + RedrawPlayerStatue(); + } + +// --------------------------------------------------------------------------- +// From class CTestBaseView. +// Cleanup the child view before deactivate/destroy view +// --------------------------------------------------------------------------- +// +void CTestPlaybackView::CleanupViewL() + { + } + +// --------------------------------------------------------------------------- +// From class CTestBaseView. +// Display this view +// --------------------------------------------------------------------------- +// +void CTestPlaybackView::DisplayViewL() + { + DisplayViewBase(); + RedrawIndex(); + RedrawProgress(); + RedrawVolume(); + RedrawPlayerStatue(); + } + +// --------------------------------------------------------------------------- +// From class CTestBaseView. +// Process keypresses on this view - called by ConsoleMain +// --------------------------------------------------------------------------- +// +void CTestPlaybackView::SelectL( TKeyCode aSelection, TBool& aContinue ) + { + aContinue = ETrue; + switch(aSelection) + { + case '1': + iTestPlaybackViewObs->HandleUiCommandL(ETPbViewCmdPlay); + break; + case '2': + iTestPlaybackViewObs->HandleUiCommandL(ETPbViewCmdPrevious); + break; + case '3': + iTestPlaybackViewObs->HandleUiCommandL(ETPbViewCmdNext); + break; + case '4': + iTestPlaybackViewObs->HandleUiCommandL(ETPbViewCmdStop); + break; + case '5': + iTestPlaybackViewObs->HandleUiCommandL(iCurrentStatus.iBackwardSeek? + ETPbViewCmdStopSeeking : + ETPbViewCmdStartSeekBackward); + break; + case '6': + iTestPlaybackViewObs->HandleUiCommandL(iCurrentStatus.iForwardSeek? + ETPbViewCmdStopSeeking : + ETPbViewCmdStartSeekForward); + break; + case '7': + iTestPlaybackViewObs->HandleUiCommandL(ETPbViewCmdPause); + break; + case '8': + iTestPlaybackViewObs->HandleUiCommandL(ETPbViewCmdDecreaseVolume); + break; + case '9': + iTestPlaybackViewObs->HandleUiCommandL(ETPbViewCmdIncreaseVolume); + break; + case EKeyEscape: + iTestPlaybackViewObs->HandleUiCommandL(ETPbViewCmdClose); + aContinue = EFalse; + CurrentViewDoneL(); + break; + } + } + +// --------------------------------------------------------------------------- +// From class CTestBaseView. +// Update display from timer - called by ConsoleMain +// --------------------------------------------------------------------------- +// +void CTestPlaybackView::TimerUpdate() + { + + } + +// --------------------------------------------------------------------------- +// C++ constructor +// --------------------------------------------------------------------------- +// +CTestPlaybackView::CTestPlaybackView(CConsoleMain* aConsoleMain, + CTestBaseView* aParent, + const TDesC& aName, + CStifLogger* aLogger) + : CTestBaseView(aConsoleMain, aParent, aName) + { + iDisplaySize = iConsole->ScreenSize(); + iDisplaySize.iWidth = iDisplaySize.iWidth - KDisplayScreenWidthOffset; + iLogger = aLogger; + } + +// --------------------------------------------------------------------------- +// Symbian 2-phrase constructor +// --------------------------------------------------------------------------- +// +void CTestPlaybackView::ConstructL() + { + + iCurrentStatus.iBackwardSeek = EFalse; + iCurrentStatus.iForwardSeek = EFalse; + iCurrentStatus.iPlaying = EFalse; + iCurrentStatus.iPause = EFalse; + iCurrentStatus.iVolume = 0; + iCurrentStatus.iMaxVolume = 20; //magic number?? + iCurrentStatus.iProgressPos = 0; + iCurrentStatus.iProgressDur = KMaxTInt; + iCurrentStatus.iItemIndex = 0; + iCurrentStatus.iMaxItems = 0; + + InitializeViewL(); + } + + +// --------------------------------------------------------------------------- +// Redraw index in view +// --------------------------------------------------------------------------- +// +void CTestPlaybackView::RedrawIndex() + { + if(iCurrentStatus.iMaxItems <= 0) + return; + iConsole->SetPos(iDisplaySize.iWidth - 5, 3); //##/## format + iConsole->Printf(_L(" ")); //clean + iConsole->SetPos(iDisplaySize.iWidth - 5, 3); + iConsole->Printf(_L("%d/%d"), iCurrentStatus.iItemIndex, + iCurrentStatus.iMaxItems); + + } + +// --------------------------------------------------------------------------- +// Redraw progress bar in view +// --------------------------------------------------------------------------- +// +void CTestPlaybackView::RedrawProgress() + { + if(iCurrentStatus.iProgressDur <= 0) + return; + TInt pos = iCurrentStatus.iProgressPos * + iDisplaySize.iWidth / iCurrentStatus.iProgressDur ; + iConsole->SetPos(0, iDisplaySize.iHeight / 2); + for(TInt x = 1; x <= iDisplaySize.iWidth; x++) + iConsole->Printf(x<=pos? _L("=") : _L("-")); + } + +// --------------------------------------------------------------------------- +// Redraw volume bar in view +// --------------------------------------------------------------------------- +// +void CTestPlaybackView::RedrawVolume() + { + if(iCurrentStatus.iMaxVolume <= 0) + return; + TInt pos = iCurrentStatus.iVolume * + iCurrentStatus.iMaxVolume / iCurrentStatus.iMaxVolume ; + iConsole->SetPos(0, 1); + iConsole->Printf(_L("Volume(8|9):")); + for(TInt x = 1; x <= iCurrentStatus.iMaxVolume; x++) + iConsole->Printf(x <= pos? _L("=") : _L("-")); + iConsole->Printf(_L(" %d/%d"), + iCurrentStatus.iVolume, + iCurrentStatus.iMaxVolume); + } + +// --------------------------------------------------------------------------- +// Redraw status/control part of the view +// --------------------------------------------------------------------------- +// +void CTestPlaybackView::RedrawPlayerStatue() + { + TInt linePosY = iDisplaySize.iHeight - KSongInfoYOffset; + + //Line 1 + iConsole->SetPos(0, linePosY); + iConsole->Printf(iCurrentStatus.iPlaying? + KStop : KStopSel); + iConsole->Printf(KSpacer); + iConsole->Printf(iCurrentStatus.iBackwardSeek? + KFastRewindSel : KFastRewind); + iConsole->Printf(KSpacer); + iConsole->Printf(iCurrentStatus.iForwardSeek? + KFastForwardSel : KFastForward); + iConsole->Printf(KSpacer); + iConsole->Printf(iCurrentStatus.iPause? + KPauseSel : KPause); + + //Line 2 + iConsole->SetPos(0, ++linePosY); + iConsole->Printf(iCurrentStatus.iPlaying? + KPlaySel : KPlay); + iConsole->Printf(KSpacer); + iConsole->Printf(KBackward); + iConsole->Printf(KSpacer); + iConsole->Printf(KForward); + + //Line Exit + iConsole->SetPos(iDisplaySize.iWidth - KExit().Length(), + iDisplaySize.iHeight - 1); + iConsole->Printf(KExit); + } + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/common/testviewframework/src/testutility.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/common/testviewframework/src/testutility.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2002 - 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: Help tools +* +*/ + +#include +#include +#include "testutility.h" + +// ----------------------------------------------------------------------------- +// Convert string to decemial +// ----------------------------------------------------------------------------- +EXPORT_C TInt TestUtility::ConvertStrToDecL(const TDesC& aStr) + { + TInt result = 0; + for(TInt i=0; i 57) + User::Leave(KErrArgument); + ch -= 48; + result *= 10; + result += ch; + } + return result; + } + +// ----------------------------------------------------------------------------- +// Log message +// ----------------------------------------------------------------------------- +EXPORT_C void TestUtility::TestLog(CStifLogger* aLogger, + TRefByValue< const TDesC > aFmt, + ...) + { + VA_LIST list; + VA_START(list, aFmt); + RDebug::Print( aFmt, list ); + if(aLogger) + { + TBuf logData; + logData.FormatList( aFmt, list ); + aLogger->Log(logData); + } + VA_END(list); + } + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/conf/collectionhelpertest.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/conf/collectionhelpertest.cfg Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,213 @@ +// _Unsupported_ Those API could be not implemented and return KErrNotSupported + + +[Define] +KErrNotFound -1 +KErrNotSupported -5 +KErrArgument -6 +KErrNotReady -18 +KErrAccessDenied -21 + +KErrEventPending -2000 +KErrCallbackErrorCode -2001 +KErrUnexpectedValue -2002 +KErrNotificationPending -2005 +KErrUnexpectedNotification -2006 +KErrTimeoutController -2007 + +EMdaPriorityMin –100 +EMdaPriorityLow -50 +EMdaPriorityNormal 0 +EMdaPriorityHigh 50 +EMdaPriorityMax 100 + +KMMFBalanceMax 100 +KMMFBalanceCenter 50 +KMMFBalanceMin 0 +[Enddefine] + + +// ================================================== +// Collection Helper Test +// ================================================== + +[Test] +title 1. Open Collection Utility +create CollectionHelperTest test # test = new CollectionHelperTest() +test OpenCollectionUtility # test.OpenCollectionUtility() +waittestclass test # test.waittestclass() +delete test # delete test +pause 1000 # wait( 1 sec ) +[Endtest] + +[Test] +title 2. Create UI Helper +create CollectionHelperTestClass test +test OpenCollectionUtility +waittestclass test +test NewUiHelper +test CloseUiHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 3. Create Helper +create CollectionHelperTestClass test +test OpenCollectionUtility +waittestclass test +test NewHelper +test CloseHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 4. Create Cached Helper +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewCachedHelper +test CloseCachedHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 5. Add File +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewHelper +test AddFile +waittestclass test +test CloseHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 6. Add Media +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewHelper +test AddMedia +test CloseHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 7. Remove File +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewHelper +test AddFile +waittestclass test +test RemoveFile +test CloseHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 8. Remove All +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewHelper +test AddFile +waittestclass test +test RemoveAll +test CloseHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 9. Cleanup Deleted Medias +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewHelper +test AddFile +waittestclass test +test RemoveAll +test CleanupDeletedMedias +test CloseHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 10. Set Media +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewHelper +test AddFile +waittestclass test +test SetMedia +test CloseHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 11. Rename URI +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewHelper +test AddFile +waittestclass test +test RenameUri +test CloseHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 12. Get File +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewHelper +test AddFile +waittestclass test +test GetFile +test CloseHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 13. Get File2 +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewHelper +test AddFile +waittestclass test +test GetFile2 +test CloseHelper +delete test +pause 1000 +[Endtest] + +[Test] +title 14. Find All +create CollectionHelperTest test +test OpenCollectionUtility +waittestclass test +test NewHelper +test AddFile +waittestclass test +test FindAll +test CloseHelper +delete test +pause 1000 +[Endtest] + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/conf/playbackplugintest.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/conf/playbackplugintest.cfg Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,75 @@ +// ================================================== +// Playback Plugin Test +// ================================================== + + +[Test] +title 1 MMPXPlaybackUtilityNewL +create playbackplugintest test +test MMPXPlaybackUtilityNewL +test Close +delete test +[Endtest] + +[Test] +title 2 MMPXPlaybackUtilityUtilityL +create playbackplugintest test +test MMPXPlaybackUtilityUtilityL +test Close +delete test +[Endtest] + +[Test] +title 3 InitStreamingL +create playbackplugintest test +test MMPXPlaybackUtilityNewL +pause 1000 +test InitStreamingL JepJep.mp3 +pause 1000 +test Close +delete test +[Endtest] + +[Test] +title 4 InitStreaming2L +create playbackplugintest test +test MMPXPlaybackUtilityNewL +pause 1000 +test InitStreaming2L JepJep.mp3 +pause 1000 +test Close +delete test +[Endtest] + +[Test] +title 5 InitRFile +create playbackplugintest test +test MMPXPlaybackUtilityNewL +pause 1000 +test InitRFileL JepJep.mp3 +pause 1000 +test Close +delete test +[Endtest] + +[Test] +title 6 InitURI +create playbackplugintest test +test MMPXPlaybackUtilityNewL +pause 1000 +test InitURIL JepJep.mp3 +pause 1000 +test Close +delete test +[Endtest] + +[Test] +title 7 InitRFileWithLocalAudioPlugin +create playbackplugintest test +test MMPXPlaybackUtilityNewLLocalAudioPlugin +pause 1000 +test InitRFileL JepJep.mp3 +pause 1000 +test Close +delete test +[Endtest] diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2002 - 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 Test Framework. +* +*/ + +#include "../common/group/bld.inf" // common instrustructure and test plugins +#include "../collectiontest/group/bld.inf" // collection test suite +#include "../collectionhelpertest/group/bld.inf" // MPXCollectionHelper tests +#include "../playbackplugintest/group/bld.inf" // MPXPlaybackPlugin tests diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/init/testframework.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/init/testframework.ini Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,196 @@ +# +# This is STIF initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. +# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation +# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 +# + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= C:\LOGS\TestFramework\ +TestReportFileName= TestReport + +TestReportFormat= TXT # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +DisableMeasurement= stifmeasurementdisablenone # Possible values are: + # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' + # 'stifmeasurementplugin01', 'stifmeasurementplugin02', + # 'stifmeasurementplugin03', 'stifmeasurementplugin04', + # 'stifmeasurementplugin05' or 'stifbappeaprofiler' + +Timeout= 0 # Default timeout value for each test case. In milliseconds +UITestingSupport= YES +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +[New_Module] +ModuleName= testscripter +TestCaseFile= c:\testframework\playbackplugintest.cfg +[End_Module] + +# Load testmoduleXXX, optionally with initialization file and/or test case files +#[New_Module] +#ModuleName= testmodulexxx + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) +#TestCaseFile= c:\testframework\testcases1.cfg +#TestCaseFile= c:\testframework\testcases2.cfg +#TestCaseFile= c:\testframework\manualtestcases.cfg + +#[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIF logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# +# - Will write log file in unicode format. +# + YES, Log file will be written in unicode format +# + NO, Log will be written as normal, not unicode, file. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' +#NOTE: TestEngine and TestServer logging settings cannot change here + +#CreateLogDirectories= YES # Possible values: YES or NO + +#EmulatorBasePath= C:\LOGS\TestFramework\ +#EmulatorFormat= HTML # Possible values: TXT or HTML +#EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +#HardwareBasePath= D:\LOGS\TestFramework\ +#HardwareFormat= HTML # Possible values: TXT or HTML +#HardwareOutput= FILE # Possible values: FILE or RDEBUG + +#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +#ThreadIdToLogFile= YES # Possible values: YES or NO +#WithTimeStamp= YES # Possible values: YES or NO +#WithLineBreak= YES # Possible values: YES or NO +#WithEventRanking= YES # Possible values: YES or NO + +#FileUnicode= YES # Possible values: YES or NO +#AddTestCaseTitle= YES # Possible values: YES or NO +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/playbackplugintest/bwinscw/playbackplugintestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/playbackplugintest/bwinscw/playbackplugintestu.def Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &) + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/playbackplugintest/eabi/playbackplugintestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/playbackplugintest/eabi/playbackplugintestu.def Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/playbackplugintest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/playbackplugintest/group/bld.inf Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,30 @@ +/* +* Copyright (c) 2002 - 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 playbackplugintest. +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_TESTEXPORTS + +PRJ_EXPORTS + +PRJ_TESTMMPFILES +playbackplugintest.mmp + +PRJ_MMPFILES + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/playbackplugintest/group/playbackplugintest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/playbackplugintest/group/playbackplugintest.mmp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2002 - 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: Scripted Tests for MPX Playback Plugin +* +*/ + +#include + +TARGET playbackplugintest.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB + +SOURCEPATH ../src +SOURCE playbackplugintest.cpp +SOURCE playbackplugintestBlocks.cpp + +USERINCLUDE ../inc +USERINCLUDE ../../common/inc +USERINCLUDE ../../common/testplugins/inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY efsrv.lib +LIBRARY charconv.lib +LIBRARY mpxplaybackutility.lib +LIBRARY mpxcommon.lib +LIBRARY bafl.lib +LIBRARY estor.lib +LIBRARY basetest.lib + +#if defined(ARMCC) +#elif defined(WINSCW) +deffile ../bwinscw/ +#endif diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/playbackplugintest/inc/playbackplugintest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/playbackplugintest/inc/playbackplugintest.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,158 @@ +/* +* Copyright (c) 2002 - 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: Scripted Tests for MPX Playback Plugin +* +*/ + +#ifndef PLAYBACKPLUGINTEST_H +#define PLAYBACKPLUGINTEST_H + +#include +#include +#include +#include +#include +#include "basetest.h" + +// CONSTANTS +const TInt KTestPlayback1Seconds = 1000; + +// MACROS +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 + +// Logging path +#ifdef __WINSCW__ +_LIT( KPlaybackPluginTestLogPath, "\\logs\\testframework\\playbackplugintest\\" ); +#else +_LIT( KPlaybackPluginTestLogPath, "e:\\logs\\testframework\\playbackplugintest\\" ); +#endif + +// Log file +_LIT( KPlaybackPluginTestLogFile, "playbackplugintest.txt" ); +_LIT( KPlaybackPluginTestLogFileWithTitle, "playbackplugintest_[%S].txt" ); + +// Other strings +_LIT( KPlaybackPluginTest_digitalPath, "\\testing\\data\\" ); +_LIT(KTextHandlePlaybackMessage2, "HandlePlaybackMessage(CMpxMessage)"); + + +// FORWARD DECLARATIONS +class MMPXPlaybackUtility; + +/** +* Cplaybackplugintest test class for STIF Test Framework TestScripter. +* +*/ +NONSHARABLE_CLASS(CPlaybackPluginTest) : public CBaseTest, + public MMPXPlaybackObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CPlaybackPluginTest* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CPlaybackPluginTest(); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + // From MMPXPlaybackObserver + + /** + * Handle playback message. + * Note: only one of HandlePlaybackMessage callback can be implemented. + * Note: change into pure virtual when all clients updated. + * + * @since S60 3.2.3 + * @param aMsg playback message, ownership not transferred. + * Please check aMsg is not NULL before using it. If aErr is not + * KErrNone, plugin might still call back with more info in the aMsg. + * @param aErr system error code. + */ + void HandlePlaybackMessage( + CMPXMessage* aMessage, TInt aError ); + + private: + + /** + * C++ default constructor. + */ + CPlaybackPluginTest( CTestModuleIf& aTestModuleIf ); + + /** + * 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& ); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * Test methods are listed below. + */ + TInt MMPXPlaybackUtilityNewL(CStifItemParser& /*aItem*/); + TInt MMPXPlaybackUtilityNewLHelixVideoPlugin(CStifItemParser& /*aItem*/); + TInt MMPXPlaybackUtilityNewLLocalAudioPlugin(CStifItemParser& /*aItem*/); + TInt MMPXPlaybackUtilityUtilityL(CStifItemParser& /*aItem*/); + + //to test virtual void InitStreamingL(const TDesC& aUri, + // const TDesC8* aType, + // const TInt aAccessPoint)=0; + TInt InitStreamingL( CStifItemParser& aItem ); + //to test virtual void Close()=0; + TInt Close( CStifItemParser& aItem ); + //to test virtual void InitStreamingL(RFile& aShareableFile, const TInt aAccessPoint)=0; + TInt InitStreaming2L( CStifItemParser& aItem ); + + TInt InitRFileL( CStifItemParser& aItem ); + TInt InitURIL( CStifItemParser& aItem ); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + //ADD NEW METHOD DEC HERE + //[TestMethods] - Do not remove + + private: + + MMPXPlaybackUtility* iPlaybackUtility; + }; + +#endif // PLAYBACKPLUGINTEST_H + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/playbackplugintest/src/playbackplugintest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/playbackplugintest/src/playbackplugintest.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,116 @@ +/* +* Copyright (c) 2002 - 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: Scripted Tests for MPX Playback Plugin +* +*/ + +// INCLUDE FILES +#include +#include +#include "playbackplugintest.h" + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::Cplaybackplugintest +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CPlaybackPluginTest::CPlaybackPluginTest( CTestModuleIf& aTestModuleIf ): + CBaseTest( aTestModuleIf ) + { + } + +// Destructor +CPlaybackPluginTest::~CPlaybackPluginTest() + { + // Delete resources allocated from test methods + Delete(); + + iPlaybackUtility->Close(); + iPlaybackUtility = NULL; + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CPlaybackPluginTest* CPlaybackPluginTest::NewL( CTestModuleIf& aTestModuleIf ) + { + CPlaybackPluginTest* self = + new (ELeave) CPlaybackPluginTest( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CPlaybackPluginTest::ConstructL() + { + CBaseTest::ConstructL(); + + iLog = CStifLogger::NewL( KPlaybackPluginTestLogPath, + KPlaybackPluginTestLogFile, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + } + +//----------------------------------------------------------------------------- +// CPlaybackPluginTest::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CPlaybackPluginTest::SendTestClassVersion() + { + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("playbackplugintest.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, + newVersionOfMethod); + } + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( + CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework + { + + return ( CScriptBase* ) CPlaybackPluginTest::NewL( aTestModuleIf ); + + } + + +// End of File diff -r 3b098142db83 -r 92dbd2a406d9 mpx/tsrc/public/basic/playbackplugintest/src/playbackplugintestBlocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mpx/tsrc/public/basic/playbackplugintest/src/playbackplugintestBlocks.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,373 @@ +/* +* Copyright (c) 2002 - 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: Scripted Tests for MPX Playback Plugin +* +*/ + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include +#include +#include +#include +#include "testcommonpluginuids.h" +#include "playbackplugintest.h" + +const TUid KPbTestPlugin = {KPlaybackTestPluginImpId}; +const TUid KPbFusionVideoHelixPlugin = {0x10282551}; +const TUid KPbLocalAudioPlugin = {0x101FFC06}; + +// ============================ MEMBER FUNCTIONS =============================== + +// --------------------------------------------------------------------------- +// From MMPXPlaybackObserver +// Handle playback message. +// --------------------------------------------------------------------------- +// +void CPlaybackPluginTest::HandlePlaybackMessage( + CMPXMessage* aMessage, TInt aError ) + { + iLog->Log(_L("Cmpxharvestertest::HandlePlaybackMessage: %d"), KTextHandlePlaybackMessage2); + TMPXMessageId id( *aMessage->Value( KMPXMessageGeneralId ) ); + TInt event( *aMessage->Value( KMPXMessageGeneralEvent )); + TInt type( *aMessage->Value( KMPXMessageGeneralType ) ); + TInt data( *aMessage->Value( KMPXMessageGeneralData ) ); + iLog->Log(_L("CPlaybackPluginTest::HandlePlaybackMessage: %d, %d, %d"), event, type, data); + + iLog->Log(_L("CPlaybackPluginTest::HandlePlaybackMessage: %d"), aError); + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CPlaybackPluginTest::Delete() + { + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CPlaybackPluginTest::RunMethodL( CStifItemParser& aItem ) + { + + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + + ENTRY( "MMPXPlaybackUtilityNewL", CPlaybackPluginTest::MMPXPlaybackUtilityNewL ), + ENTRY( "MMPXPlaybackUtilityNewLHelixVideoPlugin", CPlaybackPluginTest::MMPXPlaybackUtilityNewLHelixVideoPlugin ), + ENTRY( "MMPXPlaybackUtilityNewLLocalAudioPlugin", CPlaybackPluginTest::MMPXPlaybackUtilityNewLLocalAudioPlugin ), + ENTRY( "MMPXPlaybackUtilityUtilityL", CPlaybackPluginTest::MMPXPlaybackUtilityUtilityL ), + ENTRY( "InitStreamingL", CPlaybackPluginTest::InitStreamingL ), + ENTRY( "Close", CPlaybackPluginTest::Close ), + ENTRY( "InitStreaming2L", CPlaybackPluginTest::InitStreaming2L ), + ENTRY( "InitRFileL", CPlaybackPluginTest::InitRFileL ), + ENTRY( "InitURIL", CPlaybackPluginTest::InitURIL ), + //ADD NEW ENTRY HERE + // [test cases entries] - Do not remove + }; + + const TInt count = sizeof( KFunctions ) / + sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); + + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::MMPXPlaybackUtilityNewL +// NewL test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CPlaybackPluginTest::MMPXPlaybackUtilityNewL(CStifItemParser& /*aItem*/) + { + TInt err = KErrNone; + TRAP(err, + iPlaybackUtility = MMPXPlaybackUtility::NewL(KPbModeNewPlayer, this)); + if (err == KErrNone) + { + TRAP(err, + iPlaybackUtility->PlayerManager().SelectPlayerL(KPbTestPlugin)); + } + if (err!= KErrNone) + { + iLog->Log(_L("CPlaybackPluginTest::MMPXPlaybackUtilityNewL: %d"), err); + } + return err; + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::MMPXPlaybackUtilityNewLHelixVideoPlugin +// NewL test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CPlaybackPluginTest::MMPXPlaybackUtilityNewLHelixVideoPlugin(CStifItemParser& /*aItem*/) + { + TInt err = KErrNone; + TRAP(err, + iPlaybackUtility = MMPXPlaybackUtility::NewL(KPbModeNewPlayer, this)); + + if (err == KErrNone) + { + TRAP(err, + iPlaybackUtility->PlayerManager(). + SelectPlayerL(KPbFusionVideoHelixPlugin)); + } + + if (err!= KErrNone) + { + iLog->Log(_L("CPlaybackPluginTest::MMPXPlaybackUtilityNewLHelixVideoPlugin: %d"), err); + } + + return err; + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::MMPXPlaybackUtilityNewLLocalAudioPlugin +// NewL test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CPlaybackPluginTest::MMPXPlaybackUtilityNewLLocalAudioPlugin(CStifItemParser& /*aItem*/) + { + TInt err = KErrNone; + TRAP(err, + iPlaybackUtility = MMPXPlaybackUtility::NewL(KPbModeNewPlayer, this)); + + if (err == KErrNone) + { + TRAP(err, + iPlaybackUtility->PlayerManager(). + SelectPlayerL(KPbLocalAudioPlugin)); + } + + if (err!= KErrNone) + { + iLog->Log(_L("CPlaybackPluginTest::MMPXPlaybackUtilityNewLLocalAudioPlugin: %d"), err); + } + + return err; + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::Close +// NewL test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CPlaybackPluginTest::Close(CStifItemParser& /*aItem*/) + { + TInt err = KErrNone; + iLog->Log( _L("Entering Close::Starting closing MMPXPlaybackUtility...") ); + if ( iPlaybackUtility ) + { + iPlaybackUtility->Close(); + iPlaybackUtility = NULL; + } + iLog->Log( _L("Getting out of Close.") ); + return err; + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::MMPXPlaybackUtilityUtilityL +// UtilityL test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CPlaybackPluginTest::MMPXPlaybackUtilityUtilityL(CStifItemParser& /*aItem*/) + { + TInt err = KErrNone; + TRAP(err,iPlaybackUtility = MMPXPlaybackUtility::UtilityL()); + if (err!= KErrNone) + { + iLog->Log(_L("CPlaybackPluginTest::MMPXPlaybackUtilityUtilityL: %d"), err); + } + return err; + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::InitStreamingL +// InitStreamingL test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CPlaybackPluginTest::InitStreamingL( CStifItemParser& aItem ) + { + _LIT8(KTextType, "audio/mpeg"); + TInt err = KErrNone; + iLog->Log( _L("Entering InitStreamingL---->") ); + TPtrC uri; + TPtrC FileNamePtr; + TInt accesspoint = 2; + while ( aItem.GetNextString( uri ) == KErrNone ) + { + TBuf<120> KFrom; + KFrom.Append(KPlaybackPluginTest_digitalPath); + KFrom.Append(uri); + TFileName FileName = KFrom; + iLog->Log( _L("Input file [%S]"), &FileNamePtr ); + TRAP(err, iPlaybackUtility->InitStreamingL( FileName, &KTextType, accesspoint)); + if( err == KErrNone ) + { + iLog->Log( _L("Succeeded in initialising streaming.") ); + } + else + { + iLog->Log( _L("Failed to initialise streaming.Error %d returns."),err ); + } + } + iLog->Log( _L("<----Ending InitStreamingL") ); + return err; + + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::InitStreaming2L +// InitStreamingL test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CPlaybackPluginTest::InitStreaming2L(CStifItemParser& aItem) + { + TInt err = KErrNone; + iLog->Log( _L("Entering InitStreaming2L---->") ); + TInt accessPoint = 2; + TPtrC fileFullName; + if( aItem.GetNextString( fileFullName ) == KErrNone ) + { + TBuf<120> KFrom; + KFrom.Append(KPlaybackPluginTest_digitalPath); + KFrom.Append(fileFullName); + TFileName FileName = KFrom; + RFs fs; + RFile file; + User::LeaveIfError(fs.Connect()); + fs.ShareProtected(); + User::LeaveIfError(file.Open( fs, FileName, EFileShareReadersOrWriters)); + iLog->Log( _L("Starting initialising streaming...") ); + TRAP(err,iPlaybackUtility->InitStreamingL( file, accessPoint)); + fs.Close(); + if( err == KErrNone ) + { + iLog->Log( _L("Succeeded in initialising streaming.") ); + } + else + { + iLog->Log( _L("Failed to initialise streaming.Error %d returns."),err ); + } + } + else + { + err = KErrArgument; + iLog->Log( _L("Pass in bad parameter.User leaves here.") ); + User::LeaveIfError( err ); + } + + iLog->Log( _L("<----Getting out of InitStreaming2L\r\n.") ); + return err; + } + + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::InitRFileL +// InitL test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CPlaybackPluginTest::InitRFileL(CStifItemParser& aItem) + { + TInt err = KErrNone; + iLog->Log( _L("Entering InitRFileL---->") ); + TPtrC fileFullName; + + if( aItem.GetNextString( fileFullName ) == KErrNone ) + { + TBuf<120> KFrom; + KFrom.Append(KPlaybackPluginTest_digitalPath); + KFrom.Append(fileFullName); + TFileName FileName = KFrom; + RFs fs; + RFile file; + User::LeaveIfError(fs.Connect()); + fs.ShareProtected(); + User::LeaveIfError(file.Open( fs, FileName, EFileShareReadersOrWriters)); + iLog->Log( _L("Starting InitRFileL...") ); + TRAP(err, iPlaybackUtility->InitL( file)); + fs.Close(); + if( err == KErrNone ) + { + iLog->Log( _L("Succeeded InitRFileL.") ); + } + else + { + iLog->Log( _L("Failed to InitRFileL. Error %d returns."),err ); + } + } + else + { + err = KErrArgument; + iLog->Log( _L("Pass in bad parameter.User leaves here.") ); + User::LeaveIfError( err ); + } + + iLog->Log( _L("<----Getting out of InitRFileL\r\n.") ); + return err; + } + +// ----------------------------------------------------------------------------- +// CPlaybackPluginTest::InitURIL +// InitL test method function. +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +TInt CPlaybackPluginTest::InitURIL(CStifItemParser& aItem) + { + TInt err = KErrNone; + _LIT8(KTextType, "audio/mpeg"); + iLog->Log( _L("Entering InitURIL---->") ); + TPtrC uri; + TPtrC FileNamePtr; + while ( aItem.GetNextString( uri ) == KErrNone ) + { + TBuf<120> KFrom; + KFrom.Append(KPlaybackPluginTest_digitalPath); + KFrom.Append(uri); + TFileName FileName = KFrom; + iLog->Log( _L("Input file [%S]"), &FileNamePtr ); + TRAP(err, iPlaybackUtility->InitL( FileName, &KTextType)); + if( err == KErrNone ) + { + iLog->Log( _L("Succeeded in InitURIL.") ); + } + else + { + iLog->Log( _L("Failed to InitURIL. Error %d returns."),err ); + } + } + iLog->Log( _L("<----Getting out of InitURIL\r\n.") ); + return err; + } + +// [End of File] - Do not remove diff -r 3b098142db83 -r 92dbd2a406d9 qtms/bwins/qtmsu.def --- a/qtms/bwins/qtmsu.def Fri Sep 17 08:33:08 2010 +0300 +++ b/qtms/bwins/qtmsu.def Mon Oct 04 00:50:27 2010 +0300 @@ -113,254 +113,254 @@ ?metaObject@QTMSPCMFormat@QTMS@@UBEPBUQMetaObject@@XZ @ 112 NONAME ; struct QMetaObject const * QTMS::QTMSPCMFormat::metaObject(void) const ?tr@QTMSMicSource@QTMS@@SA?AVQString@@PBD0@Z @ 113 NONAME ; class QString QTMS::QTMSMicSource::tr(char const *, char const *) ??1QTMSGlobalRouting@QTMS@@UAE@XZ @ 114 NONAME ; QTMS::QTMSGlobalRouting::~QTMSGlobalRouting(void) - ?getStaticMetaObject@QTMSStream@QTMS@@SAABUQMetaObject@@XZ @ 115 NONAME ; struct QMetaObject const & QTMS::QTMSStream::getStaticMetaObject(void) - ?trUtf8@QTMSClientSource@QTMS@@SA?AVQString@@PBD0@Z @ 116 NONAME ; class QString QTMS::QTMSClientSource::trUtf8(char const *, char const *) - ?tr@QTMSAMRFormat@QTMS@@SA?AVQString@@PBD0H@Z @ 117 NONAME ; class QString QTMS::QTMSAMRFormat::tr(char const *, char const *, int) - ?qt_metacast@QTMSModemSource@QTMS@@UAEPAXPBD@Z @ 118 NONAME ; void * QTMS::QTMSModemSource::qt_metacast(char const *) - ?getStaticMetaObject@QTMSG711Format@QTMS@@SAABUQMetaObject@@XZ @ 119 NONAME ; struct QMetaObject const & QTMS::QTMSG711Format::getStaticMetaObject(void) - ??_EQTMSClientSource@QTMS@@UAE@I@Z @ 120 NONAME ; QTMS::QTMSClientSource::~QTMSClientSource(unsigned int) - ?GetLevel@QTMSGainEffect@QTMS@@QAEHAAI@Z @ 121 NONAME ; int QTMS::QTMSGainEffect::GetLevel(unsigned int &) - ?tr@QTMSFactory@QTMS@@SA?AVQString@@PBD0@Z @ 122 NONAME ; class QString QTMS::QTMSFactory::tr(char const *, char const *) - ?qt_metacast@QTMSGlobalRouting@QTMS@@UAEPAXPBD@Z @ 123 NONAME ; void * QTMS::QTMSGlobalRouting::qt_metacast(char const *) - ?getStaticMetaObject@QTMSFactory@QTMS@@SAABUQMetaObject@@XZ @ 124 NONAME ; struct QMetaObject const & QTMS::QTMSFactory::getStaticMetaObject(void) - ??_EQTMSAMRFormat@QTMS@@UAE@I@Z @ 125 NONAME ; QTMS::QTMSAMRFormat::~QTMSAMRFormat(unsigned int) - ?getStaticMetaObject@QTMSPCMFormat@QTMS@@SAABUQMetaObject@@XZ @ 126 NONAME ; struct QMetaObject const & QTMS::QTMSPCMFormat::getStaticMetaObject(void) - ?Flush@QTMSClientSource@QTMS@@QAEHXZ @ 127 NONAME ; int QTMS::QTMSClientSource::Flush(void) - ?Stop@QTMSRingTone@QTMS@@QAEHXZ @ 128 NONAME ; int QTMS::QTMSRingTone::Stop(void) - ?DeleteGlobalRouting@QTMSFactory@QTMS@@QAEHAAPAVQTMSGlobalRouting@2@@Z @ 129 NONAME ; int QTMS::QTMSFactory::DeleteGlobalRouting(class QTMS::QTMSGlobalRouting * &) - ?tr@QTMSGlobalRouting@QTMS@@SA?AVQString@@PBD0H@Z @ 130 NONAME ; class QString QTMS::QTMSGlobalRouting::tr(char const *, char const *, int) - ?SetMode@QTMSG711Format@QTMS@@QAEHH@Z @ 131 NONAME ; int QTMS::QTMSG711Format::SetMode(int) - ?GetMode@QTMSILBCFormat@QTMS@@QAEHAAH@Z @ 132 NONAME ; int QTMS::QTMSILBCFormat::GetMode(int &) - ?GetMode@QTMSG711Format@QTMS@@QAEHAAH@Z @ 133 NONAME ; int QTMS::QTMSG711Format::GetMode(int &) - ?GetAvailableOutputs@QTMSGlobalRouting@QTMS@@QAEHAAV?$vector@IV?$allocator@I@std@@@std@@@Z @ 134 NONAME ; int QTMS::QTMSGlobalRouting::GetAvailableOutputs(class std::vector > &) - ?staticMetaObject@QTMSFactory@QTMS@@2UQMetaObject@@B @ 135 NONAME ; struct QMetaObject const QTMS::QTMSFactory::staticMetaObject - ?DeleteFormat@QTMSFactory@QTMS@@QAEHAAPAVQTMSFormat@2@@Z @ 136 NONAME ; int QTMS::QTMSFactory::DeleteFormat(class QTMS::QTMSFormat * &) - ?tr@QTMSILBCFormat@QTMS@@SA?AVQString@@PBD0H@Z @ 137 NONAME ; class QString QTMS::QTMSILBCFormat::tr(char const *, char const *, int) - ??1QTMSPCMFormat@QTMS@@UAE@XZ @ 138 NONAME ; QTMS::QTMSPCMFormat::~QTMSPCMFormat(void) - ?trUtf8@QTMSGainEffect@QTMS@@SA?AVQString@@PBD0@Z @ 139 NONAME ; class QString QTMS::QTMSGainEffect::trUtf8(char const *, char const *) - ??0QTMSG711Format@QTMS@@IAE@XZ @ 140 NONAME ; QTMS::QTMSG711Format::QTMSG711Format(void) - ?staticMetaObject@QTMSILBCFormat@QTMS@@2UQMetaObject@@B @ 141 NONAME ; struct QMetaObject const QTMS::QTMSILBCFormat::staticMetaObject - ?metaObject@QTMSG729Format@QTMS@@UBEPBUQMetaObject@@XZ @ 142 NONAME ; struct QMetaObject const * QTMS::QTMSG729Format::metaObject(void) const - ?tr@QTMSFactory@QTMS@@SA?AVQString@@PBD0H@Z @ 143 NONAME ; class QString QTMS::QTMSFactory::tr(char const *, char const *, int) - ?tr@QTMSCall@QTMS@@SA?AVQString@@PBD0H@Z @ 144 NONAME ; class QString QTMS::QTMSCall::tr(char const *, char const *, int) - ?staticMetaObject@QTMSClientSink@QTMS@@2UQMetaObject@@B @ 145 NONAME ; struct QMetaObject const QTMS::QTMSClientSink::staticMetaObject - ?ProcessBuffer@QTMSClientSource@QTMS@@QAEHPAVQTMSBuffer@2@@Z @ 146 NONAME ; int QTMS::QTMSClientSource::ProcessBuffer(class QTMS::QTMSBuffer *) - ?EffectsEvent@QTMSGlobalVolEffect@QTMS@@IAEXABVQTMSEffect@2@UQTMSSignalEvent@2@@Z @ 147 NONAME ; void QTMS::QTMSGlobalVolEffect::EffectsEvent(class QTMS::QTMSEffect const &, struct QTMS::QTMSSignalEvent) - ?CreateFormat@QTMSFactory@QTMS@@QAEHHAAPAVQTMSFormat@2@@Z @ 148 NONAME ; int QTMS::QTMSFactory::CreateFormat(int, class QTMS::QTMSFormat * &) - ?SetCNG@QTMSILBCFormat@QTMS@@QAEHH@Z @ 149 NONAME ; int QTMS::QTMSILBCFormat::SetCNG(int) - ??1QTMSAMRFormat@QTMS@@UAE@XZ @ 150 NONAME ; QTMS::QTMSAMRFormat::~QTMSAMRFormat(void) - ?metaObject@QTMSClientSink@QTMS@@UBEPBUQMetaObject@@XZ @ 151 NONAME ; struct QMetaObject const * QTMS::QTMSClientSink::metaObject(void) const - ?trUtf8@QTMSInbandTone@QTMS@@SA?AVQString@@PBD0@Z @ 152 NONAME ; class QString QTMS::QTMSInbandTone::trUtf8(char const *, char const *) - ?staticMetaObject@QTMSG711Format@QTMS@@2UQMetaObject@@B @ 153 NONAME ; struct QMetaObject const QTMS::QTMSG711Format::staticMetaObject - ?trUtf8@QTMSDTMF@QTMS@@SA?AVQString@@PBD0H@Z @ 154 NONAME ; class QString QTMS::QTMSDTMF::trUtf8(char const *, char const *, int) - ?InbandToneEvent@QTMSInbandTone@QTMS@@IAEXABV12@UQTMSSignalEvent@2@@Z @ 155 NONAME ; void QTMS::QTMSInbandTone::InbandToneEvent(class QTMS::QTMSInbandTone const &, struct QTMS::QTMSSignalEvent) - ?tr@QTMSModemSink@QTMS@@SA?AVQString@@PBD0@Z @ 156 NONAME ; class QString QTMS::QTMSModemSink::tr(char const *, char const *) - ?tr@QTMSGainEffect@QTMS@@SA?AVQString@@PBD0H@Z @ 157 NONAME ; class QString QTMS::QTMSGainEffect::tr(char const *, char const *, int) - ?qt_metacast@QTMSG711Format@QTMS@@UAEPAXPBD@Z @ 158 NONAME ; void * QTMS::QTMSG711Format::qt_metacast(char const *) - ?GetMaxLevel@QTMSVolumeEffect@QTMS@@QAEHAAI@Z @ 159 NONAME ; int QTMS::QTMSVolumeEffect::GetMaxLevel(unsigned int &) - ??0QTMSSpeakerSink@QTMS@@IAE@XZ @ 160 NONAME ; QTMS::QTMSSpeakerSink::QTMSSpeakerSink(void) - ??_EQTMSMicSource@QTMS@@UAE@I@Z @ 161 NONAME ; QTMS::QTMSMicSource::~QTMSMicSource(unsigned int) - ?metaObject@QTMSModemSink@QTMS@@UBEPBUQMetaObject@@XZ @ 162 NONAME ; struct QMetaObject const * QTMS::QTMSModemSink::metaObject(void) const - ?DeleteCall@QTMSFactory@QTMS@@QAEHAAPAVQTMSCall@2@@Z @ 163 NONAME ; int QTMS::QTMSFactory::DeleteCall(class QTMS::QTMSCall * &) - ?tr@QTMSGlobalGainEffect@QTMS@@SA?AVQString@@PBD0H@Z @ 164 NONAME ; class QString QTMS::QTMSGlobalGainEffect::tr(char const *, char const *, int) - ?qt_metacall@QTMSMicSource@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 165 NONAME ; int QTMS::QTMSMicSource::qt_metacall(enum QMetaObject::Call, int, void * *) - ?GetType@QTMSFormat@QTMS@@UAEHAAH@Z @ 166 NONAME ; int QTMS::QTMSFormat::GetType(int &) - ?DeleteStream@QTMSCall@QTMS@@QAEHAAPAVQTMSStream@2@@Z @ 167 NONAME ; int QTMS::QTMSCall::DeleteStream(class QTMS::QTMSStream * &) - ?trUtf8@QTMSVolumeEffect@QTMS@@SA?AVQString@@PBD0@Z @ 168 NONAME ; class QString QTMS::QTMSVolumeEffect::trUtf8(char const *, char const *) - ?CreateInbandTonePlayer@QTMSFactory@QTMS@@QAEHAAPAVQTMSInbandTone@2@@Z @ 169 NONAME ; int QTMS::QTMSFactory::CreateInbandTonePlayer(class QTMS::QTMSInbandTone * &) - ?trUtf8@QTMSGlobalRouting@QTMS@@SA?AVQString@@PBD0@Z @ 170 NONAME ; class QString QTMS::QTMSGlobalRouting::trUtf8(char const *, char const *) - ??1QTMSG711Format@QTMS@@UAE@XZ @ 171 NONAME ; QTMS::QTMSG711Format::~QTMSG711Format(void) - ?BufferProcessed@QTMSClientSink@QTMS@@QAEHPAVQTMSBuffer@2@@Z @ 172 NONAME ; int QTMS::QTMSClientSink::BufferProcessed(class QTMS::QTMSBuffer *) - ?tr@QTMSGainEffect@QTMS@@SA?AVQString@@PBD0@Z @ 173 NONAME ; class QString QTMS::QTMSGainEffect::tr(char const *, char const *) - ??_EQTMSModemSource@QTMS@@UAE@I@Z @ 174 NONAME ; QTMS::QTMSModemSource::~QTMSModemSource(unsigned int) - ?qt_metacall@QTMSPCMFormat@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 175 NONAME ; int QTMS::QTMSPCMFormat::qt_metacall(enum QMetaObject::Call, int, void * *) - ??0QTMSILBCFormat@QTMS@@IAE@XZ @ 176 NONAME ; QTMS::QTMSILBCFormat::QTMSILBCFormat(void) - ?trUtf8@QTMSStream@QTMS@@SA?AVQString@@PBD0H@Z @ 177 NONAME ; class QString QTMS::QTMSStream::trUtf8(char const *, char const *, int) - ?qt_metacast@QTMSPCMFormat@QTMS@@UAEPAXPBD@Z @ 178 NONAME ; void * QTMS::QTMSPCMFormat::qt_metacast(char const *) - ?qt_metacall@QTMSSpeakerSink@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 179 NONAME ; int QTMS::QTMSSpeakerSink::qt_metacall(enum QMetaObject::Call, int, void * *) - ?GetLevel@QTMSVolumeEffect@QTMS@@QAEHAAI@Z @ 180 NONAME ; int QTMS::QTMSVolumeEffect::GetLevel(unsigned int &) - ?trUtf8@QTMSFactory@QTMS@@SA?AVQString@@PBD0H@Z @ 181 NONAME ; class QString QTMS::QTMSFactory::trUtf8(char const *, char const *, int) - ??_EQTMSGainEffect@QTMS@@UAE@I@Z @ 182 NONAME ; QTMS::QTMSGainEffect::~QTMSGainEffect(unsigned int) - ?tr@QTMSGlobalRouting@QTMS@@SA?AVQString@@PBD0@Z @ 183 NONAME ; class QString QTMS::QTMSGlobalRouting::tr(char const *, char const *) - ?tr@QTMSAMRFormat@QTMS@@SA?AVQString@@PBD0@Z @ 184 NONAME ; class QString QTMS::QTMSAMRFormat::tr(char const *, char const *) - ?getStaticMetaObject@QTMSSpeakerSink@QTMS@@SAABUQMetaObject@@XZ @ 185 NONAME ; struct QMetaObject const & QTMS::QTMSSpeakerSink::getStaticMetaObject(void) - ?CreateDTMF@QTMSFactory@QTMS@@QAEHHAAPAVQTMSDTMF@2@@Z @ 186 NONAME ; int QTMS::QTMSFactory::CreateDTMF(int, class QTMS::QTMSDTMF * &) - ?trUtf8@QTMSStream@QTMS@@SA?AVQString@@PBD0@Z @ 187 NONAME ; class QString QTMS::QTMSStream::trUtf8(char const *, char const *) - ?Init@QTMSStream@QTMS@@QAEHH@Z @ 188 NONAME ; int QTMS::QTMSStream::Init(int) - ?tr@QTMSInbandTone@QTMS@@SA?AVQString@@PBD0@Z @ 189 NONAME ; class QString QTMS::QTMSInbandTone::tr(char const *, char const *) - ?tr@QTMSStream@QTMS@@SA?AVQString@@PBD0@Z @ 190 NONAME ; class QString QTMS::QTMSStream::tr(char const *, char const *) - ??1QTMSMicSource@QTMS@@UAE@XZ @ 191 NONAME ; QTMS::QTMSMicSource::~QTMSMicSource(void) - ?BufferFilled@QTMSClientSource@QTMS@@QAEHAAVQTMSBuffer@2@@Z @ 192 NONAME ; int QTMS::QTMSClientSource::BufferFilled(class QTMS::QTMSBuffer &) - ??_EQTMSFactory@QTMS@@UAE@I@Z @ 193 NONAME ; QTMS::QTMSFactory::~QTMSFactory(unsigned int) - ??1QTMSCall@QTMS@@UAE@XZ @ 194 NONAME ; QTMS::QTMSCall::~QTMSCall(void) - ?staticMetaObject@QTMSG729Format@QTMS@@2UQMetaObject@@B @ 195 NONAME ; struct QMetaObject const QTMS::QTMSG729Format::staticMetaObject - ??0QTMSClientSource@QTMS@@IAE@XZ @ 196 NONAME ; QTMS::QTMSClientSource::QTMSClientSource(void) - ?Stop@QTMSInbandTone@QTMS@@QAEHXZ @ 197 NONAME ; int QTMS::QTMSInbandTone::Stop(void) - ?tr@QTMSCall@QTMS@@SA?AVQString@@PBD0@Z @ 198 NONAME ; class QString QTMS::QTMSCall::tr(char const *, char const *) - ?qt_metacall@QTMSCall@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 199 NONAME ; int QTMS::QTMSCall::qt_metacall(enum QMetaObject::Call, int, void * *) - ?metaObject@QTMSSpeakerSink@QTMS@@UBEPBUQMetaObject@@XZ @ 200 NONAME ; struct QMetaObject const * QTMS::QTMSSpeakerSink::metaObject(void) const - ?SetTone@QTMSDTMF@QTMS@@QAEHPAU_GString@@@Z @ 201 NONAME ; int QTMS::QTMSDTMF::SetTone(struct _GString *) - ?SetEnqueueMode@QTMSClientSource@QTMS@@QAEHH@Z @ 202 NONAME ; int QTMS::QTMSClientSource::SetEnqueueMode(int) - ?staticMetaObject@QTMSClientSource@QTMS@@2UQMetaObject@@B @ 203 NONAME ; struct QMetaObject const QTMS::QTMSClientSource::staticMetaObject - ?trUtf8@QTMSModemSource@QTMS@@SA?AVQString@@PBD0@Z @ 204 NONAME ; class QString QTMS::QTMSModemSource::trUtf8(char const *, char const *) - ?trUtf8@QTMSG729Format@QTMS@@SA?AVQString@@PBD0H@Z @ 205 NONAME ; class QString QTMS::QTMSG729Format::trUtf8(char const *, char const *, int) - ?GetType@QTMSVolumeEffect@QTMS@@UAEHAAH@Z @ 206 NONAME ; int QTMS::QTMSVolumeEffect::GetType(int &) - ?qt_metacall@QTMSVolumeEffect@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 207 NONAME ; int QTMS::QTMSVolumeEffect::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@QTMSG711Format@QTMS@@SA?AVQString@@PBD0H@Z @ 208 NONAME ; class QString QTMS::QTMSG711Format::tr(char const *, char const *, int) - ??1QTMSILBCFormat@QTMS@@UAE@XZ @ 209 NONAME ; QTMS::QTMSILBCFormat::~QTMSILBCFormat(void) - ?Play@QTMSRingTone@QTMS@@QAEHXZ @ 210 NONAME ; int QTMS::QTMSRingTone::Play(void) - ?qt_metacall@QTMSILBCFormat@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 211 NONAME ; int QTMS::QTMSILBCFormat::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@QTMSSpeakerSink@QTMS@@SA?AVQString@@PBD0H@Z @ 212 NONAME ; class QString QTMS::QTMSSpeakerSink::tr(char const *, char const *, int) - ?GetBitRate@QTMSFormat@QTMS@@QAEHAAI@Z @ 213 NONAME ; int QTMS::QTMSFormat::GetBitRate(unsigned int &) - ?GetType@QTMSModemSource@QTMS@@UAEHAAH@Z @ 214 NONAME ; int QTMS::QTMSModemSource::GetType(int &) - ?staticMetaObject@QTMSGlobalVolEffect@QTMS@@2UQMetaObject@@B @ 215 NONAME ; struct QMetaObject const QTMS::QTMSGlobalVolEffect::staticMetaObject - ??1QTMSFormat@QTMS@@UAE@XZ @ 216 NONAME ; QTMS::QTMSFormat::~QTMSFormat(void) - ?GetPlc@QTMSG711Format@QTMS@@QAEHAAH@Z @ 217 NONAME ; int QTMS::QTMSG711Format::GetPlc(int &) - ?Start@QTMSInbandTone@QTMS@@QAEHH@Z @ 218 NONAME ; int QTMS::QTMSInbandTone::Start(int) - ?trUtf8@QTMSClientSink@QTMS@@SA?AVQString@@PBD0H@Z @ 219 NONAME ; class QString QTMS::QTMSClientSink::trUtf8(char const *, char const *, int) - ?tr@QTMSInbandTone@QTMS@@SA?AVQString@@PBD0H@Z @ 220 NONAME ; class QString QTMS::QTMSInbandTone::tr(char const *, char const *, int) - ??_EQTMSPCMFormat@QTMS@@UAE@I@Z @ 221 NONAME ; QTMS::QTMSPCMFormat::~QTMSPCMFormat(unsigned int) - ?metaObject@QTMSAMRFormat@QTMS@@UBEPBUQMetaObject@@XZ @ 222 NONAME ; struct QMetaObject const * QTMS::QTMSAMRFormat::metaObject(void) const - ?metaObject@QTMSStream@QTMS@@UBEPBUQMetaObject@@XZ @ 223 NONAME ; struct QMetaObject const * QTMS::QTMSStream::metaObject(void) const - ?getStaticMetaObject@QTMSGlobalGainEffect@QTMS@@SAABUQMetaObject@@XZ @ 224 NONAME ; struct QMetaObject const & QTMS::QTMSGlobalGainEffect::getStaticMetaObject(void) - ?tr@QTMSGlobalVolEffect@QTMS@@SA?AVQString@@PBD0@Z @ 225 NONAME ; class QString QTMS::QTMSGlobalVolEffect::tr(char const *, char const *) - ?staticMetaObject@QTMSInbandTone@QTMS@@2UQMetaObject@@B @ 226 NONAME ; struct QMetaObject const QTMS::QTMSInbandTone::staticMetaObject - ?trUtf8@QTMSGlobalGainEffect@QTMS@@SA?AVQString@@PBD0H@Z @ 227 NONAME ; class QString QTMS::QTMSGlobalGainEffect::trUtf8(char const *, char const *, int) - ?qt_metacast@QTMSClientSource@QTMS@@UAEPAXPBD@Z @ 228 NONAME ; void * QTMS::QTMSClientSource::qt_metacast(char const *) - ?metaObject@QTMSCall@QTMS@@UBEPBUQMetaObject@@XZ @ 229 NONAME ; struct QMetaObject const * QTMS::QTMSCall::metaObject(void) const - ?qt_metacall@QTMSClientSink@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 230 NONAME ; int QTMS::QTMSClientSink::qt_metacall(enum QMetaObject::Call, int, void * *) - ?BufferProcessed@QTMSClientSource@QTMS@@IAEXPBVQTMSBuffer@2@H@Z @ 231 NONAME ; void QTMS::QTMSClientSource::BufferProcessed(class QTMS::QTMSBuffer const *, int) - ?CreateStream@QTMSCall@QTMS@@QAEHHAAPAVQTMSStream@2@@Z @ 232 NONAME ; int QTMS::QTMSCall::CreateStream(int, class QTMS::QTMSStream * &) - ?DeleteInbandTonePlayer@QTMSFactory@QTMS@@QAEHAAPAVQTMSInbandTone@2@@Z @ 233 NONAME ; int QTMS::QTMSFactory::DeleteInbandTonePlayer(class QTMS::QTMSInbandTone * &) - ?SetLevel@QTMSGlobalGainEffect@QTMS@@QAEHI@Z @ 234 NONAME ; int QTMS::QTMSGlobalGainEffect::SetLevel(unsigned int) - ?GetStreamType@QTMSStream@QTMS@@QAEHXZ @ 235 NONAME ; int QTMS::QTMSStream::GetStreamType(void) - ?getStaticMetaObject@QTMSGlobalRouting@QTMS@@SAABUQMetaObject@@XZ @ 236 NONAME ; struct QMetaObject const & QTMS::QTMSGlobalRouting::getStaticMetaObject(void) - ??0QTMSGlobalVolEffect@QTMS@@IAE@XZ @ 237 NONAME ; QTMS::QTMSGlobalVolEffect::QTMSGlobalVolEffect(void) - ?CreateSink@QTMSFactory@QTMS@@QAEHHAAPAVQTMSSink@2@@Z @ 238 NONAME ; int QTMS::QTMSFactory::CreateSink(int, class QTMS::QTMSSink * &) - ?EffectsEvent@QTMSVolumeEffect@QTMS@@IAEXABVQTMSEffect@2@UQTMSSignalEvent@2@@Z @ 239 NONAME ; void QTMS::QTMSVolumeEffect::EffectsEvent(class QTMS::QTMSEffect const &, struct QTMS::QTMSSignalEvent) - ?getStaticMetaObject@QTMSG729Format@QTMS@@SAABUQMetaObject@@XZ @ 240 NONAME ; struct QMetaObject const & QTMS::QTMSG729Format::getStaticMetaObject(void) - ??1QTMSDTMF@QTMS@@UAE@XZ @ 241 NONAME ; QTMS::QTMSDTMF::~QTMSDTMF(void) - ?DeleteDTMF@QTMSFactory@QTMS@@QAEHAAPAVQTMSDTMF@2@@Z @ 242 NONAME ; int QTMS::QTMSFactory::DeleteDTMF(class QTMS::QTMSDTMF * &) - ??_EQTMSFormat@QTMS@@UAE@I@Z @ 243 NONAME ; QTMS::QTMSFormat::~QTMSFormat(unsigned int) - ?staticMetaObject@QTMSGlobalGainEffect@QTMS@@2UQMetaObject@@B @ 244 NONAME ; struct QMetaObject const QTMS::QTMSGlobalGainEffect::staticMetaObject - ?SetVADMode@QTMSILBCFormat@QTMS@@QAEHH@Z @ 245 NONAME ; int QTMS::QTMSILBCFormat::SetVADMode(int) - ??0QTMSCall@QTMS@@IAE@XZ @ 246 NONAME ; QTMS::QTMSCall::QTMSCall(void) - ?GetEnqueueMode@QTMSClientSource@QTMS@@QAEHAAH@Z @ 247 NONAME ; int QTMS::QTMSClientSource::GetEnqueueMode(int &) - ?metaObject@QTMSGlobalVolEffect@QTMS@@UBEPBUQMetaObject@@XZ @ 248 NONAME ; struct QMetaObject const * QTMS::QTMSGlobalVolEffect::metaObject(void) const - ?staticMetaObject@QTMSGlobalRouting@QTMS@@2UQMetaObject@@B @ 249 NONAME ; struct QMetaObject const QTMS::QTMSGlobalRouting::staticMetaObject - ?qt_metacast@QTMSFactory@QTMS@@UAEPAXPBD@Z @ 250 NONAME ; void * QTMS::QTMSFactory::qt_metacast(char const *) - ?SetCNG@QTMSG711Format@QTMS@@QAEHH@Z @ 251 NONAME ; int QTMS::QTMSG711Format::SetCNG(int) - ?qt_metacall@QTMSG729Format@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 252 NONAME ; int QTMS::QTMSG729Format::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@QTMSStream@QTMS@@SA?AVQString@@PBD0H@Z @ 253 NONAME ; class QString QTMS::QTMSStream::tr(char const *, char const *, int) - ?SetLevel@QTMSVolumeEffect@QTMS@@QAEHI@Z @ 254 NONAME ; int QTMS::QTMSVolumeEffect::SetLevel(unsigned int) - ?DeleteEffect@QTMSFactory@QTMS@@QAEHAAPAVQTMSEffect@2@@Z @ 255 NONAME ; int QTMS::QTMSFactory::DeleteEffect(class QTMS::QTMSEffect * &) - ?qt_metacast@QTMSCall@QTMS@@UAEPAXPBD@Z @ 256 NONAME ; void * QTMS::QTMSCall::qt_metacast(char const *) - ?SetFormat@QTMSStream@QTMS@@QAEHPAVQTMSFormat@2@@Z @ 257 NONAME ; int QTMS::QTMSStream::SetFormat(class QTMS::QTMSFormat *) - ?getStaticMetaObject@QTMSDTMF@QTMS@@SAABUQMetaObject@@XZ @ 258 NONAME ; struct QMetaObject const & QTMS::QTMSDTMF::getStaticMetaObject(void) - ?getStaticMetaObject@QTMSMicSource@QTMS@@SAABUQMetaObject@@XZ @ 259 NONAME ; struct QMetaObject const & QTMS::QTMSMicSource::getStaticMetaObject(void) - ?qt_metacall@QTMSRingTone@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 260 NONAME ; int QTMS::QTMSRingTone::qt_metacall(enum QMetaObject::Call, int, void * *) - ?trUtf8@QTMSClientSource@QTMS@@SA?AVQString@@PBD0H@Z @ 261 NONAME ; class QString QTMS::QTMSClientSource::trUtf8(char const *, char const *, int) - ?qt_metacall@QTMSGlobalGainEffect@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 262 NONAME ; int QTMS::QTMSGlobalGainEffect::qt_metacall(enum QMetaObject::Call, int, void * *) - ?CreateCall@QTMSFactory@QTMS@@QAEHHAAPAVQTMSCall@2@I@Z @ 263 NONAME ; int QTMS::QTMSFactory::CreateCall(int, class QTMS::QTMSCall * &, unsigned int) - ?SetVADMode@QTMSG729Format@QTMS@@QAEHH@Z @ 264 NONAME ; int QTMS::QTMSG729Format::SetVADMode(int) - ?DeleteBuffer@QTMSFactory@QTMS@@QAEHAAPAVQTMSBuffer@2@@Z @ 265 NONAME ; int QTMS::QTMSFactory::DeleteBuffer(class QTMS::QTMSBuffer * &) - ?trUtf8@QTMSG711Format@QTMS@@SA?AVQString@@PBD0@Z @ 266 NONAME ; class QString QTMS::QTMSG711Format::trUtf8(char const *, char const *) - ?qt_metacall@QTMSDTMF@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 267 NONAME ; int QTMS::QTMSDTMF::qt_metacall(enum QMetaObject::Call, int, void * *) - ?qt_metacall@QTMSModemSource@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 268 NONAME ; int QTMS::QTMSModemSource::qt_metacall(enum QMetaObject::Call, int, void * *) - ?CreateFactory@QTMSFactory@QTMS@@SAHAAPAV12@AAVQTMSVer@2@@Z @ 269 NONAME ; int QTMS::QTMSFactory::CreateFactory(class QTMS::QTMSFactory * &, class QTMS::QTMSVer &) - ?tr@QTMSClientSource@QTMS@@SA?AVQString@@PBD0H@Z @ 270 NONAME ; class QString QTMS::QTMSClientSource::tr(char const *, char const *, int) - ??1QTMSStream@QTMS@@UAE@XZ @ 271 NONAME ; QTMS::QTMSStream::~QTMSStream(void) - ?Init@QTMSRingTone@QTMS@@QAEHHPAU_GString@@0@Z @ 272 NONAME ; int QTMS::QTMSRingTone::Init(int, struct _GString *, struct _GString *) - ?qt_metacast@QTMSVolumeEffect@QTMS@@UAEPAXPBD@Z @ 273 NONAME ; void * QTMS::QTMSVolumeEffect::qt_metacast(char const *) - ??1QTMSRingTone@QTMS@@UAE@XZ @ 274 NONAME ; QTMS::QTMSRingTone::~QTMSRingTone(void) - ??_EQTMSStream@QTMS@@UAE@I@Z @ 275 NONAME ; QTMS::QTMSStream::~QTMSStream(unsigned int) - ?tr@QTMSSpeakerSink@QTMS@@SA?AVQString@@PBD0@Z @ 276 NONAME ; class QString QTMS::QTMSSpeakerSink::tr(char const *, char const *) - ?RemoveSink@QTMSStream@QTMS@@QAEHPAVQTMSSink@2@@Z @ 277 NONAME ; int QTMS::QTMSStream::RemoveSink(class QTMS::QTMSSink *) - ?trUtf8@QTMSModemSource@QTMS@@SA?AVQString@@PBD0H@Z @ 278 NONAME ; class QString QTMS::QTMSModemSource::trUtf8(char const *, char const *, int) - ?metaObject@QTMSILBCFormat@QTMS@@UBEPBUQMetaObject@@XZ @ 279 NONAME ; struct QMetaObject const * QTMS::QTMSILBCFormat::metaObject(void) const - ?staticMetaObject@QTMSPCMFormat@QTMS@@2UQMetaObject@@B @ 280 NONAME ; struct QMetaObject const QTMS::QTMSPCMFormat::staticMetaObject - ?getStaticMetaObject@QTMSClientSource@QTMS@@SAABUQMetaObject@@XZ @ 281 NONAME ; struct QMetaObject const & QTMS::QTMSClientSource::getStaticMetaObject(void) - ??1QTMSFactory@QTMS@@UAE@XZ @ 282 NONAME ; QTMS::QTMSFactory::~QTMSFactory(void) - ?DeleteSource@QTMSFactory@QTMS@@QAEHAAPAVQTMSSource@2@@Z @ 283 NONAME ; int QTMS::QTMSFactory::DeleteSource(class QTMS::QTMSSource * &) - ?qt_metacall@QTMSGlobalRouting@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 284 NONAME ; int QTMS::QTMSGlobalRouting::qt_metacall(enum QMetaObject::Call, int, void * *) - ??0QTMSGlobalGainEffect@QTMS@@IAE@XZ @ 285 NONAME ; QTMS::QTMSGlobalGainEffect::QTMSGlobalGainEffect(void) - ?trUtf8@QTMSPCMFormat@QTMS@@SA?AVQString@@PBD0@Z @ 286 NONAME ; class QString QTMS::QTMSPCMFormat::trUtf8(char const *, char const *) - ??0QTMSDTMF@QTMS@@IAE@XZ @ 287 NONAME ; QTMS::QTMSDTMF::QTMSDTMF(void) - ?GetLevel@QTMSGlobalVolEffect@QTMS@@QAEHAAI@Z @ 288 NONAME ; int QTMS::QTMSGlobalVolEffect::GetLevel(unsigned int &) - ?GetType@QTMSGlobalVolEffect@QTMS@@UAEHAAH@Z @ 289 NONAME ; int QTMS::QTMSGlobalVolEffect::GetType(int &) - ?getStaticMetaObject@QTMSILBCFormat@QTMS@@SAABUQMetaObject@@XZ @ 290 NONAME ; struct QMetaObject const & QTMS::QTMSILBCFormat::getStaticMetaObject(void) - ??_EQTMSGlobalGainEffect@QTMS@@UAE@I@Z @ 291 NONAME ; QTMS::QTMSGlobalGainEffect::~QTMSGlobalGainEffect(unsigned int) - ?trUtf8@QTMSGlobalVolEffect@QTMS@@SA?AVQString@@PBD0@Z @ 292 NONAME ; class QString QTMS::QTMSGlobalVolEffect::trUtf8(char const *, char const *) - ?qt_metacast@QTMSGlobalGainEffect@QTMS@@UAEPAXPBD@Z @ 293 NONAME ; void * QTMS::QTMSGlobalGainEffect::qt_metacast(char const *) - ??_EQTMSModemSink@QTMS@@UAE@I@Z @ 294 NONAME ; QTMS::QTMSModemSink::~QTMSModemSink(unsigned int) - ??0QTMSModemSink@QTMS@@IAE@XZ @ 295 NONAME ; QTMS::QTMSModemSink::QTMSModemSink(void) - ?tr@QTMSG711Format@QTMS@@SA?AVQString@@PBD0@Z @ 296 NONAME ; class QString QTMS::QTMSG711Format::tr(char const *, char const *) - ?GetState@QTMSStream@QTMS@@QAEHXZ @ 297 NONAME ; int QTMS::QTMSStream::GetState(void) - ?qt_metacall@QTMSG711Format@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 298 NONAME ; int QTMS::QTMSG711Format::qt_metacall(enum QMetaObject::Call, int, void * *) - ?getStaticMetaObject@QTMSClientSink@QTMS@@SAABUQMetaObject@@XZ @ 299 NONAME ; struct QMetaObject const & QTMS::QTMSClientSink::getStaticMetaObject(void) - ?qt_metacast@QTMSInbandTone@QTMS@@UAEPAXPBD@Z @ 300 NONAME ; void * QTMS::QTMSInbandTone::qt_metacast(char const *) - ?getStaticMetaObject@QTMSModemSource@QTMS@@SAABUQMetaObject@@XZ @ 301 NONAME ; struct QMetaObject const & QTMS::QTMSModemSource::getStaticMetaObject(void) - ?metaObject@QTMSGainEffect@QTMS@@UBEPBUQMetaObject@@XZ @ 302 NONAME ; struct QMetaObject const * QTMS::QTMSGainEffect::metaObject(void) const - ??0QTMSGlobalRouting@QTMS@@IAE@XZ @ 303 NONAME ; QTMS::QTMSGlobalRouting::QTMSGlobalRouting(void) - ?metaObject@QTMSClientSource@QTMS@@UBEPBUQMetaObject@@XZ @ 304 NONAME ; struct QMetaObject const * QTMS::QTMSClientSource::metaObject(void) const - ?qt_metacast@QTMSStream@QTMS@@UAEPAXPBD@Z @ 305 NONAME ; void * QTMS::QTMSStream::qt_metacast(char const *) - ?DeleteSink@QTMSFactory@QTMS@@QAEHAAPAVQTMSSink@2@@Z @ 306 NONAME ; int QTMS::QTMSFactory::DeleteSink(class QTMS::QTMSSink * &) - ?getStaticMetaObject@QTMSModemSink@QTMS@@SAABUQMetaObject@@XZ @ 307 NONAME ; struct QMetaObject const & QTMS::QTMSModemSink::getStaticMetaObject(void) - ?tr@QTMSClientSource@QTMS@@SA?AVQString@@PBD0@Z @ 308 NONAME ; class QString QTMS::QTMSClientSource::tr(char const *, char const *) - ?Mute@QTMSRingTone@QTMS@@QAEHXZ @ 309 NONAME ; int QTMS::QTMSRingTone::Mute(void) - ??_EQTMSDTMF@QTMS@@UAE@I@Z @ 310 NONAME ; QTMS::QTMSDTMF::~QTMSDTMF(unsigned int) - ?Start@QTMSStream@QTMS@@QAEHH@Z @ 311 NONAME ; int QTMS::QTMSStream::Start(int) - ?qt_metacall@QTMSStream@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 312 NONAME ; int QTMS::QTMSStream::qt_metacall(enum QMetaObject::Call, int, void * *) - ?tr@QTMSDTMF@QTMS@@SA?AVQString@@PBD0H@Z @ 313 NONAME ; class QString QTMS::QTMSDTMF::tr(char const *, char const *, int) - ?qt_metacast@QTMSGainEffect@QTMS@@UAEPAXPBD@Z @ 314 NONAME ; void * QTMS::QTMSGainEffect::qt_metacast(char const *) - ?GetCallContextId@QTMSCall@QTMS@@QAEHAAI@Z @ 315 NONAME ; int QTMS::QTMSCall::GetCallContextId(unsigned int &) - ?GetCallType@QTMSCall@QTMS@@QAEHXZ @ 316 NONAME ; int QTMS::QTMSCall::GetCallType(void) - ?Start@QTMSDTMF@QTMS@@QAEHXZ @ 317 NONAME ; int QTMS::QTMSDTMF::Start(void) - ?trUtf8@QTMSGlobalGainEffect@QTMS@@SA?AVQString@@PBD0@Z @ 318 NONAME ; class QString QTMS::QTMSGlobalGainEffect::trUtf8(char const *, char const *) - ?SetOutput@QTMSGlobalRouting@QTMS@@QAEHH@Z @ 319 NONAME ; int QTMS::QTMSGlobalRouting::SetOutput(int) - ??0QTMSClientSink@QTMS@@IAE@XZ @ 320 NONAME ; QTMS::QTMSClientSink::QTMSClientSink(void) - ?SetLevel@QTMSGlobalVolEffect@QTMS@@QAEHI@Z @ 321 NONAME ; int QTMS::QTMSGlobalVolEffect::SetLevel(unsigned int) - ?metaObject@QTMSRingTone@QTMS@@UBEPBUQMetaObject@@XZ @ 322 NONAME ; struct QMetaObject const * QTMS::QTMSRingTone::metaObject(void) const - ?ProcessBuffer@QTMSClientSink@QTMS@@IAEXPBVQTMSBuffer@2@@Z @ 323 NONAME ; void QTMS::QTMSClientSink::ProcessBuffer(class QTMS::QTMSBuffer const *) - ?IsCallTypeSupported@QTMSFactory@QTMS@@QAEHHAAH@Z @ 324 NONAME ; int QTMS::QTMSFactory::IsCallTypeSupported(int, int &) - ?qt_metacast@QTMSGlobalVolEffect@QTMS@@UAEPAXPBD@Z @ 325 NONAME ; void * QTMS::QTMSGlobalVolEffect::qt_metacast(char const *) - ?staticMetaObject@QTMSModemSource@QTMS@@2UQMetaObject@@B @ 326 NONAME ; struct QMetaObject const QTMS::QTMSModemSource::staticMetaObject - ?GetStreamId@QTMSStream@QTMS@@QAEHXZ @ 327 NONAME ; int QTMS::QTMSStream::GetStreamId(void) - ??0QTMSG729Format@QTMS@@IAE@XZ @ 328 NONAME ; QTMS::QTMSG729Format::QTMSG729Format(void) - ??_EQTMSGlobalVolEffect@QTMS@@UAE@I@Z @ 329 NONAME ; QTMS::QTMSGlobalVolEffect::~QTMSGlobalVolEffect(unsigned int) - ?getStaticMetaObject@QTMSAMRFormat@QTMS@@SAABUQMetaObject@@XZ @ 330 NONAME ; struct QMetaObject const & QTMS::QTMSAMRFormat::getStaticMetaObject(void) - ?staticMetaObject@QTMSVolumeEffect@QTMS@@2UQMetaObject@@B @ 331 NONAME ; struct QMetaObject const QTMS::QTMSVolumeEffect::staticMetaObject - ??_EQTMSRingTone@QTMS@@UAE@I@Z @ 332 NONAME ; QTMS::QTMSRingTone::~QTMSRingTone(unsigned int) - ??0QTMSFormat@QTMS@@IAE@XZ @ 333 NONAME ; QTMS::QTMSFormat::QTMSFormat(void) - ?GetSupportedFormats@QTMSFactory@QTMS@@QAEHHAAV?$vector@PAVQTMSFormat@QTMS@@V?$allocator@PAVQTMSFormat@QTMS@@@std@@@std@@@Z @ 334 NONAME ; int QTMS::QTMSFactory::GetSupportedFormats(int, class std::vector > &) - ?SetVADMode@QTMSG711Format@QTMS@@QAEHH@Z @ 335 NONAME ; int QTMS::QTMSG711Format::SetVADMode(int) - ?getStaticMetaObject@QTMSVolumeEffect@QTMS@@SAABUQMetaObject@@XZ @ 336 NONAME ; struct QMetaObject const & QTMS::QTMSVolumeEffect::getStaticMetaObject(void) - ?qt_metacall@QTMSModemSink@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 337 NONAME ; int QTMS::QTMSModemSink::qt_metacall(enum QMetaObject::Call, int, void * *) - ?trUtf8@QTMSILBCFormat@QTMS@@SA?AVQString@@PBD0H@Z @ 338 NONAME ; class QString QTMS::QTMSILBCFormat::trUtf8(char const *, char const *, int) - ?trUtf8@QTMSDTMF@QTMS@@SA?AVQString@@PBD0@Z @ 339 NONAME ; class QString QTMS::QTMSDTMF::trUtf8(char const *, char const *) - ?tr@QTMSGlobalGainEffect@QTMS@@SA?AVQString@@PBD0@Z @ 340 NONAME ; class QString QTMS::QTMSGlobalGainEffect::tr(char const *, char const *) - ?AddEffect@QTMSStream@QTMS@@QAEHPAVQTMSEffect@2@@Z @ 341 NONAME ; int QTMS::QTMSStream::AddEffect(class QTMS::QTMSEffect *) - ?ResetFormat@QTMSStream@QTMS@@QAEHPAVQTMSFormat@2@@Z @ 342 NONAME ; int QTMS::QTMSStream::ResetFormat(class QTMS::QTMSFormat *) - ?metaObject@QTMSG711Format@QTMS@@UBEPBUQMetaObject@@XZ @ 343 NONAME ; struct QMetaObject const * QTMS::QTMSG711Format::metaObject(void) const - ??1QTMSVolumeEffect@QTMS@@UAE@XZ @ 344 NONAME ; QTMS::QTMSVolumeEffect::~QTMSVolumeEffect(void) - ?EffectsEvent@QTMSGlobalGainEffect@QTMS@@IAEXABVQTMSEffect@2@UQTMSSignalEvent@2@@Z @ 345 NONAME ; void QTMS::QTMSGlobalGainEffect::EffectsEvent(class QTMS::QTMSEffect const &, struct QTMS::QTMSSignalEvent) - ?GetSupportedBitRates@QTMSFormat@QTMS@@QAEHAAV?$vector@IV?$allocator@I@std@@@std@@@Z @ 346 NONAME ; int QTMS::QTMSFormat::GetSupportedBitRates(class std::vector > &) - ?staticMetaObject@QTMSCall@QTMS@@2UQMetaObject@@B @ 347 NONAME ; struct QMetaObject const QTMS::QTMSCall::staticMetaObject - ??1QTMSModemSource@QTMS@@UAE@XZ @ 348 NONAME ; QTMS::QTMSModemSource::~QTMSModemSource(void) - ??1QTMSClientSink@QTMS@@UAE@XZ @ 349 NONAME ; QTMS::QTMSClientSink::~QTMSClientSink(void) - ?metaObject@QTMSFactory@QTMS@@UBEPBUQMetaObject@@XZ @ 350 NONAME ; struct QMetaObject const * QTMS::QTMSFactory::metaObject(void) const - ?metaObject@QTMSInbandTone@QTMS@@UBEPBUQMetaObject@@XZ @ 351 NONAME ; struct QMetaObject const * QTMS::QTMSInbandTone::metaObject(void) const - ?trUtf8@QTMSGainEffect@QTMS@@SA?AVQString@@PBD0H@Z @ 352 NONAME ; class QString QTMS::QTMSGainEffect::trUtf8(char const *, char const *, int) - ?trUtf8@QTMSMicSource@QTMS@@SA?AVQString@@PBD0H@Z @ 353 NONAME ; class QString QTMS::QTMSMicSource::trUtf8(char const *, char const *, int) - ?GetMaxLevel@QTMSGlobalVolEffect@QTMS@@QAEHAAI@Z @ 354 NONAME ; int QTMS::QTMSGlobalVolEffect::GetMaxLevel(unsigned int &) - ??_EQTMSVolumeEffect@QTMS@@UAE@I@Z @ 355 NONAME ; QTMS::QTMSVolumeEffect::~QTMSVolumeEffect(unsigned int) - ??1QTMSG729Format@QTMS@@UAE@XZ @ 356 NONAME ; QTMS::QTMSG729Format::~QTMSG729Format(void) - ?tr@QTMSVolumeEffect@QTMS@@SA?AVQString@@PBD0@Z @ 357 NONAME ; class QString QTMS::QTMSVolumeEffect::tr(char const *, char const *) - ?GetType@QTMSMicSource@QTMS@@UAEHAAH@Z @ 358 NONAME ; int QTMS::QTMSMicSource::GetType(int &) - ?CreateEffect@QTMSFactory@QTMS@@QAEHHAAPAVQTMSEffect@2@@Z @ 359 NONAME ; int QTMS::QTMSFactory::CreateEffect(int, class QTMS::QTMSEffect * &) - ?getStaticMetaObject@QTMSCall@QTMS@@SAABUQMetaObject@@XZ @ 360 NONAME ; struct QMetaObject const & QTMS::QTMSCall::getStaticMetaObject(void) - ?metaObject@QTMSGlobalGainEffect@QTMS@@UBEPBUQMetaObject@@XZ @ 361 NONAME ; struct QMetaObject const * QTMS::QTMSGlobalGainEffect::metaObject(void) const - ??0QTMSFactory@QTMS@@AAE@XZ @ 362 NONAME ; QTMS::QTMSFactory::QTMSFactory(void) + ??0QTMSFactory@QTMS@@AAE@AAVQTMSVer@1@@Z @ 115 NONAME ; QTMS::QTMSFactory::QTMSFactory(class QTMS::QTMSVer &) + ?getStaticMetaObject@QTMSStream@QTMS@@SAABUQMetaObject@@XZ @ 116 NONAME ; struct QMetaObject const & QTMS::QTMSStream::getStaticMetaObject(void) + ?trUtf8@QTMSClientSource@QTMS@@SA?AVQString@@PBD0@Z @ 117 NONAME ; class QString QTMS::QTMSClientSource::trUtf8(char const *, char const *) + ?tr@QTMSAMRFormat@QTMS@@SA?AVQString@@PBD0H@Z @ 118 NONAME ; class QString QTMS::QTMSAMRFormat::tr(char const *, char const *, int) + ?qt_metacast@QTMSModemSource@QTMS@@UAEPAXPBD@Z @ 119 NONAME ; void * QTMS::QTMSModemSource::qt_metacast(char const *) + ?getStaticMetaObject@QTMSG711Format@QTMS@@SAABUQMetaObject@@XZ @ 120 NONAME ; struct QMetaObject const & QTMS::QTMSG711Format::getStaticMetaObject(void) + ??_EQTMSClientSource@QTMS@@UAE@I@Z @ 121 NONAME ; QTMS::QTMSClientSource::~QTMSClientSource(unsigned int) + ?GetLevel@QTMSGainEffect@QTMS@@QAEHAAI@Z @ 122 NONAME ; int QTMS::QTMSGainEffect::GetLevel(unsigned int &) + ?tr@QTMSFactory@QTMS@@SA?AVQString@@PBD0@Z @ 123 NONAME ; class QString QTMS::QTMSFactory::tr(char const *, char const *) + ?qt_metacast@QTMSGlobalRouting@QTMS@@UAEPAXPBD@Z @ 124 NONAME ; void * QTMS::QTMSGlobalRouting::qt_metacast(char const *) + ?getStaticMetaObject@QTMSFactory@QTMS@@SAABUQMetaObject@@XZ @ 125 NONAME ; struct QMetaObject const & QTMS::QTMSFactory::getStaticMetaObject(void) + ??_EQTMSAMRFormat@QTMS@@UAE@I@Z @ 126 NONAME ; QTMS::QTMSAMRFormat::~QTMSAMRFormat(unsigned int) + ?getStaticMetaObject@QTMSPCMFormat@QTMS@@SAABUQMetaObject@@XZ @ 127 NONAME ; struct QMetaObject const & QTMS::QTMSPCMFormat::getStaticMetaObject(void) + ?Flush@QTMSClientSource@QTMS@@QAEHXZ @ 128 NONAME ; int QTMS::QTMSClientSource::Flush(void) + ?Stop@QTMSRingTone@QTMS@@QAEHXZ @ 129 NONAME ; int QTMS::QTMSRingTone::Stop(void) + ?DeleteGlobalRouting@QTMSFactory@QTMS@@QAEHAAPAVQTMSGlobalRouting@2@@Z @ 130 NONAME ; int QTMS::QTMSFactory::DeleteGlobalRouting(class QTMS::QTMSGlobalRouting * &) + ?tr@QTMSGlobalRouting@QTMS@@SA?AVQString@@PBD0H@Z @ 131 NONAME ; class QString QTMS::QTMSGlobalRouting::tr(char const *, char const *, int) + ?SetMode@QTMSG711Format@QTMS@@QAEHH@Z @ 132 NONAME ; int QTMS::QTMSG711Format::SetMode(int) + ?GetMode@QTMSILBCFormat@QTMS@@QAEHAAH@Z @ 133 NONAME ; int QTMS::QTMSILBCFormat::GetMode(int &) + ?GetMode@QTMSG711Format@QTMS@@QAEHAAH@Z @ 134 NONAME ; int QTMS::QTMSG711Format::GetMode(int &) + ?GetAvailableOutputs@QTMSGlobalRouting@QTMS@@QAEHAAV?$vector@IV?$allocator@I@std@@@std@@@Z @ 135 NONAME ; int QTMS::QTMSGlobalRouting::GetAvailableOutputs(class std::vector > &) + ?staticMetaObject@QTMSFactory@QTMS@@2UQMetaObject@@B @ 136 NONAME ; struct QMetaObject const QTMS::QTMSFactory::staticMetaObject + ?DeleteFormat@QTMSFactory@QTMS@@QAEHAAPAVQTMSFormat@2@@Z @ 137 NONAME ; int QTMS::QTMSFactory::DeleteFormat(class QTMS::QTMSFormat * &) + ?tr@QTMSILBCFormat@QTMS@@SA?AVQString@@PBD0H@Z @ 138 NONAME ; class QString QTMS::QTMSILBCFormat::tr(char const *, char const *, int) + ??1QTMSPCMFormat@QTMS@@UAE@XZ @ 139 NONAME ; QTMS::QTMSPCMFormat::~QTMSPCMFormat(void) + ?trUtf8@QTMSGainEffect@QTMS@@SA?AVQString@@PBD0@Z @ 140 NONAME ; class QString QTMS::QTMSGainEffect::trUtf8(char const *, char const *) + ??0QTMSG711Format@QTMS@@IAE@XZ @ 141 NONAME ; QTMS::QTMSG711Format::QTMSG711Format(void) + ?staticMetaObject@QTMSILBCFormat@QTMS@@2UQMetaObject@@B @ 142 NONAME ; struct QMetaObject const QTMS::QTMSILBCFormat::staticMetaObject + ?metaObject@QTMSG729Format@QTMS@@UBEPBUQMetaObject@@XZ @ 143 NONAME ; struct QMetaObject const * QTMS::QTMSG729Format::metaObject(void) const + ?tr@QTMSFactory@QTMS@@SA?AVQString@@PBD0H@Z @ 144 NONAME ; class QString QTMS::QTMSFactory::tr(char const *, char const *, int) + ?tr@QTMSCall@QTMS@@SA?AVQString@@PBD0H@Z @ 145 NONAME ; class QString QTMS::QTMSCall::tr(char const *, char const *, int) + ?staticMetaObject@QTMSClientSink@QTMS@@2UQMetaObject@@B @ 146 NONAME ; struct QMetaObject const QTMS::QTMSClientSink::staticMetaObject + ?ProcessBuffer@QTMSClientSource@QTMS@@QAEHPAVQTMSBuffer@2@@Z @ 147 NONAME ; int QTMS::QTMSClientSource::ProcessBuffer(class QTMS::QTMSBuffer *) + ?EffectsEvent@QTMSGlobalVolEffect@QTMS@@IAEXABVQTMSEffect@2@UQTMSSignalEvent@2@@Z @ 148 NONAME ; void QTMS::QTMSGlobalVolEffect::EffectsEvent(class QTMS::QTMSEffect const &, struct QTMS::QTMSSignalEvent) + ?CreateFormat@QTMSFactory@QTMS@@QAEHHAAPAVQTMSFormat@2@@Z @ 149 NONAME ; int QTMS::QTMSFactory::CreateFormat(int, class QTMS::QTMSFormat * &) + ?SetCNG@QTMSILBCFormat@QTMS@@QAEHH@Z @ 150 NONAME ; int QTMS::QTMSILBCFormat::SetCNG(int) + ??1QTMSAMRFormat@QTMS@@UAE@XZ @ 151 NONAME ; QTMS::QTMSAMRFormat::~QTMSAMRFormat(void) + ?metaObject@QTMSClientSink@QTMS@@UBEPBUQMetaObject@@XZ @ 152 NONAME ; struct QMetaObject const * QTMS::QTMSClientSink::metaObject(void) const + ?trUtf8@QTMSInbandTone@QTMS@@SA?AVQString@@PBD0@Z @ 153 NONAME ; class QString QTMS::QTMSInbandTone::trUtf8(char const *, char const *) + ?staticMetaObject@QTMSG711Format@QTMS@@2UQMetaObject@@B @ 154 NONAME ; struct QMetaObject const QTMS::QTMSG711Format::staticMetaObject + ?trUtf8@QTMSDTMF@QTMS@@SA?AVQString@@PBD0H@Z @ 155 NONAME ; class QString QTMS::QTMSDTMF::trUtf8(char const *, char const *, int) + ?InbandToneEvent@QTMSInbandTone@QTMS@@IAEXABV12@UQTMSSignalEvent@2@@Z @ 156 NONAME ; void QTMS::QTMSInbandTone::InbandToneEvent(class QTMS::QTMSInbandTone const &, struct QTMS::QTMSSignalEvent) + ?tr@QTMSModemSink@QTMS@@SA?AVQString@@PBD0@Z @ 157 NONAME ; class QString QTMS::QTMSModemSink::tr(char const *, char const *) + ?tr@QTMSGainEffect@QTMS@@SA?AVQString@@PBD0H@Z @ 158 NONAME ; class QString QTMS::QTMSGainEffect::tr(char const *, char const *, int) + ?qt_metacast@QTMSG711Format@QTMS@@UAEPAXPBD@Z @ 159 NONAME ; void * QTMS::QTMSG711Format::qt_metacast(char const *) + ?GetMaxLevel@QTMSVolumeEffect@QTMS@@QAEHAAI@Z @ 160 NONAME ; int QTMS::QTMSVolumeEffect::GetMaxLevel(unsigned int &) + ??0QTMSSpeakerSink@QTMS@@IAE@XZ @ 161 NONAME ; QTMS::QTMSSpeakerSink::QTMSSpeakerSink(void) + ??_EQTMSMicSource@QTMS@@UAE@I@Z @ 162 NONAME ; QTMS::QTMSMicSource::~QTMSMicSource(unsigned int) + ?metaObject@QTMSModemSink@QTMS@@UBEPBUQMetaObject@@XZ @ 163 NONAME ; struct QMetaObject const * QTMS::QTMSModemSink::metaObject(void) const + ?DeleteCall@QTMSFactory@QTMS@@QAEHAAPAVQTMSCall@2@@Z @ 164 NONAME ; int QTMS::QTMSFactory::DeleteCall(class QTMS::QTMSCall * &) + ?tr@QTMSGlobalGainEffect@QTMS@@SA?AVQString@@PBD0H@Z @ 165 NONAME ; class QString QTMS::QTMSGlobalGainEffect::tr(char const *, char const *, int) + ?qt_metacall@QTMSMicSource@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 166 NONAME ; int QTMS::QTMSMicSource::qt_metacall(enum QMetaObject::Call, int, void * *) + ?GetType@QTMSFormat@QTMS@@UAEHAAH@Z @ 167 NONAME ; int QTMS::QTMSFormat::GetType(int &) + ?DeleteStream@QTMSCall@QTMS@@QAEHAAPAVQTMSStream@2@@Z @ 168 NONAME ; int QTMS::QTMSCall::DeleteStream(class QTMS::QTMSStream * &) + ?trUtf8@QTMSVolumeEffect@QTMS@@SA?AVQString@@PBD0@Z @ 169 NONAME ; class QString QTMS::QTMSVolumeEffect::trUtf8(char const *, char const *) + ?CreateInbandTonePlayer@QTMSFactory@QTMS@@QAEHAAPAVQTMSInbandTone@2@@Z @ 170 NONAME ; int QTMS::QTMSFactory::CreateInbandTonePlayer(class QTMS::QTMSInbandTone * &) + ?trUtf8@QTMSGlobalRouting@QTMS@@SA?AVQString@@PBD0@Z @ 171 NONAME ; class QString QTMS::QTMSGlobalRouting::trUtf8(char const *, char const *) + ??1QTMSG711Format@QTMS@@UAE@XZ @ 172 NONAME ; QTMS::QTMSG711Format::~QTMSG711Format(void) + ?BufferProcessed@QTMSClientSink@QTMS@@QAEHPAVQTMSBuffer@2@@Z @ 173 NONAME ; int QTMS::QTMSClientSink::BufferProcessed(class QTMS::QTMSBuffer *) + ?tr@QTMSGainEffect@QTMS@@SA?AVQString@@PBD0@Z @ 174 NONAME ; class QString QTMS::QTMSGainEffect::tr(char const *, char const *) + ??_EQTMSModemSource@QTMS@@UAE@I@Z @ 175 NONAME ; QTMS::QTMSModemSource::~QTMSModemSource(unsigned int) + ?qt_metacall@QTMSPCMFormat@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 176 NONAME ; int QTMS::QTMSPCMFormat::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0QTMSILBCFormat@QTMS@@IAE@XZ @ 177 NONAME ; QTMS::QTMSILBCFormat::QTMSILBCFormat(void) + ?trUtf8@QTMSStream@QTMS@@SA?AVQString@@PBD0H@Z @ 178 NONAME ; class QString QTMS::QTMSStream::trUtf8(char const *, char const *, int) + ?qt_metacast@QTMSPCMFormat@QTMS@@UAEPAXPBD@Z @ 179 NONAME ; void * QTMS::QTMSPCMFormat::qt_metacast(char const *) + ?qt_metacall@QTMSSpeakerSink@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 180 NONAME ; int QTMS::QTMSSpeakerSink::qt_metacall(enum QMetaObject::Call, int, void * *) + ?GetLevel@QTMSVolumeEffect@QTMS@@QAEHAAI@Z @ 181 NONAME ; int QTMS::QTMSVolumeEffect::GetLevel(unsigned int &) + ?trUtf8@QTMSFactory@QTMS@@SA?AVQString@@PBD0H@Z @ 182 NONAME ; class QString QTMS::QTMSFactory::trUtf8(char const *, char const *, int) + ??_EQTMSGainEffect@QTMS@@UAE@I@Z @ 183 NONAME ; QTMS::QTMSGainEffect::~QTMSGainEffect(unsigned int) + ?tr@QTMSGlobalRouting@QTMS@@SA?AVQString@@PBD0@Z @ 184 NONAME ; class QString QTMS::QTMSGlobalRouting::tr(char const *, char const *) + ?tr@QTMSAMRFormat@QTMS@@SA?AVQString@@PBD0@Z @ 185 NONAME ; class QString QTMS::QTMSAMRFormat::tr(char const *, char const *) + ?getStaticMetaObject@QTMSSpeakerSink@QTMS@@SAABUQMetaObject@@XZ @ 186 NONAME ; struct QMetaObject const & QTMS::QTMSSpeakerSink::getStaticMetaObject(void) + ?CreateDTMF@QTMSFactory@QTMS@@QAEHHAAPAVQTMSDTMF@2@@Z @ 187 NONAME ; int QTMS::QTMSFactory::CreateDTMF(int, class QTMS::QTMSDTMF * &) + ?trUtf8@QTMSStream@QTMS@@SA?AVQString@@PBD0@Z @ 188 NONAME ; class QString QTMS::QTMSStream::trUtf8(char const *, char const *) + ?Init@QTMSStream@QTMS@@QAEHH@Z @ 189 NONAME ; int QTMS::QTMSStream::Init(int) + ?tr@QTMSInbandTone@QTMS@@SA?AVQString@@PBD0@Z @ 190 NONAME ; class QString QTMS::QTMSInbandTone::tr(char const *, char const *) + ?tr@QTMSStream@QTMS@@SA?AVQString@@PBD0@Z @ 191 NONAME ; class QString QTMS::QTMSStream::tr(char const *, char const *) + ??1QTMSMicSource@QTMS@@UAE@XZ @ 192 NONAME ; QTMS::QTMSMicSource::~QTMSMicSource(void) + ?BufferFilled@QTMSClientSource@QTMS@@QAEHAAVQTMSBuffer@2@@Z @ 193 NONAME ; int QTMS::QTMSClientSource::BufferFilled(class QTMS::QTMSBuffer &) + ??_EQTMSFactory@QTMS@@UAE@I@Z @ 194 NONAME ; QTMS::QTMSFactory::~QTMSFactory(unsigned int) + ??1QTMSCall@QTMS@@UAE@XZ @ 195 NONAME ; QTMS::QTMSCall::~QTMSCall(void) + ?staticMetaObject@QTMSG729Format@QTMS@@2UQMetaObject@@B @ 196 NONAME ; struct QMetaObject const QTMS::QTMSG729Format::staticMetaObject + ??0QTMSClientSource@QTMS@@IAE@XZ @ 197 NONAME ; QTMS::QTMSClientSource::QTMSClientSource(void) + ?Stop@QTMSInbandTone@QTMS@@QAEHXZ @ 198 NONAME ; int QTMS::QTMSInbandTone::Stop(void) + ?tr@QTMSCall@QTMS@@SA?AVQString@@PBD0@Z @ 199 NONAME ; class QString QTMS::QTMSCall::tr(char const *, char const *) + ?qt_metacall@QTMSCall@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 200 NONAME ; int QTMS::QTMSCall::qt_metacall(enum QMetaObject::Call, int, void * *) + ?metaObject@QTMSSpeakerSink@QTMS@@UBEPBUQMetaObject@@XZ @ 201 NONAME ; struct QMetaObject const * QTMS::QTMSSpeakerSink::metaObject(void) const + ?SetTone@QTMSDTMF@QTMS@@QAEHPAU_GString@@@Z @ 202 NONAME ; int QTMS::QTMSDTMF::SetTone(struct _GString *) + ?SetEnqueueMode@QTMSClientSource@QTMS@@QAEHH@Z @ 203 NONAME ; int QTMS::QTMSClientSource::SetEnqueueMode(int) + ?staticMetaObject@QTMSClientSource@QTMS@@2UQMetaObject@@B @ 204 NONAME ; struct QMetaObject const QTMS::QTMSClientSource::staticMetaObject + ?trUtf8@QTMSModemSource@QTMS@@SA?AVQString@@PBD0@Z @ 205 NONAME ; class QString QTMS::QTMSModemSource::trUtf8(char const *, char const *) + ?trUtf8@QTMSG729Format@QTMS@@SA?AVQString@@PBD0H@Z @ 206 NONAME ; class QString QTMS::QTMSG729Format::trUtf8(char const *, char const *, int) + ?GetType@QTMSVolumeEffect@QTMS@@UAEHAAH@Z @ 207 NONAME ; int QTMS::QTMSVolumeEffect::GetType(int &) + ?qt_metacall@QTMSVolumeEffect@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 208 NONAME ; int QTMS::QTMSVolumeEffect::qt_metacall(enum QMetaObject::Call, int, void * *) + ?tr@QTMSG711Format@QTMS@@SA?AVQString@@PBD0H@Z @ 209 NONAME ; class QString QTMS::QTMSG711Format::tr(char const *, char const *, int) + ??1QTMSILBCFormat@QTMS@@UAE@XZ @ 210 NONAME ; QTMS::QTMSILBCFormat::~QTMSILBCFormat(void) + ?Play@QTMSRingTone@QTMS@@QAEHXZ @ 211 NONAME ; int QTMS::QTMSRingTone::Play(void) + ?qt_metacall@QTMSILBCFormat@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 212 NONAME ; int QTMS::QTMSILBCFormat::qt_metacall(enum QMetaObject::Call, int, void * *) + ?tr@QTMSSpeakerSink@QTMS@@SA?AVQString@@PBD0H@Z @ 213 NONAME ; class QString QTMS::QTMSSpeakerSink::tr(char const *, char const *, int) + ?GetBitRate@QTMSFormat@QTMS@@QAEHAAI@Z @ 214 NONAME ; int QTMS::QTMSFormat::GetBitRate(unsigned int &) + ?GetType@QTMSModemSource@QTMS@@UAEHAAH@Z @ 215 NONAME ; int QTMS::QTMSModemSource::GetType(int &) + ?staticMetaObject@QTMSGlobalVolEffect@QTMS@@2UQMetaObject@@B @ 216 NONAME ; struct QMetaObject const QTMS::QTMSGlobalVolEffect::staticMetaObject + ??1QTMSFormat@QTMS@@UAE@XZ @ 217 NONAME ; QTMS::QTMSFormat::~QTMSFormat(void) + ?GetPlc@QTMSG711Format@QTMS@@QAEHAAH@Z @ 218 NONAME ; int QTMS::QTMSG711Format::GetPlc(int &) + ?Start@QTMSInbandTone@QTMS@@QAEHH@Z @ 219 NONAME ; int QTMS::QTMSInbandTone::Start(int) + ?trUtf8@QTMSClientSink@QTMS@@SA?AVQString@@PBD0H@Z @ 220 NONAME ; class QString QTMS::QTMSClientSink::trUtf8(char const *, char const *, int) + ?tr@QTMSInbandTone@QTMS@@SA?AVQString@@PBD0H@Z @ 221 NONAME ; class QString QTMS::QTMSInbandTone::tr(char const *, char const *, int) + ??_EQTMSPCMFormat@QTMS@@UAE@I@Z @ 222 NONAME ; QTMS::QTMSPCMFormat::~QTMSPCMFormat(unsigned int) + ?metaObject@QTMSAMRFormat@QTMS@@UBEPBUQMetaObject@@XZ @ 223 NONAME ; struct QMetaObject const * QTMS::QTMSAMRFormat::metaObject(void) const + ?metaObject@QTMSStream@QTMS@@UBEPBUQMetaObject@@XZ @ 224 NONAME ; struct QMetaObject const * QTMS::QTMSStream::metaObject(void) const + ?getStaticMetaObject@QTMSGlobalGainEffect@QTMS@@SAABUQMetaObject@@XZ @ 225 NONAME ; struct QMetaObject const & QTMS::QTMSGlobalGainEffect::getStaticMetaObject(void) + ?tr@QTMSGlobalVolEffect@QTMS@@SA?AVQString@@PBD0@Z @ 226 NONAME ; class QString QTMS::QTMSGlobalVolEffect::tr(char const *, char const *) + ?staticMetaObject@QTMSInbandTone@QTMS@@2UQMetaObject@@B @ 227 NONAME ; struct QMetaObject const QTMS::QTMSInbandTone::staticMetaObject + ?trUtf8@QTMSGlobalGainEffect@QTMS@@SA?AVQString@@PBD0H@Z @ 228 NONAME ; class QString QTMS::QTMSGlobalGainEffect::trUtf8(char const *, char const *, int) + ?qt_metacast@QTMSClientSource@QTMS@@UAEPAXPBD@Z @ 229 NONAME ; void * QTMS::QTMSClientSource::qt_metacast(char const *) + ?metaObject@QTMSCall@QTMS@@UBEPBUQMetaObject@@XZ @ 230 NONAME ; struct QMetaObject const * QTMS::QTMSCall::metaObject(void) const + ?qt_metacall@QTMSClientSink@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 231 NONAME ; int QTMS::QTMSClientSink::qt_metacall(enum QMetaObject::Call, int, void * *) + ?BufferProcessed@QTMSClientSource@QTMS@@IAEXPBVQTMSBuffer@2@H@Z @ 232 NONAME ; void QTMS::QTMSClientSource::BufferProcessed(class QTMS::QTMSBuffer const *, int) + ?CreateStream@QTMSCall@QTMS@@QAEHHAAPAVQTMSStream@2@@Z @ 233 NONAME ; int QTMS::QTMSCall::CreateStream(int, class QTMS::QTMSStream * &) + ?DeleteInbandTonePlayer@QTMSFactory@QTMS@@QAEHAAPAVQTMSInbandTone@2@@Z @ 234 NONAME ; int QTMS::QTMSFactory::DeleteInbandTonePlayer(class QTMS::QTMSInbandTone * &) + ?SetLevel@QTMSGlobalGainEffect@QTMS@@QAEHI@Z @ 235 NONAME ; int QTMS::QTMSGlobalGainEffect::SetLevel(unsigned int) + ?GetStreamType@QTMSStream@QTMS@@QAEHXZ @ 236 NONAME ; int QTMS::QTMSStream::GetStreamType(void) + ?getStaticMetaObject@QTMSGlobalRouting@QTMS@@SAABUQMetaObject@@XZ @ 237 NONAME ; struct QMetaObject const & QTMS::QTMSGlobalRouting::getStaticMetaObject(void) + ??0QTMSGlobalVolEffect@QTMS@@IAE@XZ @ 238 NONAME ; QTMS::QTMSGlobalVolEffect::QTMSGlobalVolEffect(void) + ?CreateSink@QTMSFactory@QTMS@@QAEHHAAPAVQTMSSink@2@@Z @ 239 NONAME ; int QTMS::QTMSFactory::CreateSink(int, class QTMS::QTMSSink * &) + ?EffectsEvent@QTMSVolumeEffect@QTMS@@IAEXABVQTMSEffect@2@UQTMSSignalEvent@2@@Z @ 240 NONAME ; void QTMS::QTMSVolumeEffect::EffectsEvent(class QTMS::QTMSEffect const &, struct QTMS::QTMSSignalEvent) + ?getStaticMetaObject@QTMSG729Format@QTMS@@SAABUQMetaObject@@XZ @ 241 NONAME ; struct QMetaObject const & QTMS::QTMSG729Format::getStaticMetaObject(void) + ??1QTMSDTMF@QTMS@@UAE@XZ @ 242 NONAME ; QTMS::QTMSDTMF::~QTMSDTMF(void) + ?DeleteDTMF@QTMSFactory@QTMS@@QAEHAAPAVQTMSDTMF@2@@Z @ 243 NONAME ; int QTMS::QTMSFactory::DeleteDTMF(class QTMS::QTMSDTMF * &) + ??_EQTMSFormat@QTMS@@UAE@I@Z @ 244 NONAME ; QTMS::QTMSFormat::~QTMSFormat(unsigned int) + ?staticMetaObject@QTMSGlobalGainEffect@QTMS@@2UQMetaObject@@B @ 245 NONAME ; struct QMetaObject const QTMS::QTMSGlobalGainEffect::staticMetaObject + ?SetVADMode@QTMSILBCFormat@QTMS@@QAEHH@Z @ 246 NONAME ; int QTMS::QTMSILBCFormat::SetVADMode(int) + ??0QTMSCall@QTMS@@IAE@XZ @ 247 NONAME ; QTMS::QTMSCall::QTMSCall(void) + ?GetEnqueueMode@QTMSClientSource@QTMS@@QAEHAAH@Z @ 248 NONAME ; int QTMS::QTMSClientSource::GetEnqueueMode(int &) + ?metaObject@QTMSGlobalVolEffect@QTMS@@UBEPBUQMetaObject@@XZ @ 249 NONAME ; struct QMetaObject const * QTMS::QTMSGlobalVolEffect::metaObject(void) const + ?staticMetaObject@QTMSGlobalRouting@QTMS@@2UQMetaObject@@B @ 250 NONAME ; struct QMetaObject const QTMS::QTMSGlobalRouting::staticMetaObject + ?qt_metacast@QTMSFactory@QTMS@@UAEPAXPBD@Z @ 251 NONAME ; void * QTMS::QTMSFactory::qt_metacast(char const *) + ?SetCNG@QTMSG711Format@QTMS@@QAEHH@Z @ 252 NONAME ; int QTMS::QTMSG711Format::SetCNG(int) + ?qt_metacall@QTMSG729Format@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 253 NONAME ; int QTMS::QTMSG729Format::qt_metacall(enum QMetaObject::Call, int, void * *) + ?tr@QTMSStream@QTMS@@SA?AVQString@@PBD0H@Z @ 254 NONAME ; class QString QTMS::QTMSStream::tr(char const *, char const *, int) + ?SetLevel@QTMSVolumeEffect@QTMS@@QAEHI@Z @ 255 NONAME ; int QTMS::QTMSVolumeEffect::SetLevel(unsigned int) + ?DeleteEffect@QTMSFactory@QTMS@@QAEHAAPAVQTMSEffect@2@@Z @ 256 NONAME ; int QTMS::QTMSFactory::DeleteEffect(class QTMS::QTMSEffect * &) + ?qt_metacast@QTMSCall@QTMS@@UAEPAXPBD@Z @ 257 NONAME ; void * QTMS::QTMSCall::qt_metacast(char const *) + ?SetFormat@QTMSStream@QTMS@@QAEHPAVQTMSFormat@2@@Z @ 258 NONAME ; int QTMS::QTMSStream::SetFormat(class QTMS::QTMSFormat *) + ?getStaticMetaObject@QTMSDTMF@QTMS@@SAABUQMetaObject@@XZ @ 259 NONAME ; struct QMetaObject const & QTMS::QTMSDTMF::getStaticMetaObject(void) + ?getStaticMetaObject@QTMSMicSource@QTMS@@SAABUQMetaObject@@XZ @ 260 NONAME ; struct QMetaObject const & QTMS::QTMSMicSource::getStaticMetaObject(void) + ?qt_metacall@QTMSRingTone@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 261 NONAME ; int QTMS::QTMSRingTone::qt_metacall(enum QMetaObject::Call, int, void * *) + ?trUtf8@QTMSClientSource@QTMS@@SA?AVQString@@PBD0H@Z @ 262 NONAME ; class QString QTMS::QTMSClientSource::trUtf8(char const *, char const *, int) + ?qt_metacall@QTMSGlobalGainEffect@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 263 NONAME ; int QTMS::QTMSGlobalGainEffect::qt_metacall(enum QMetaObject::Call, int, void * *) + ?CreateCall@QTMSFactory@QTMS@@QAEHHAAPAVQTMSCall@2@I@Z @ 264 NONAME ; int QTMS::QTMSFactory::CreateCall(int, class QTMS::QTMSCall * &, unsigned int) + ?SetVADMode@QTMSG729Format@QTMS@@QAEHH@Z @ 265 NONAME ; int QTMS::QTMSG729Format::SetVADMode(int) + ?DeleteBuffer@QTMSFactory@QTMS@@QAEHAAPAVQTMSBuffer@2@@Z @ 266 NONAME ; int QTMS::QTMSFactory::DeleteBuffer(class QTMS::QTMSBuffer * &) + ?trUtf8@QTMSG711Format@QTMS@@SA?AVQString@@PBD0@Z @ 267 NONAME ; class QString QTMS::QTMSG711Format::trUtf8(char const *, char const *) + ?qt_metacall@QTMSDTMF@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 268 NONAME ; int QTMS::QTMSDTMF::qt_metacall(enum QMetaObject::Call, int, void * *) + ?qt_metacall@QTMSModemSource@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 269 NONAME ; int QTMS::QTMSModemSource::qt_metacall(enum QMetaObject::Call, int, void * *) + ?CreateFactory@QTMSFactory@QTMS@@SAHAAPAV12@AAVQTMSVer@2@@Z @ 270 NONAME ; int QTMS::QTMSFactory::CreateFactory(class QTMS::QTMSFactory * &, class QTMS::QTMSVer &) + ?tr@QTMSClientSource@QTMS@@SA?AVQString@@PBD0H@Z @ 271 NONAME ; class QString QTMS::QTMSClientSource::tr(char const *, char const *, int) + ??1QTMSStream@QTMS@@UAE@XZ @ 272 NONAME ; QTMS::QTMSStream::~QTMSStream(void) + ?Init@QTMSRingTone@QTMS@@QAEHHPAU_GString@@0@Z @ 273 NONAME ; int QTMS::QTMSRingTone::Init(int, struct _GString *, struct _GString *) + ?qt_metacast@QTMSVolumeEffect@QTMS@@UAEPAXPBD@Z @ 274 NONAME ; void * QTMS::QTMSVolumeEffect::qt_metacast(char const *) + ??1QTMSRingTone@QTMS@@UAE@XZ @ 275 NONAME ; QTMS::QTMSRingTone::~QTMSRingTone(void) + ??_EQTMSStream@QTMS@@UAE@I@Z @ 276 NONAME ; QTMS::QTMSStream::~QTMSStream(unsigned int) + ?tr@QTMSSpeakerSink@QTMS@@SA?AVQString@@PBD0@Z @ 277 NONAME ; class QString QTMS::QTMSSpeakerSink::tr(char const *, char const *) + ?RemoveSink@QTMSStream@QTMS@@QAEHPAVQTMSSink@2@@Z @ 278 NONAME ; int QTMS::QTMSStream::RemoveSink(class QTMS::QTMSSink *) + ?trUtf8@QTMSModemSource@QTMS@@SA?AVQString@@PBD0H@Z @ 279 NONAME ; class QString QTMS::QTMSModemSource::trUtf8(char const *, char const *, int) + ?metaObject@QTMSILBCFormat@QTMS@@UBEPBUQMetaObject@@XZ @ 280 NONAME ; struct QMetaObject const * QTMS::QTMSILBCFormat::metaObject(void) const + ?staticMetaObject@QTMSPCMFormat@QTMS@@2UQMetaObject@@B @ 281 NONAME ; struct QMetaObject const QTMS::QTMSPCMFormat::staticMetaObject + ?getStaticMetaObject@QTMSClientSource@QTMS@@SAABUQMetaObject@@XZ @ 282 NONAME ; struct QMetaObject const & QTMS::QTMSClientSource::getStaticMetaObject(void) + ??1QTMSFactory@QTMS@@UAE@XZ @ 283 NONAME ; QTMS::QTMSFactory::~QTMSFactory(void) + ?DeleteSource@QTMSFactory@QTMS@@QAEHAAPAVQTMSSource@2@@Z @ 284 NONAME ; int QTMS::QTMSFactory::DeleteSource(class QTMS::QTMSSource * &) + ?qt_metacall@QTMSGlobalRouting@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 285 NONAME ; int QTMS::QTMSGlobalRouting::qt_metacall(enum QMetaObject::Call, int, void * *) + ??0QTMSGlobalGainEffect@QTMS@@IAE@XZ @ 286 NONAME ; QTMS::QTMSGlobalGainEffect::QTMSGlobalGainEffect(void) + ?trUtf8@QTMSPCMFormat@QTMS@@SA?AVQString@@PBD0@Z @ 287 NONAME ; class QString QTMS::QTMSPCMFormat::trUtf8(char const *, char const *) + ??0QTMSDTMF@QTMS@@IAE@XZ @ 288 NONAME ; QTMS::QTMSDTMF::QTMSDTMF(void) + ?GetLevel@QTMSGlobalVolEffect@QTMS@@QAEHAAI@Z @ 289 NONAME ; int QTMS::QTMSGlobalVolEffect::GetLevel(unsigned int &) + ?GetType@QTMSGlobalVolEffect@QTMS@@UAEHAAH@Z @ 290 NONAME ; int QTMS::QTMSGlobalVolEffect::GetType(int &) + ?getStaticMetaObject@QTMSILBCFormat@QTMS@@SAABUQMetaObject@@XZ @ 291 NONAME ; struct QMetaObject const & QTMS::QTMSILBCFormat::getStaticMetaObject(void) + ??_EQTMSGlobalGainEffect@QTMS@@UAE@I@Z @ 292 NONAME ; QTMS::QTMSGlobalGainEffect::~QTMSGlobalGainEffect(unsigned int) + ?trUtf8@QTMSGlobalVolEffect@QTMS@@SA?AVQString@@PBD0@Z @ 293 NONAME ; class QString QTMS::QTMSGlobalVolEffect::trUtf8(char const *, char const *) + ?qt_metacast@QTMSGlobalGainEffect@QTMS@@UAEPAXPBD@Z @ 294 NONAME ; void * QTMS::QTMSGlobalGainEffect::qt_metacast(char const *) + ??_EQTMSModemSink@QTMS@@UAE@I@Z @ 295 NONAME ; QTMS::QTMSModemSink::~QTMSModemSink(unsigned int) + ??0QTMSModemSink@QTMS@@IAE@XZ @ 296 NONAME ; QTMS::QTMSModemSink::QTMSModemSink(void) + ?tr@QTMSG711Format@QTMS@@SA?AVQString@@PBD0@Z @ 297 NONAME ; class QString QTMS::QTMSG711Format::tr(char const *, char const *) + ?GetState@QTMSStream@QTMS@@QAEHXZ @ 298 NONAME ; int QTMS::QTMSStream::GetState(void) + ?qt_metacall@QTMSG711Format@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 299 NONAME ; int QTMS::QTMSG711Format::qt_metacall(enum QMetaObject::Call, int, void * *) + ?getStaticMetaObject@QTMSClientSink@QTMS@@SAABUQMetaObject@@XZ @ 300 NONAME ; struct QMetaObject const & QTMS::QTMSClientSink::getStaticMetaObject(void) + ?qt_metacast@QTMSInbandTone@QTMS@@UAEPAXPBD@Z @ 301 NONAME ; void * QTMS::QTMSInbandTone::qt_metacast(char const *) + ?getStaticMetaObject@QTMSModemSource@QTMS@@SAABUQMetaObject@@XZ @ 302 NONAME ; struct QMetaObject const & QTMS::QTMSModemSource::getStaticMetaObject(void) + ?metaObject@QTMSGainEffect@QTMS@@UBEPBUQMetaObject@@XZ @ 303 NONAME ; struct QMetaObject const * QTMS::QTMSGainEffect::metaObject(void) const + ??0QTMSGlobalRouting@QTMS@@IAE@XZ @ 304 NONAME ; QTMS::QTMSGlobalRouting::QTMSGlobalRouting(void) + ?metaObject@QTMSClientSource@QTMS@@UBEPBUQMetaObject@@XZ @ 305 NONAME ; struct QMetaObject const * QTMS::QTMSClientSource::metaObject(void) const + ?qt_metacast@QTMSStream@QTMS@@UAEPAXPBD@Z @ 306 NONAME ; void * QTMS::QTMSStream::qt_metacast(char const *) + ?DeleteSink@QTMSFactory@QTMS@@QAEHAAPAVQTMSSink@2@@Z @ 307 NONAME ; int QTMS::QTMSFactory::DeleteSink(class QTMS::QTMSSink * &) + ?getStaticMetaObject@QTMSModemSink@QTMS@@SAABUQMetaObject@@XZ @ 308 NONAME ; struct QMetaObject const & QTMS::QTMSModemSink::getStaticMetaObject(void) + ?tr@QTMSClientSource@QTMS@@SA?AVQString@@PBD0@Z @ 309 NONAME ; class QString QTMS::QTMSClientSource::tr(char const *, char const *) + ?Mute@QTMSRingTone@QTMS@@QAEHXZ @ 310 NONAME ; int QTMS::QTMSRingTone::Mute(void) + ??_EQTMSDTMF@QTMS@@UAE@I@Z @ 311 NONAME ; QTMS::QTMSDTMF::~QTMSDTMF(unsigned int) + ?Start@QTMSStream@QTMS@@QAEHH@Z @ 312 NONAME ; int QTMS::QTMSStream::Start(int) + ?qt_metacall@QTMSStream@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 313 NONAME ; int QTMS::QTMSStream::qt_metacall(enum QMetaObject::Call, int, void * *) + ?tr@QTMSDTMF@QTMS@@SA?AVQString@@PBD0H@Z @ 314 NONAME ; class QString QTMS::QTMSDTMF::tr(char const *, char const *, int) + ?qt_metacast@QTMSGainEffect@QTMS@@UAEPAXPBD@Z @ 315 NONAME ; void * QTMS::QTMSGainEffect::qt_metacast(char const *) + ?GetCallContextId@QTMSCall@QTMS@@QAEHAAI@Z @ 316 NONAME ; int QTMS::QTMSCall::GetCallContextId(unsigned int &) + ?GetCallType@QTMSCall@QTMS@@QAEHXZ @ 317 NONAME ; int QTMS::QTMSCall::GetCallType(void) + ?Start@QTMSDTMF@QTMS@@QAEHXZ @ 318 NONAME ; int QTMS::QTMSDTMF::Start(void) + ?trUtf8@QTMSGlobalGainEffect@QTMS@@SA?AVQString@@PBD0@Z @ 319 NONAME ; class QString QTMS::QTMSGlobalGainEffect::trUtf8(char const *, char const *) + ?SetOutput@QTMSGlobalRouting@QTMS@@QAEHH@Z @ 320 NONAME ; int QTMS::QTMSGlobalRouting::SetOutput(int) + ??0QTMSClientSink@QTMS@@IAE@XZ @ 321 NONAME ; QTMS::QTMSClientSink::QTMSClientSink(void) + ?SetLevel@QTMSGlobalVolEffect@QTMS@@QAEHI@Z @ 322 NONAME ; int QTMS::QTMSGlobalVolEffect::SetLevel(unsigned int) + ?metaObject@QTMSRingTone@QTMS@@UBEPBUQMetaObject@@XZ @ 323 NONAME ; struct QMetaObject const * QTMS::QTMSRingTone::metaObject(void) const + ?ProcessBuffer@QTMSClientSink@QTMS@@IAEXPBVQTMSBuffer@2@@Z @ 324 NONAME ; void QTMS::QTMSClientSink::ProcessBuffer(class QTMS::QTMSBuffer const *) + ?IsCallTypeSupported@QTMSFactory@QTMS@@QAEHHAAH@Z @ 325 NONAME ; int QTMS::QTMSFactory::IsCallTypeSupported(int, int &) + ?qt_metacast@QTMSGlobalVolEffect@QTMS@@UAEPAXPBD@Z @ 326 NONAME ; void * QTMS::QTMSGlobalVolEffect::qt_metacast(char const *) + ?staticMetaObject@QTMSModemSource@QTMS@@2UQMetaObject@@B @ 327 NONAME ; struct QMetaObject const QTMS::QTMSModemSource::staticMetaObject + ?GetStreamId@QTMSStream@QTMS@@QAEHXZ @ 328 NONAME ; int QTMS::QTMSStream::GetStreamId(void) + ??0QTMSG729Format@QTMS@@IAE@XZ @ 329 NONAME ; QTMS::QTMSG729Format::QTMSG729Format(void) + ??_EQTMSGlobalVolEffect@QTMS@@UAE@I@Z @ 330 NONAME ; QTMS::QTMSGlobalVolEffect::~QTMSGlobalVolEffect(unsigned int) + ?getStaticMetaObject@QTMSAMRFormat@QTMS@@SAABUQMetaObject@@XZ @ 331 NONAME ; struct QMetaObject const & QTMS::QTMSAMRFormat::getStaticMetaObject(void) + ?staticMetaObject@QTMSVolumeEffect@QTMS@@2UQMetaObject@@B @ 332 NONAME ; struct QMetaObject const QTMS::QTMSVolumeEffect::staticMetaObject + ??_EQTMSRingTone@QTMS@@UAE@I@Z @ 333 NONAME ; QTMS::QTMSRingTone::~QTMSRingTone(unsigned int) + ??0QTMSFormat@QTMS@@IAE@XZ @ 334 NONAME ; QTMS::QTMSFormat::QTMSFormat(void) + ?GetSupportedFormats@QTMSFactory@QTMS@@QAEHHAAV?$vector@PAVQTMSFormat@QTMS@@V?$allocator@PAVQTMSFormat@QTMS@@@std@@@std@@@Z @ 335 NONAME ; int QTMS::QTMSFactory::GetSupportedFormats(int, class std::vector > &) + ?SetVADMode@QTMSG711Format@QTMS@@QAEHH@Z @ 336 NONAME ; int QTMS::QTMSG711Format::SetVADMode(int) + ?getStaticMetaObject@QTMSVolumeEffect@QTMS@@SAABUQMetaObject@@XZ @ 337 NONAME ; struct QMetaObject const & QTMS::QTMSVolumeEffect::getStaticMetaObject(void) + ?qt_metacall@QTMSModemSink@QTMS@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 338 NONAME ; int QTMS::QTMSModemSink::qt_metacall(enum QMetaObject::Call, int, void * *) + ?trUtf8@QTMSILBCFormat@QTMS@@SA?AVQString@@PBD0H@Z @ 339 NONAME ; class QString QTMS::QTMSILBCFormat::trUtf8(char const *, char const *, int) + ?trUtf8@QTMSDTMF@QTMS@@SA?AVQString@@PBD0@Z @ 340 NONAME ; class QString QTMS::QTMSDTMF::trUtf8(char const *, char const *) + ?tr@QTMSGlobalGainEffect@QTMS@@SA?AVQString@@PBD0@Z @ 341 NONAME ; class QString QTMS::QTMSGlobalGainEffect::tr(char const *, char const *) + ?AddEffect@QTMSStream@QTMS@@QAEHPAVQTMSEffect@2@@Z @ 342 NONAME ; int QTMS::QTMSStream::AddEffect(class QTMS::QTMSEffect *) + ?ResetFormat@QTMSStream@QTMS@@QAEHPAVQTMSFormat@2@@Z @ 343 NONAME ; int QTMS::QTMSStream::ResetFormat(class QTMS::QTMSFormat *) + ?metaObject@QTMSG711Format@QTMS@@UBEPBUQMetaObject@@XZ @ 344 NONAME ; struct QMetaObject const * QTMS::QTMSG711Format::metaObject(void) const + ??1QTMSVolumeEffect@QTMS@@UAE@XZ @ 345 NONAME ; QTMS::QTMSVolumeEffect::~QTMSVolumeEffect(void) + ?EffectsEvent@QTMSGlobalGainEffect@QTMS@@IAEXABVQTMSEffect@2@UQTMSSignalEvent@2@@Z @ 346 NONAME ; void QTMS::QTMSGlobalGainEffect::EffectsEvent(class QTMS::QTMSEffect const &, struct QTMS::QTMSSignalEvent) + ?GetSupportedBitRates@QTMSFormat@QTMS@@QAEHAAV?$vector@IV?$allocator@I@std@@@std@@@Z @ 347 NONAME ; int QTMS::QTMSFormat::GetSupportedBitRates(class std::vector > &) + ?staticMetaObject@QTMSCall@QTMS@@2UQMetaObject@@B @ 348 NONAME ; struct QMetaObject const QTMS::QTMSCall::staticMetaObject + ??1QTMSModemSource@QTMS@@UAE@XZ @ 349 NONAME ; QTMS::QTMSModemSource::~QTMSModemSource(void) + ??1QTMSClientSink@QTMS@@UAE@XZ @ 350 NONAME ; QTMS::QTMSClientSink::~QTMSClientSink(void) + ?metaObject@QTMSFactory@QTMS@@UBEPBUQMetaObject@@XZ @ 351 NONAME ; struct QMetaObject const * QTMS::QTMSFactory::metaObject(void) const + ?metaObject@QTMSInbandTone@QTMS@@UBEPBUQMetaObject@@XZ @ 352 NONAME ; struct QMetaObject const * QTMS::QTMSInbandTone::metaObject(void) const + ?trUtf8@QTMSGainEffect@QTMS@@SA?AVQString@@PBD0H@Z @ 353 NONAME ; class QString QTMS::QTMSGainEffect::trUtf8(char const *, char const *, int) + ?trUtf8@QTMSMicSource@QTMS@@SA?AVQString@@PBD0H@Z @ 354 NONAME ; class QString QTMS::QTMSMicSource::trUtf8(char const *, char const *, int) + ?GetMaxLevel@QTMSGlobalVolEffect@QTMS@@QAEHAAI@Z @ 355 NONAME ; int QTMS::QTMSGlobalVolEffect::GetMaxLevel(unsigned int &) + ??_EQTMSVolumeEffect@QTMS@@UAE@I@Z @ 356 NONAME ; QTMS::QTMSVolumeEffect::~QTMSVolumeEffect(unsigned int) + ??1QTMSG729Format@QTMS@@UAE@XZ @ 357 NONAME ; QTMS::QTMSG729Format::~QTMSG729Format(void) + ?tr@QTMSVolumeEffect@QTMS@@SA?AVQString@@PBD0@Z @ 358 NONAME ; class QString QTMS::QTMSVolumeEffect::tr(char const *, char const *) + ?GetType@QTMSMicSource@QTMS@@UAEHAAH@Z @ 359 NONAME ; int QTMS::QTMSMicSource::GetType(int &) + ?CreateEffect@QTMSFactory@QTMS@@QAEHHAAPAVQTMSEffect@2@@Z @ 360 NONAME ; int QTMS::QTMSFactory::CreateEffect(int, class QTMS::QTMSEffect * &) + ?getStaticMetaObject@QTMSCall@QTMS@@SAABUQMetaObject@@XZ @ 361 NONAME ; struct QMetaObject const & QTMS::QTMSCall::getStaticMetaObject(void) + ?metaObject@QTMSGlobalGainEffect@QTMS@@UBEPBUQMetaObject@@XZ @ 362 NONAME ; struct QMetaObject const * QTMS::QTMSGlobalGainEffect::metaObject(void) const ?GetOutput@QTMSGlobalRouting@QTMS@@QAEHAAH@Z @ 363 NONAME ; int QTMS::QTMSGlobalRouting::GetOutput(int &) ?tr@QTMSPCMFormat@QTMS@@SA?AVQString@@PBD0@Z @ 364 NONAME ; class QString QTMS::QTMSPCMFormat::tr(char const *, char const *) ?CreateBuffer@QTMSFactory@QTMS@@QAEHHIAAPAVQTMSBuffer@2@@Z @ 365 NONAME ; int QTMS::QTMSFactory::CreateBuffer(int, unsigned int, class QTMS::QTMSBuffer * &) diff -r 3b098142db83 -r 92dbd2a406d9 qtms/eabi/qtmsu.def --- a/qtms/eabi/qtmsu.def Fri Sep 17 08:33:08 2010 +0300 +++ b/qtms/eabi/qtmsu.def Mon Oct 04 00:50:27 2010 +0300 @@ -61,8 +61,8 @@ _ZN4QTMS11QTMSFactory20DeleteRingTonePlayerERPNS_12QTMSRingToneE @ 60 NONAME _ZN4QTMS11QTMSFactory22CreateInbandTonePlayerERPNS_14QTMSInbandToneE @ 61 NONAME _ZN4QTMS11QTMSFactory22DeleteInbandTonePlayerERPNS_14QTMSInbandToneE @ 62 NONAME - _ZN4QTMS11QTMSFactoryC1Ev @ 63 NONAME - _ZN4QTMS11QTMSFactoryC2Ev @ 64 NONAME + _ZN4QTMS11QTMSFactoryC1ERNS_7QTMSVerE @ 63 NONAME + _ZN4QTMS11QTMSFactoryC2ERNS_7QTMSVerE @ 64 NONAME _ZN4QTMS11QTMSFactoryD0Ev @ 65 NONAME _ZN4QTMS11QTMSFactoryD1Ev @ 66 NONAME _ZN4QTMS11QTMSFactoryD2Ev @ 67 NONAME diff -r 3b098142db83 -r 92dbd2a406d9 qtms/inc/qtmsfactoryimpl.h --- a/qtms/inc/qtmsfactoryimpl.h Fri Sep 17 08:33:08 2010 +0300 +++ b/qtms/inc/qtmsfactoryimpl.h Mon Oct 04 00:50:27 2010 +0300 @@ -20,6 +20,7 @@ #include #include +#include // FORWARD DECLARATIONS namespace TMS @@ -47,7 +48,7 @@ class QTMSFactoryImpl { public: - QTMSFactoryImpl(); + QTMSFactoryImpl(QTMSVer& ver); virtual ~QTMSFactoryImpl(); gint CreateCall(QTMSCallType ctype, QTMSCall*& QTMScall, guint ctxid); diff -r 3b098142db83 -r 92dbd2a406d9 qtms/src/qtmsfactory.cpp --- a/qtms/src/qtmsfactory.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/qtms/src/qtmsfactory.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -23,9 +23,9 @@ using namespace QTMS; -QTMSFactory::QTMSFactory() +QTMSFactory::QTMSFactory(QTMSVer& ver) { - impl = new QTMSFactoryImpl(); + impl = new QTMSFactoryImpl(ver); } QTMSFactory::~QTMSFactory() @@ -33,9 +33,9 @@ delete impl; } -gint QTMSFactory::CreateFactory(QTMSFactory*& tmsfactory, QTMSVer& /*ver*/) +gint QTMSFactory::CreateFactory(QTMSFactory*& tmsfactory, QTMSVer& ver) { - QTMSFactory* self = new QTMSFactory(); + QTMSFactory* self = new QTMSFactory(ver); tmsfactory = self; return QTMS_RESULT_SUCCESS; } diff -r 3b098142db83 -r 92dbd2a406d9 qtms/src/qtmsfactoryimpl.cpp --- a/qtms/src/qtmsfactoryimpl.cpp Fri Sep 17 08:33:08 2010 +0300 +++ b/qtms/src/qtmsfactoryimpl.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -55,11 +55,11 @@ using namespace QTMS; using namespace TMS; -QTMSFactoryImpl::QTMSFactoryImpl() +QTMSFactoryImpl::QTMSFactoryImpl(QTMSVer& /*ver*/) { TRACE_PRN_FN_ENT; - TMSVer* ver = NULL; - TMSFactory::CreateFactory(iFactory, *ver); + TMSVer* v = NULL; + TMSFactory::CreateFactory(iFactory, *v); TRACE_PRN_FN_EXT; } diff -r 3b098142db83 -r 92dbd2a406d9 qtms/tsrc/qttmstestapp/buildflags.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtms/tsrc/qttmstestapp/buildflags.pri Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,14 @@ +!symbian: error(Only include this file for Symbian platforms) + +CONFIG += debug_and_release build_all + +# On win32 and mac, debug and release libraries are named differently. +# We must follow the debug and release settings Qt was compiled with: +# build debug iff Qt built debug, build release iff Qt built release. +win32|mac { + !contains(QT_CONFIG,debug)|!contains(QT_CONFIG,release) { + CONFIG -= debug_and_release debug release + contains(QT_CONFIG,debug): CONFIG+=debug + contains(QT_CONFIG,release):CONFIG+=release + } +} diff -r 3b098142db83 -r 92dbd2a406d9 qtms/tsrc/qttmstestapp/inc/ctmstestengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtms/tsrc/qttmstestapp/inc/ctmstestengine.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,1 @@ +/* * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. * * Contributors: * * Description: Telephony Multimedia Service - TestApp * */#ifndef CTMSTESTENGINE_H#define CTMSTESTENGINE_H//#define __PLAY_WAV_FROM_FILE__//#define __RECORD_WAV_TO_FILE__// INCLUDES#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "mtmstestengine.h"using namespace TMS;// CLASS DECLARATION/** * CTmsTestEngine application engine class. */class CTmsTestEngine : public CBase, public TMSStreamObserver, public TMSClientSourceObserver, public TMSClientSinkObserver, public TMSEffectObserver, public TMSGlobalRoutingObserver, public TMSRingToneObserver, public TMSDTMFObserver, public TMSInbandToneObserver, public MTmsTestEngine {public: enum TAppState { ENotReady = 0, EReady, EStreaming }; /** * NewL() * * Create new CTmsTestEngine object * return a pointer to the created instance of CTmsTestEngine * @param aView a Pointer to CTmsTestView. */ static CTmsTestEngine* NewL(QTextEdit* statusDisplay); /** * NewLC() * */ static CTmsTestEngine* NewLC(QTextEdit* statusDisplay); /** * Destructor * */ ~CTmsTestEngine(); void GetSupportedDownlinkFormats(TBool aDisplayCodecs = EFalse); void GetSupportedUplinkFormats(TBool aDisplayCodecs = EFalse); void SetDownlinkFormat(TMSFormatType aCodecFormat); void OpenDownlink(); void StartDownlink(); void StopDownlink(); void CloseDownlink(); void GetMaxVolume(); void GetVolume(); void SetVolume(guint aVolume); void MuteSpeaker(); void SetMaxVolume(); void VolumeUp(); void VolumeDn(); void SetUplinkFormat(TMSFormatType aCodecFormat); void OpenUplink(); void StartUplink(); void StopUplink(); void CloseUplink(); void GetMaxGain(); void GetGain(); void SetMaxGain(); void MuteMic(); void GetSupportedBitrates(); gint GetSupportedBitrates(BitRateVector& aBrArr); void SelectMinBitrate(); void SelectMaxBitrate(); void SetBitrate(TUint aBitrate); void GetBitrate(); void GetBitrate(TUint& aBitrate); void ToggleVad(); void GetVad(); void ToggleCng(); void GetCng(); void TogglePlc(); void GetPlc(); void SetDnLinkG711ALAW(); void SetDnLinkG711uLAW(); void SetDnLinkILBC20MS(); void SetDnLinkILBC30MS(); void SetUpLinkG711ALAW(); void SetUpLinkG711uLAW(); void SetUpLinkILBC20MS(); void SetUpLinkILBC30MS(); void GetDnLinkG711Mode(); void GetDnLinkILBCMode(); void GetUpLinkG711Mode(); void GetUpLinkILBCMode(); void SetOutputDevice(TMSAudioOutput device); void SetHandset(); void SetLoudSpeaker(); void GetAudioDevice(); void GetAvailableOutput(); void DoLoopback(); void OneTouchLoopback(); void EndCall(); void InitDTMFTonePlayerDnlink(); void InitDTMFTonePlayerUplink(); void DTMFTonePlayDnlink(); void DTMFTonePlayUplink(); void CloseDTMFPlayerDnlink(); void CloseDTMFPlayerUplink(); gint CreateRingTonePlayer(); void InitRingTonePlayerFromProfiles(); void InitRingTonePlayerFromFile(); void InitRingToneVideoPlayer(); void InitRingToneSequencePlayer(); void InitRingToneWithTTS(); void InitRingToneBeepOnce(); void InitRingToneSilent(); void InitRingToneUnsecureVoIP(); void PlayRingTone(); void StopRingTone(); void MuteRingTone(); void PauseVideoRingTone(); void CloseRingTonePlayer(); void DeinitRingTonePlayer(); void SetCallType(TMSCallType calltype); void CreateInbandTonePlayer(); void StartInbandTone(TMSInbandToneType inbandtonetype); void StopInbandTone(); gint CreateFactory(); gint CreateCall(TMSCallType calltype); gint CreateUplink(); gint CreateDownlink(); gint CreateClientSource(); gint CreateModemSource(); gint AddClientSourceToStream(); gint AddModemSourceToStream(); gint CreateClientSink(); gint CreateModemSink(); gint AddClientSinkToStream(); gint AddModemSinkToStream(); gint CreateMicSource(); gint AddMicSourceToStream(); gint CreateSpeakerSink(); gint AddSpeakerSinkToStream(); gint CreateVolumeEffect(); gint AddVolumeEffectToStream(); gint CreateGainEffect(); gint CreateGlobalRouting(); gint AddGainEffectToStream(); void CreateGlobalVol(); void CreateGlobalGain(); void GetGlobalVol(); void GetGlobalMaxVol(); void SetGlobalVol(); void GetGlobalGain(); void GetGlobalMaxGain(); void SetGlobalGain(); //From TMSClientSourceObserver void FillBuffer(TMSBuffer& buffer); void BufferProcessed(const TMSBuffer* buffer, gint reason); //From TMSClientSinkObserver void ProcessBuffer(const TMSBuffer* buffer); //From TMSStreamObserver void TMSStreamEvent(const TMSStream& stream, TMSSignalEvent event); //From TMSClientSinkObserver void EffectsEvent(const TMSEffect& tmseffect, TMSSignalEvent event); //From TMSGlobalRoutingObserver void GlobalRoutingEvent(const TMSGlobalRouting& routing, TMSSignalEvent event, TMSAudioOutput output); //From TMSRingToneObserver void RingtoneEvent(const TMSRingTone& rt, TMSSignalEvent event); //From TMSDTMFObserver void DTMFEvent(const TMSDTMF& dtmf, TMSSignalEvent event); //From TMSInbandToneObserver void InbandToneEvent(const TMSInbandTone& inbandtone, TMSSignalEvent event);private: void ConstructL(QTextEdit* statusDisplay); CTmsTestEngine(); void ConfigureDecoder(); void ConfigureEncoder(); void DisplayFormat(TMSFormatType aFormat); void DisplayDevice(TMSAudioOutput device); void DisplayText(const QString& str, const gint num = 0);#ifdef __RECORD_WAV_TO_FILE__ void WriteToFile(const guint8* str, const guint len);#endif //__RECORD_WAV_TO_FILE__private: // For text printing to the display QTextEdit* iStatusDisplay; // Dn/Uplink, DTMF, Ring tone APIs TMSFactory* iFactory; TMSCall* iTmsCall; TMSCallType iCallType; TMSStream* iTmsDnlink; TMSStream* iTmsUplink; TMSSource* iTmsClientSource; TMSSource* iTmsMicSource; TMSSource* iTmsModemSource; TMSSink* iTmsClientSink; TMSSink* iTmsSpeakerSink; TMSSink* iTmsModemSink; TMSDTMF* iDTMFTonePlayerDn; TMSDTMF* iDTMFTonePlayerUp; TMSEffect* iTmsUplinkEffect; TMSEffect* iTmsDnlinkEffect; TMSEffect* iGlobalVol; TMSEffect* iGlobalGain; TMSGlobalRouting* iTmsGlobalRouting; TMSRingTone* iTmsRingTonePlayer; TMSInbandTone* iInbandTonePlayer; // Codec format APIs TMSFormat* iDecFormatIntfc; TMSFormat* iEncFormatIntfc; // For internal app state control TAppState iDnLinkStatus; TAppState iUpLinkStatus; TMSFormatType iDnLinkCodec; TMSFormatType iUpLinkCodec; TBool iOneTouchLoopback; TInt iHasDTMFObserver; // For storing codec configuration locally TBool iPlc; TBool iCng; TBool iVad; TBool iSpkr; guint iMaxGain; guint iMaxVolume; guint iVolume; TUint iBitrate; BitRateVector iBitratesVector; OutputVector iAvailableoutputs; // For streaming buffer control TBool iPlayBufReady; TBool iRecBufReady; TInt iPlayBufMaxLen; TMSBuffer* iPlayBuf; TMSBuffer* iRecBuf; TUint iSeqNum; TUint iSeqNumIncrement; gint iSizeCopy; guint8* iDesCopy; TMS::FormatVector iUplCodecs; TMS::FormatVector iDnlCodecs; GString* iRTStr; GString* iTTSStr;#ifdef __WINSCW__ TInt iBufIndex;#endif //__WINSCW__#ifdef __PLAY_WAV_FROM_FILE__ RFile iFile; TInt iFileLen; TInt iReadSize; TInt iReadPos; TBool iEOF; RFs iFs; HBufC8* iBuf;#endif#ifdef __RECORD_WAV_TO_FILE__ RFile iFile; TInt iWriteLen; TInt iReadPos; RFs iFs; HBufC8* iWriteBuf;#endif //__RECORD_WAV_TO_FILE__ };#endif //CTMSTESTENGINE_H// End of file diff -r 3b098142db83 -r 92dbd2a406d9 qtms/tsrc/qttmstestapp/inc/mtmstestengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtms/tsrc/qttmstestapp/inc/mtmstestengine.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service - TestApp + * + */ + +#ifndef MTMSTESTENGINE_H +#define MTMSTESTENGINE_H + +// INCLUDES +#include +#include +#include +#include + +// CLASS DECLARATION +/** + * CTmsTestEngine application engine class. + */ +class MTmsTestEngine + { +public: + virtual ~MTmsTestEngine() {} + + virtual void GetSupportedDownlinkFormats(TBool aDisplayCodecs = EFalse) =0; + virtual void GetSupportedUplinkFormats(TBool aDisplayCodecs = EFalse)=0; + virtual void SetDownlinkFormat(gint aCodecFormat)=0; + virtual void OpenDownlink()=0; + virtual void StartDownlink()=0; + virtual void StopDownlink()=0; + virtual void CloseDownlink()=0; + virtual void GetMaxVolume()=0; + virtual void GetVolume()=0; + virtual void SetVolume(guint aVolume)=0; + virtual void MuteSpeaker()=0; + virtual void SetMaxVolume()=0; + virtual void VolumeUp()=0; + virtual void VolumeDn()=0; + + virtual void SetUplinkFormat(gint aCodecFormat)=0; + virtual void OpenUplink()=0; + virtual void StartUplink()=0; + virtual void StopUplink()=0; + virtual void CloseUplink()=0; + virtual void GetMaxGain()=0; + virtual void GetGain()=0; + virtual void SetMaxGain()=0; + virtual void MuteMic()=0; + + virtual void GetSupportedBitrates()=0; + virtual TInt GetSupportedBitrates(std::vector& aBrArr)=0; + virtual void SelectMinBitrate()=0; + virtual void SelectMaxBitrate()=0; + virtual void SetBitrate(TUint aBitrate)=0; + virtual void GetBitrate()=0; + virtual void GetBitrate(TUint& aBitrate)=0; + virtual void ToggleVad()=0; + virtual void GetVad()=0; + virtual void ToggleCng()=0; + virtual void GetCng()=0; + virtual void TogglePlc()=0; + virtual void GetPlc()=0; + virtual void SetDnLinkG711ALAW()=0; + virtual void SetDnLinkG711uLAW()=0; + virtual void SetDnLinkILBC20MS()=0; + virtual void SetDnLinkILBC30MS()=0; + virtual void SetUpLinkG711ALAW()=0; + virtual void SetUpLinkG711uLAW()=0; + virtual void SetUpLinkILBC20MS()=0; + virtual void SetUpLinkILBC30MS()=0; + virtual void GetDnLinkG711Mode()=0; + virtual void GetDnLinkILBCMode()=0; + virtual void GetUpLinkG711Mode()=0; + virtual void GetUpLinkILBCMode()=0; + + virtual void SetOutputDevice(gint device)=0; + virtual void SetHandset()=0; + virtual void SetLoudSpeaker()=0; + virtual void GetAudioDevice()=0; + virtual void GetAvailableOutput()=0; + virtual void DoLoopback()=0; + virtual void OneTouchLoopback()=0; + + virtual void InitDTMFTonePlayerDnlink()=0; + virtual void InitDTMFTonePlayerUplink()=0; + virtual void DTMFTonePlayDnlink()=0; + virtual void DTMFTonePlayUplink()=0; + virtual void CloseDTMFPlayerDnlink()=0; + virtual void CloseDTMFPlayerUplink()=0; + + virtual gint CreateRingTonePlayer()=0; + virtual void InitRingTonePlayerFromFile()=0; + virtual void InitRingTonePlayerFromProfiles()=0; + virtual void InitRingToneWithTTS()=0; + virtual void InitRingToneSequencePlayer()=0; + virtual void InitRingToneBeepOnce()=0; + virtual void InitRingToneSilent()=0; + virtual void PlayRingTone()=0; + virtual void PauseVideoRingTone()=0; + virtual void StopRingTone()=0; + virtual void MuteRingTone()=0; + virtual void DeinitRingTonePlayer()=0; + virtual void CloseRingTonePlayer()=0; + + virtual void SetCallType(gint calltype)=0; + + virtual void CreateInbandTonePlayer()=0; + virtual void StartInbandTone(gint inbandtonetype)=0; + virtual void StopInbandTone()=0; + + virtual gint CreateFactory()=0; + virtual gint CreateCall(gint calltype)=0; + virtual gint CreateUplink()=0; + virtual gint CreateDownlink()=0; + virtual gint CreateClientSource()=0; + virtual gint CreateModemSource()=0; + virtual gint AddClientSourceToStream()=0; + virtual gint AddModemSourceToStream()=0; + virtual gint CreateClientSink()=0; + virtual gint CreateModemSink()=0; + virtual gint AddClientSinkToStream()=0; + virtual gint AddModemSinkToStream()=0; + virtual gint CreateMicSource()=0; + virtual gint AddMicSourceToStream()=0; + virtual gint CreateSpeakerSink()=0; + virtual gint AddSpeakerSinkToStream()=0; + + virtual gint CreateVolumeEffect()=0; + virtual gint AddVolumeEffectToStream()=0; + virtual gint CreateGainEffect()=0; + virtual gint CreateGlobalRouting()=0; + virtual gint AddGainEffectToStream()=0; + + virtual void CreateGlobalVol()=0; + virtual void CreateGlobalGain()=0; + virtual void GetGlobalVol()=0; + virtual void GetGlobalMaxVol()=0; + virtual void SetGlobalVol()=0; + virtual void GetGlobalGain()=0; + virtual void GetGlobalMaxGain()=0; + virtual void SetGlobalGain()=0; + }; + +#endif // MTMSTESTENGINE_H + +// End of file diff -r 3b098142db83 -r 92dbd2a406d9 qtms/tsrc/qttmstestapp/inc/qtmstestengine.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtms/tsrc/qttmstestapp/inc/qtmstestengine.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,335 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service - TestApp + * + */ + +#ifndef QTMSTESTENGINE_H +#define QTMSTESTENGINE_H + +//#define __PLAY_WAV_FROM_FILE__ + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "mtmstestengine.h" + +using namespace QTMS; + +// CLASS DECLARATION +/** + * CTmsTestEngine application engine class. + */ +class QTmsTestEngine : public QObject, + public CBase, + public MTmsTestEngine + { + Q_OBJECT +public: + enum TAppState + { + ENotReady = 0, + EReady, + EStreaming + }; + + /** + * NewL() + * + * Create new CTmsTestEngine object + * return a pointer to the created instance of CTmsTestEngine + * @param aView a Pointer to CTmsTestView. + */ + static QTmsTestEngine* NewL(QTextEdit* statusDisplay); + + /** + * NewLC() + * + */ + static QTmsTestEngine* NewLC(QTextEdit* statusDisplay); + + /** + * Destructor + * + */ + ~QTmsTestEngine(); + + void GetSupportedDownlinkFormats(TBool aDisplayCodecs = EFalse); + void GetSupportedUplinkFormats(TBool aDisplayCodecs = EFalse); + void SetDownlinkFormat(QTMSFormatType aCodecFormat); + void OpenDownlink(); + void StartDownlink(); + void StopDownlink(); + void CloseDownlink(); + void GetMaxVolume(); + void GetVolume(); + void SetVolume(guint aVolume); + void MuteSpeaker(); + void SetMaxVolume(); + void VolumeUp(); + void VolumeDn(); + + void SetUplinkFormat(QTMSFormatType aCodecFormat); + void OpenUplink(); + void StartUplink(); + void StopUplink(); + void CloseUplink(); + void GetMaxGain(); + void GetGain(); + void SetMaxGain(); + void MuteMic(); + + void GetSupportedBitrates(); + gint GetSupportedBitrates(BitRateVector& aBrArr); + void SelectMinBitrate(); + void SelectMaxBitrate(); + void SetBitrate(TUint aBitrate); + void GetBitrate(); + void GetBitrate(TUint& aBitrate); + void ToggleVad(); + void GetVad(); + void ToggleCng(); + void GetCng(); + void TogglePlc(); + void GetPlc(); + void SetDnLinkG711ALAW(); + void SetDnLinkG711uLAW(); + void SetDnLinkILBC20MS(); + void SetDnLinkILBC30MS(); + void SetUpLinkG711ALAW(); + void SetUpLinkG711uLAW(); + void SetUpLinkILBC20MS(); + void SetUpLinkILBC30MS(); + void GetDnLinkG711Mode(); + void GetDnLinkILBCMode(); + void GetUpLinkG711Mode(); + void GetUpLinkILBCMode(); + + void SetOutputDevice(QTMSAudioOutput device); + void SetHandset(); + void SetLoudSpeaker(); + void GetAudioDevice(); + void GetAvailableOutput(); + void DoLoopback(); + void OneTouchLoopback(); + void EndCall(); + + void InitDTMFTonePlayerDnlink(); + void InitDTMFTonePlayerUplink(); + void DTMFTonePlayDnlink(); + void DTMFTonePlayUplink(); + void CloseDTMFPlayerDnlink(); + void CloseDTMFPlayerUplink(); + + gint CreateRingTonePlayer(); + void InitRingTonePlayerFromProfiles(); + void InitRingTonePlayerFromFile(); + void InitRingToneVideoPlayer(); + void InitRingToneSequencePlayer(); + void InitRingToneWithTTS(); + void InitRingToneBeepOnce(); + void InitRingToneSilent(); + void InitRingToneUnsecureVoIP(); + void PlayRingTone(); + void StopRingTone(); + void MuteRingTone(); + void PauseVideoRingTone(); + void CloseRingTonePlayer(); + void DeinitRingTonePlayer(); + + void SetCallType(QTMSCallType calltype); + + void CreateInbandTonePlayer(); + void StartInbandTone(QTMSInbandToneType inbandtonetype); + void StopInbandTone(); + + gint CreateFactory(); + gint CreateCall(QTMSCallType calltype); + gint CreateUplink(); + gint CreateDownlink(); + gint CreateClientSource(); + gint CreateModemSource(); + gint AddClientSourceToStream(); + gint AddModemSourceToStream(); + gint CreateClientSink(); + gint CreateModemSink(); + gint AddClientSinkToStream(); + gint AddModemSinkToStream(); + gint CreateMicSource(); + gint AddMicSourceToStream(); + gint CreateSpeakerSink(); + gint AddSpeakerSinkToStream(); + + gint CreateVolumeEffect(); + gint AddVolumeEffectToStream(); + gint CreateGainEffect(); + gint CreateGlobalRouting(); + gint AddGainEffectToStream(); + + void CreateGlobalVol(); + void CreateGlobalGain(); + void GetGlobalVol(); + void GetGlobalMaxVol(); + void SetGlobalVol(); + void GetGlobalGain(); + void GetGlobalMaxGain(); + void SetGlobalGain(); + +public slots: + + //Signal from QTMSClientSource + void FillBuffer(QTMSBuffer& buffer); + + void BufferProcessed(const QTMSBuffer* buffer, gint reason); + + //Signal from QTMSClientSink + void ProcessBuffer(const QTMSBuffer* buffer); + + //Signal from QTMSStream + void TMSStreamEvent(const QTMSStream& stream, QTMSSignalEvent event); + + //Signal from QTMSEffect + void EffectsEvent(const QTMSEffect& tmseffect, QTMSSignalEvent event); + + //Signal from QTMSGlobalRouting + void GlobalRoutingEvent(const QTMSGlobalRouting& routing, + QTMSSignalEvent event, QTMSAudioOutput output); + + //Signal from QTMSRingTone + void RingtoneEvent(const QTMSRingTone& rt, QTMSSignalEvent event); + + //Signal from QTMSDTMF + void DTMFEvent(const QTMSDTMF& dtmf, QTMSSignalEvent event); + + //Signal from QTMSInbandTone + void InbandToneEvent(const QTMSInbandTone& inbandtone, + QTMSSignalEvent event); + +private: + + void ConstructL(QTextEdit* statusDisplay); + QTmsTestEngine(); + + void ConfigureDecoder(); + void ConfigureEncoder(); + + void DisplayFormat(QTMSFormatType aFormat); + void DisplayDevice(QTMSAudioOutput device); + void DisplayText(const QString& str, const gint num = 0); + +#ifdef __RECORD_WAV_TO_FILE__ + void WriteToFile(const guint8* str, const guint len); +#endif //__RECORD_WAV_TO_FILE__ + +private: + + // For text printing to the display + QTextEdit* iStatusDisplay; + + // Dn/Uplink, DTMF, Ring tone APIs + QTMSFactory* iFactory; + QTMSCall* iTmsCall; + QTMSCallType iCallType; + QTMSStream* iTmsDnlink; + QTMSStream* iTmsUplink; + QTMSSource* iTmsClientSource; + QTMSSource* iTmsMicSource; + QTMSSource* iTmsModemSource; + QTMSSink* iTmsClientSink; + QTMSSink* iTmsSpeakerSink; + QTMSSink* iTmsModemSink; + QTMSDTMF* iDTMFTonePlayerDn; + QTMSDTMF* iDTMFTonePlayerUp; + QTMSEffect* iTmsUplinkEffect; + QTMSEffect* iTmsDnlinkEffect; + QTMSEffect* iGlobalVol; + QTMSEffect* iGlobalGain; + QTMSGlobalRouting* iTmsGlobalRouting; + QTMSRingTone* iTmsRingTonePlayer; + QTMSInbandTone* iInbandTonePlayer; + + // Codec format APIs + QTMSFormat* iDecFormatIntfc; + QTMSFormat* iEncFormatIntfc; + + // For internal app state control + TAppState iDnLinkStatus; + TAppState iUpLinkStatus; + QTMSFormatType iDnLinkCodec; + QTMSFormatType iUpLinkCodec; + TBool iOneTouchLoopback; + + // For storing codec configuration locally + TBool iPlc; + TBool iCng; + TBool iVad; + TBool iSpkr; + guint iMaxGain; + guint iMaxVolume; + guint iVolume; + TUint iBitrate; + BitRateVector iBitratesVector; + OutputVector iAvailableoutputs; + + // For streaming buffer control + TBool iPlayBufReady; + TBool iRecBufReady; + TInt iPlayBufMaxLen; + QTMSBuffer* iPlayBuf; + QTMSBuffer* iRecBuf; + TUint iSeqNum; + TUint iSeqNumIncrement; + gint iSizeCopy; + guint8* iDesCopy; + + QTMS::FormatVector iUplCodecs; + QTMS::FormatVector iDnlCodecs; + GString* iRTStr; + GString* iTTSStr; + +#ifdef __WINSCW__ + TInt iBufIndex; +#endif //__WINSCW__ + +#ifdef __PLAY_WAV_FROM_FILE__ + RFile iFile; + TInt iFileLen; + TInt iReadSize; + TInt iReadPos; + TBool iEOF; + RFs iFs; + HBufC8* iBuf; +#endif + +#ifdef __RECORD_WAV_TO_FILE__ + RFile iFile; + TInt iWriteLen; + TInt iReadPos; + RFs iFs; + HBufC8* iWriteBuf; +#endif //__RECORD_WAV_TO_FILE__ + }; + +#endif //QTMSTESTENGINE_H + +// End of file diff -r 3b098142db83 -r 92dbd2a406d9 qtms/tsrc/qttmstestapp/inc/qttmstestapp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtms/tsrc/qttmstestapp/inc/qttmstestapp.h Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,293 @@ +/* + * 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: Telephony Multimedia Service - TestApp + * + */ + +#ifndef QTTMSTESTAPP_H +#define QTTMSTESTAPP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include "mtmstestengine.h" + +// Forward declaration +class MTmsTestEngine; +// +// Class declaration +// +class TmsTestApp : public QMainWindow + { + Q_OBJECT +public: + TmsTestApp(QWidget *parent = 0); + + ~TmsTestApp(); + +protected: + +private slots: + + void qtmsengineslot(); + void tmsengineslot(); + + void cscallslot(); + void ipcallslot(); + + void strmdnstartslot(); + void strmdnstopslot(); + void strmdncloseslot(); + void strmupstartslot(); + void strmupstopslot(); + void strmupcloseslot(); + + + void globalvolslot(); + void globalmaxvolslot(); + void globalsetvolslot(); + + void globalgainslot(); + void globalmaxgainslot(); + void globalsetgainslot(); + + void stmgainslot(); + void stmmaxgainslot(); + void stmsetgainslot(); + void stmmutegainslot(); + + void stmvolslot(); + void stmmaxvolslot(); + void stmsetvolslot(); + void stmmutevolslot(); + + void handsetslot(); + void loudspkrslot(); + void wiredslot(); + void btslot(); + void ttyslot(); + void currentoutputslot(); + void availoutputslot(); + + void dtmfdninitslot(); + void dtmfdnplayslot(); + void dtmfdnstopslot(); + void dtmfupinitslot(); + void dtmfupplayslot(); + void dtmfupstopslot(); + + void inbandbusyslot(); + void inbandpathnotavilslot(); + void inbandcongestionslot(); + void inbandspecialinfoslot(); + void inbandremotealertslot(); + void inbanddatacallslot(); + void inbandcallwaitslot(); + void inbandreorderslot(); + void inbandnoseqslot(); + void inbandbeepseqslot(); + void inbandstopslot(); + + void downlinkformatsslot(); + void pcmdecslot(); + void amrdecslot(); + void g711decslot(); + void g729decslot(); + void ilbcdecslot(); + + void uplinkformatsslot(); + void pcmencslot(); + void amrencslot(); + void g711encslot(); + void g729encslot(); + void ilbcencslot(); + + + void togglecngslot(); + void getcngslot(); + void toggleplcslot(); + void getplcslot(); + void setalawdecg711slot(); + void setulawdecg711slot(); + void getmodegdec711slot(); + void set20msdecilbcslot(); + void set30msdecilbcslot(); + void getmodedecilbcslot(); + + //Encoder settings + + void getsupportedbrslot(); + void setminbrslot(); + void setmaxbrslot(); + void getbrslot(); + void togglevadslot(); + void getvadslot(); + void setalawencg711slot(); + void setulawencg711slot(); + void getmodeencg711slot(); + void set20msencilbcslot(); + void set30msencilbcslot(); + void getmodeencilbcslot(); + + + void rtplayslot(); + void rtpauseslot(); + void rtmuteslot(); + void rtstopslot(); + void rtdeinitslot(); + void rtprofileslot(); + void rtttsslot(); + void rtfileslot(); + void rtbeepslot(); + void rtsequenceslot(); + void rtsilentslot(); + + void onetouchslot(); + +private: + void createActions(); + void createMenus(); + +private: + QWidget *mainContainer; + QMenu *audioMenu; + + QAction *qtmsengine; + QAction *tmsengine; + QMenu* enginemenu; + + QAction *cscall; + QAction *ipcall; + QAction *exitAction; + + QAction *dtmfdninit; + QAction *dtmfdnplay; + QAction *dtmfdnstop; + + QAction *dtmfupinit; + QAction *dtmfupplay; + QAction *dtmfupstop; + + QAction *inbandbusy; + QAction *inbandpathnotaval; + QAction *inbandcongestion; + QAction *inbandspecialinfo; + QAction *inbandreorder; + QAction *inbandremotealert; + QAction *inbandcallwait; + QAction *inbanddatacall; + QAction *inbandnoseq; + QAction *inbandbeepseq; + QAction *inbandstop; + + QAction *downlinkformats; + QAction *initdecoder; + QAction *strmdnstart; + QAction *strmdnstop; + QAction *strmdnclose; + QAction *pcmdec; + QAction *amrdec; + QAction *g711dec; + QAction *g729dec; + QAction *ilbcdec; + + QAction *uplinkformats; + QAction *initencoder; + QAction *strmupstart; + QAction *strmupstop; + QAction *strmupclose; + + QAction *pcmenc; + QAction *amrenc; + QAction *g711enc; + QAction *g729enc; + QAction *ilbcenc; + + QAction *availoutputact; + QAction *currentoutputact; + QAction *handsetact; + QAction *loudspkract; + QAction *wiredact; + QAction *btact; + QAction *ttyact; + + QAction *globalvolact; + QAction *globalmaxvolact; + QAction *globalsetvolact; + + QAction *globalgainact; + QAction *globalmaxgainact; + QAction *globalsetgainact; + + QAction *stmgainact; + QAction *stmmaxgainact; + QAction *stmsetgainact; + QAction *stmmutegainact; + + QAction *stmvolact; + QAction *stmmaxvolact; + QAction *stmsetvolact; + QAction *stmmutevolact; + + QAction *togglecng; + QAction *getcng; + QAction *toggleplc; + QAction *getplc; + QAction *setalawdecg711; + QAction *setulawdecg711; + QAction *getmodedecg711; + QAction *set20msdecilbc; + QAction *set30msdecilbc; + QAction *getmodedecilbc; + + QAction *getsupportedbr; + QAction *setminbr; + QAction *setmaxbr; + QAction *getbr; + QAction *togglevad; + QAction *getvad; + QAction *setalawencg711; + QAction *setulawencg711; + QAction *getmodeencg711; + QAction *set20msencilbc; + QAction *set30msencilbc; + QAction * getmodeencilbc; + + QAction *rtplay; + QAction *rtpause; + QAction *rtmute; + QAction *rtstop; + QAction *rtdeinit; + QAction *rtprofile; + QAction *rttts; + QAction *rtaudiofile; + QAction *rtbeep; + QAction *rtsequence; + QAction *rtsilent; + + QAction *onetouch; + + QTextEdit *statusDisplay; + + //TMS members + MTmsTestEngine *iTmsEngine; + + }; +#endif diff -r 3b098142db83 -r 92dbd2a406d9 qtms/tsrc/qttmstestapp/qttmstestapp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtms/tsrc/qttmstestapp/qttmstestapp.pro Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,72 @@ +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: QTMS TestApp project description +# + +TEMPLATE = app +TARGET = qttmstestapp + +QT = core gui +CONFIG += qt +#CONFIG += ordered + +include (buildflags.pri) + +symbian: { + DEFINES += SYMBIAN + TARGET.CAPABILITY = CAP_APPLICATION MultimediaDD + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.VID = VID_DEFAULT + TARGET.UID2 = 0x100039CE + TARGET.UID3 = 0x10207CA6 + } + +#RESOURCES += qtmstestapp.qrc + +#DEPENDPATH += src + +symbian: +{ +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ + $$OS_LAYER_LIBC_SYSTEMINCLUDE \ + $$OS_LAYER_GLIB_SYSTEMINCLUDE +} + +LIBS += -ltmsfactory \ + -ltmsapi \ + -lqtmsapi \ + -llibglib \ + -llibgobject \ + -llibgmodule \ + -llibstdcpp + +INCLUDEPATH += . inc + +DEPENDPATH += $$INCLUDEPATH src + +message(Qt version: $$[QT_VERSION]) +message($$_PRO_FILE_PWD_) +MOC_DIR = $$_PRO_FILE_PWD_/tmp +# Input + +HEADERS += qtmstestengine.h +HEADERS += ctmstestengine.h +HEADERS += mtmstestengine.h +HEADERS += qttmstestapp.h + +SOURCES += main.cpp +SOURCES += qttmstestapp.cpp +SOURCES += qtmstestengine.cpp +SOURCES += ctmstestengine.cpp + +SYMBIAN_PLATFORMS = WINSCW ARMV5 \ No newline at end of file diff -r 3b098142db83 -r 92dbd2a406d9 qtms/tsrc/qttmstestapp/src/ctmstestengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtms/tsrc/qttmstestapp/src/ctmstestengine.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3363 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service - TestApp + * + */ + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ctmstestengine.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 + +//#define __PROFILING_ENABLED__ + +#ifdef __PROFILING_ENABLED__ +#include "perfutility.h" +#endif //__PROFILING_ENABLED__ + +//#define __TEST_CODE_COVERAGE__ + +// CONSTANTS +_LIT8(KRTBeepSequence, "\x00\x11\x0A\x0A\x08\x73\x0A\x40\x28\x0A\xF7\ +\x05\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B"); +_LIT16(KTextToSpeak, "THE PHONE IS RINGING"); +_LIT16(KTestFile1, "C:\\Data\\Sounds\\Digital\\NokiaTest.aac"); + +#ifdef __RECORD_WAV_TO_FILE__ +_LIT(KFileName, "c:\\data\\tmsrec.amr"); +const TUint KFileBufLen = 4096; +const TInt KAMRNBHeaderLen = 6; +const TUint8 KAMRNBHeader[KAMRNBHeaderLen] = {0x23,0x21,0x41,0x4d,0x52,0x0a}; +#endif + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::CTmsTestEngine() +// constructor +// ---------------------------------------------------------------------------- +// +CTmsTestEngine::CTmsTestEngine() + { + // Disable GLib slice allocators; will take care of memory leaks + // caused by g_string_free(). + g_setenv("G_SLICE", "always-malloc", 1); + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::~CTmsTestEngine +// destructor +// ---------------------------------------------------------------------------- +// +CTmsTestEngine::~CTmsTestEngine() + { + EndCall(); + CloseRingTonePlayer(); + + if (iFactory && iGlobalVol) + { + static_cast (iGlobalVol)->RemoveObserver(*this); + iFactory->DeleteEffect(iGlobalVol); + } + if (iFactory && iGlobalGain) + { + static_cast (iGlobalGain)->RemoveObserver(*this); + iFactory->DeleteEffect(iGlobalGain); + } + if (iFactory && iTmsGlobalRouting) + { + iTmsGlobalRouting->RemoveObserver(*this); + iFactory->DeleteGlobalRouting(iTmsGlobalRouting); + } + if (iFactory && iInbandTonePlayer) + { + iInbandTonePlayer->RemoveObserver(*this); + iFactory->DeleteInbandTonePlayer(iInbandTonePlayer); + } + + delete iFactory; + +#ifdef __PLAY_WAV_FROM_FILE__ + iFile.Close(); + iFs.Close(); + delete iBuf; +#endif +#ifdef __RECORD_WAV_TO_FILE__ + iFile.Close(); + iFs.Close(); + delete iWriteBuf; +#endif + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::NewL +// Symbian constructor. +// ---------------------------------------------------------------------------- +// +CTmsTestEngine* CTmsTestEngine::NewL(QTextEdit* statusDisplay) + { + CTmsTestEngine* self(NULL); + self=CTmsTestEngine::NewLC(statusDisplay); + return self; + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::NewL +// Symbian constructor with self pointer pushed into the cleanup stack. +// ---------------------------------------------------------------------------- +// +CTmsTestEngine* CTmsTestEngine::NewLC(QTextEdit* statusDisplay) + { + CTmsTestEngine* self = new (ELeave) CTmsTestEngine; + //CleanupStack::PushL(self); + self->ConstructL(statusDisplay); + return self; + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::NewL +// Standard Symbian 2nd phase constructor +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::ConstructL(QTextEdit* statusDisplay) + { + DEBPRN0(_L("CTmsTestEngine[0x%x]::ConstructL :>")); + iStatusDisplay = statusDisplay; + +#ifdef __PLAY_WAV_FROM_FILE__ + iReadSize = KFileBufLen; + TInt err = iFs.Connect(); + if (err == TMS_RESULT_SUCCESS) + { + err = iFile.Open(iFs, KTestFile1, EFileShareAny | EFileRead); + } + if (err == TMS_RESULT_SUCCESS) + { + iFile.Size(iFileLen); + } + iBuf = HBufC8::NewL(iReadSize); +#endif + +#ifdef __RECORD_WAV_TO_FILE__ + TInt err = iFs.Connect(); + if (err == TMS_RESULT_SUCCESS) + { + err = iFile.Replace(iFs, KFileName, EFileWrite); +#ifndef __WINSCW__ + if (err == KErrNone) + { + // Prefix file with AMR-NB header + TBuf8 buf; + buf.Append(KAMRNBHeader, 6); + iFile.Write(buf, KAMRNBHeaderLen); + } +#endif //__WINSCW__ + } + iWriteLen = KFileBufLen; + iWriteBuf = HBufC8::NewL(iWriteLen); +#endif //__RECORD_WAV_TO_FILE__ + + CreateFactory(); + CreateGlobalRouting(); + CreateGlobalVol(); + CreateGlobalGain(); + CreateRingTonePlayer(); + + DEBPRN0(_L("CTmsTestEngine[0x%x]::ConstructL :<")); + } + +gint CTmsTestEngine::CreateFactory() + { + gint status(TMS_RESULT_SUCCESS); + TMSVer v(10,0,0); + status = TMSFactory::CreateFactory(iFactory, v); + + if (status != TMS_RESULT_SUCCESS || !iFactory) + { + DisplayText("Tms create factory failed ", status); + } + else + { +#ifdef __TEST_CODE_COVERAGE__ + TMSBuffer* tmsbuffer(NULL); + TMSBufferType buftype(TMS_BUFFER_MEMORY); + guint size(100); + iFactory->CreateBuffer(TMS_BUFFER_MEMORY, size, tmsbuffer); + if (tmsbuffer) + { + tmsbuffer->GetType(buftype); + tmsbuffer->GetDataSize(size); + tmsbuffer->SetDataSize(size); + guint8* pbuf(NULL); + tmsbuffer->GetDataPtr(pbuf); + guint64 ts(0); + tmsbuffer->GetTimeStamp(ts); + tmsbuffer->SetTimeStamp(ts); + iFactory->DeleteBuffer(tmsbuffer); + } +#endif //__TEST_CODE_COVERAGE__ + + DisplayText("Tms factory created"); + } + return status; + } + +gint CTmsTestEngine::CreateCall(TMSCallType calltype) + { + gint status(TMS_RESULT_SUCCESS); + if (iFactory && !iTmsCall) + { + status = iFactory->CreateCall(calltype, iTmsCall, 0); + if (status == TMS_RESULT_SUCCESS) + { +#ifdef __TEST_CODE_COVERAGE__ + guint ctxid; + iTmsCall->GetCallContextId(ctxid); +#endif //__TEST_CODE_COVERAGE__ + DisplayText("Tms call created"); + } + else + { + DisplayText("Tms call create failed ", status); + } + } + return status; + } + +gint CTmsTestEngine::CreateUplink() + { + gint status(TMS_RESULT_SUCCESS); + + if (iTmsCall) + { + status = iTmsCall->CreateStream(TMS_STREAM_UPLINK, iTmsUplink); + if (status == TMS_RESULT_SUCCESS) + { +#ifdef __TEST_CODE_COVERAGE__ + guint ctxid; + iTmsCall->GetCallContextId(ctxid); +#endif //__TEST_CODE_COVERAGE__ + DisplayText("TMS uplink created"); + } + else + { + DisplayText("TMS uplink failed ", status); + } + } + return status; + } + +gint CTmsTestEngine::CreateDownlink() + { + gint status(TMS_RESULT_SUCCESS); + + if (iTmsCall) + { + status = iTmsCall->CreateStream(TMS_STREAM_DOWNLINK, iTmsDnlink); + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("TMS downlink created"); + } + else + { + DisplayText("TMS downlink failed ", status); + } + } + return status; + } + +gint CTmsTestEngine::CreateClientSource() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iTmsClientSource) + { + status = iFactory->CreateSource(TMS_SOURCE_CLIENT, iTmsClientSource); + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("TMS clientsource created"); + } + else + { + DisplayText("TMS clientsource failed ", status); + } + } + return status; + } + +gint CTmsTestEngine::CreateModemSource() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iTmsModemSource) + { + status = iFactory->CreateSource(TMS_SOURCE_MODEM, iTmsModemSource); + if (status == TMS_RESULT_SUCCESS) + { +#ifdef __TEST_CODE_COVERAGE__ + TMSSourceType st; + iTmsModemSource->GetType(st); +#endif //__TEST_CODE_COVERAGE__ + DisplayText("TMS modemsource created"); + } + else + { + DisplayText("TMS modemsource failed ", status); + } + } + return status; + } + +gint CTmsTestEngine::AddClientSourceToStream() + { + gint status(TMS_RESULT_SUCCESS); + if (iTmsDnlink && iTmsClientSource) + { + static_cast (iTmsClientSource)->AddObserver(*this, + NULL); + status = iTmsDnlink->AddSource(iTmsClientSource); + +#ifdef __TEST_CODE_COVERAGE__ + TMSSourceType st; + static_cast (iTmsClientSource)->GetType(st); + gboolean enqueue(false); + static_cast (iTmsClientSource)->GetEnqueueMode(enqueue); + static_cast (iTmsClientSource)->SetEnqueueMode(FALSE); + static_cast (iTmsClientSource)->Flush(); +#endif //__TEST_CODE_COVERAGE__ + } + return status; + } + +gint CTmsTestEngine::AddModemSourceToStream() + { + gint status(TMS_RESULT_SUCCESS); + if (iTmsDnlink && iTmsModemSource) + { + status = iTmsDnlink->AddSource(iTmsModemSource); + } + return status; + } + +gint CTmsTestEngine::CreateClientSink() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iTmsClientSink) + { + status = iFactory->CreateSink(TMS_SINK_CLIENT, iTmsClientSink); + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("TMS client sink created"); + } + else + { + DisplayText("TMS client sink failed ", status); + } + } + return status; + } + +gint CTmsTestEngine::CreateModemSink() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iTmsModemSink) + { + status = iFactory->CreateSink(TMS_SINK_MODEM, iTmsModemSink); + if (status == TMS_RESULT_SUCCESS) + { +#ifdef __TEST_CODE_COVERAGE__ + TMSSinkType st; + iTmsModemSink->GetType(st); +#endif //__TEST_CODE_COVERAGE__ + DisplayText("TMS modem sink created"); + } + else + { + DisplayText("TMS modem sink failed ", status); + } + } + return status; + } + +gint CTmsTestEngine::AddClientSinkToStream() + { + gint status(TMS_RESULT_SUCCESS); + + if (iTmsUplink && iTmsClientSink) + { + status = static_cast (iTmsClientSink)->AddObserver( + *this, NULL); + status |= iTmsUplink->AddSink(iTmsClientSink); + } + return status; + } + +gint CTmsTestEngine::AddModemSinkToStream() + { + gint status(TMS_RESULT_SUCCESS); + + if (iTmsUplink && iTmsModemSink) + { + status = iTmsUplink->AddSink(iTmsModemSink); + } + return status; + } + +gint CTmsTestEngine::CreateMicSource() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iTmsMicSource) + { + status = iFactory->CreateSource(TMS_SOURCE_MIC, iTmsMicSource); + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("TMS mic source created"); + } + else + { + DisplayText("TMS mic source failed ", status); + } + } + return status; + } + +gint CTmsTestEngine::AddMicSourceToStream() + { + gint status(TMS_RESULT_SUCCESS); + if (iTmsUplink && iTmsMicSource) + { + status = iTmsUplink->AddSource(iTmsMicSource); + } + return status; + } + +gint CTmsTestEngine::CreateSpeakerSink() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iTmsSpeakerSink) + { + status = iFactory->CreateSink(TMS_SINK_SPEAKER, iTmsSpeakerSink); + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("TMS speaker sink created"); + } + else + { + DisplayText("TMS speaker sink failed ", status); + } + } + return status; + } + +gint CTmsTestEngine::AddSpeakerSinkToStream() + { + gint status(TMS_RESULT_SUCCESS); + if (iTmsDnlink && iTmsSpeakerSink) + { + status = iTmsDnlink->AddSink(iTmsSpeakerSink); + } + return status; + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetCallType +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetCallType(TMSCallType calltype) + { + gint status(KErrNotFound); + +#ifdef __PROFILING_ENABLED__ + TAG_CALLBACK_TIME_PROFILING_START; +#endif //__PROFILING_ENABLED__ + + if (iFactory) + { + iCallType = calltype; + + if (!iTmsCall) + { + gboolean issupported(FALSE); + iFactory->IsCallTypeSupported(iCallType, issupported); + if (issupported) + { + status = iFactory->CreateCall(iCallType, iTmsCall); + } + else + { + status = KErrNotSupported; + } + } + + iCallType = iTmsCall->GetCallType(); + + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("Tms call created"); + } + else + { + DisplayText("Tms call creation failed ", status); + } + } + if (status == TMS_RESULT_SUCCESS) + { + status = CreateUplink(); + } + if (status == TMS_RESULT_SUCCESS) + { + status = CreateDownlink(); + } + if (iCallType == TMS_CALL_IP) + { + if (status == TMS_RESULT_SUCCESS) + { + status = CreateMicSource(); + status |= AddMicSourceToStream(); + status |= CreateClientSink(); + status |= AddClientSinkToStream(); + } + + if (status == TMS_RESULT_SUCCESS) + { + status |= CreateClientSource(); + status |= AddClientSourceToStream(); + status |= CreateSpeakerSink(); + status |= AddSpeakerSinkToStream(); + } + } + else if (iCallType == TMS_CALL_CS) + { + if (status == TMS_RESULT_SUCCESS) + { + status = CreateMicSource(); + status |= AddMicSourceToStream(); + status |= CreateModemSink(); + status |= AddModemSinkToStream(); + } + if (status == TMS_RESULT_SUCCESS) + { + status = CreateModemSource(); + status |= AddModemSourceToStream(); + status |= CreateSpeakerSink(); + status |= AddSpeakerSinkToStream(); + } + } + + if (status == TMS_RESULT_SUCCESS) + { + status = CreateVolumeEffect(); + status |= AddVolumeEffectToStream(); + status |= CreateGainEffect(); + status |= AddGainEffectToStream(); + } + + //NOTE: CS does not call SetDownlinkFormat/SetUplinkFormat + //so it is OK to open downlink and uplink at this point. + if (status == TMS_RESULT_SUCCESS && iCallType == TMS_CALL_CS) + { + // To avoid asyc calback racing situation, it may be safer to + // start second stream after receiving TMS_STREAM_INITIALIZED event. + // But for now, let's try opening both at the same time. + OpenDownlink(); + OpenUplink(); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetSupportedDownlinkFormats +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetSupportedDownlinkFormats(TBool aDisplayList) + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory) + { + status = iFactory->GetSupportedFormats(TMS_STREAM_DOWNLINK, iDnlCodecs); + + if (status != TMS_RESULT_SUCCESS) + { + DisplayText("DNL Codecs retrieve error: ", status); + } + + if (iDnlCodecs.size() > 0 && aDisplayList) + { + DisplayText("Supported DNL codecs"); + std::vector::iterator itDnlCodecs = iDnlCodecs.begin(); + TMSFormatType fmttype; + for (; itDnlCodecs < iDnlCodecs.end(); itDnlCodecs++) + { + (*itDnlCodecs)->GetType(fmttype); + DisplayFormat(fmttype); + } + gint size = iDnlCodecs.size(); + for (gint i = 0; i < size; i++) + { + itDnlCodecs = iDnlCodecs.begin(); + iFactory->DeleteFormat(*itDnlCodecs); + iDnlCodecs.erase(itDnlCodecs); + } + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetSupportedUplinkFormats +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetSupportedUplinkFormats(TBool aDisplayList) + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory) + { + status = iFactory->GetSupportedFormats(TMS_STREAM_UPLINK, iUplCodecs); + if (status != TMS_RESULT_SUCCESS) + { + DisplayText("UPL Codecs retrieve error: ", status); + } + + if (iUplCodecs.size() > 0 && aDisplayList) + { + DisplayText("Supported UPL codecs"); + std::vector::iterator codecs = iUplCodecs.begin(); + TMSFormatType fmttype; + for (; codecs < iUplCodecs.end(); codecs++) + { + (*codecs)->GetType(fmttype); + DisplayFormat(fmttype); + } + gint size = iUplCodecs.size(); + for (gint i = 0; i < size; i++) + { + codecs = iUplCodecs.begin(); + iFactory->DeleteFormat(*codecs); + iUplCodecs.erase(codecs); + } + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::DisplayFormat +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::DisplayFormat(TMSFormatType aFormat) + { + switch (aFormat) + { + case TMS_FORMAT_AMR: + DisplayText("AMR-NB"); + break; + case TMS_FORMAT_G711: + DisplayText("G.711"); + break; + case TMS_FORMAT_G729: + DisplayText("G.729"); + break; + case TMS_FORMAT_ILBC: + DisplayText("iLBC"); + break; + case TMS_FORMAT_PCM: + DisplayText("PCM-16"); + break; + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetDownlinkFormat() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetDownlinkFormat(TMSFormatType aCodecFormat) + { + gint status(TMS_RESULT_SUCCESS); + + if (!iTmsCall) + { + SetCallType(TMS_CALL_IP); + } + if (iFactory && iDecFormatIntfc) + { + iFactory->DeleteFormat(iDecFormatIntfc); + } + + iDnLinkCodec = aCodecFormat; + + if (iFactory && iTmsDnlink) + { + status = iFactory->CreateFormat(iDnLinkCodec, iDecFormatIntfc); + status |= iTmsDnlink->SetFormat(iDecFormatIntfc); + } + +#ifdef __TEST_CODE_COVERAGE__ + TMSFormatType ft; +#endif //__TEST_CODE_COVERAGE__ + + switch (iDnLinkCodec) + { + case TMS_FORMAT_G711: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iDecFormatIntfc->GetType(ft); + if (ft != TMS_FORMAT_G711) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("G.711 DNL Codec Set"); + break; + } + case TMS_FORMAT_G729: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iDecFormatIntfc->GetType(ft); + if (ft != TMS_FORMAT_G729) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("G.729 DNL Codec Set"); + break; + } + case TMS_FORMAT_ILBC: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iDecFormatIntfc->GetType(ft); + if (ft != TMS_FORMAT_ILBC) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("iLBC DNL Codec Set"); + break; + } + case TMS_FORMAT_AMR: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iDecFormatIntfc->GetType(ft); + if (ft != TMS_FORMAT_AMR) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("AMR-NB DNL Codec Set"); + break; + } + case TMS_FORMAT_PCM: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iDecFormatIntfc->GetType(ft); + if (ft != TMS_FORMAT_PCM) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("PCM-16 DNL Codec Set"); + break; + } + default: + { + status = KErrNotSupported; + } + } + + if (status == TMS_RESULT_SUCCESS) + { + OpenDownlink(); //Initialize DNL + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::OpenDownlink() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::OpenDownlink() + { + gint status(TMS_RESULT_SUCCESS); + + if (iTmsDnlink) + { + iTmsDnlink->AddObserver(*this, NULL); + status = iTmsDnlink->Init(); + if (status != TMS_RESULT_SUCCESS) + { + DisplayText("DNL init error ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::StartDownlink() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::StartDownlink() + { + if (iDnLinkStatus == EReady) + { +#ifdef __TEST_CODE_COVERAGE__ + ConfigureDecoder(); + gint id = iTmsDnlink->GetStreamId(); +#endif //__TEST_CODE_COVERAGE__ + + iTmsDnlink->Start(2); //retry for ~2 sec + iDnLinkStatus = EStreaming; +#ifdef __WINSCW__ + iBufIndex = 0; +#endif //__WINSCW__ + } + else + { + DisplayText("DNL not ready"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::StopDownlink() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::StopDownlink() + { + if (iDnLinkStatus == EStreaming) + { +#ifdef __TEST_CODE_COVERAGE__ + iTmsDnlink->Pause(); + iTmsDnlink->GetState(); +#endif //__TEST_CODE_COVERAGE__ + + iTmsDnlink->Stop(); + iDnLinkStatus = EReady; + iOneTouchLoopback = EFalse; + DisplayText("DNL stopped"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::CloseDownlink() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::CloseDownlink() + { + if (iTmsDnlink && iDnLinkStatus != ENotReady) + { + if (iTmsDnlinkEffect) + { + iTmsDnlink->RemoveEffect(iTmsDnlinkEffect); + } + if (iTmsClientSource) + { + iTmsDnlink->RemoveSource(iTmsClientSource); + } + if (iTmsModemSource) + { + iTmsDnlink->RemoveSource(iTmsModemSource); + } + if (iTmsSpeakerSink) + { + iTmsDnlink->RemoveSink(iTmsSpeakerSink); + } + iTmsDnlink->Deinit(); + iDnLinkStatus = ENotReady; + } + iPlayBufReady = EFalse; + iOneTouchLoopback = EFalse; + } + +gint CTmsTestEngine::CreateVolumeEffect() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && iTmsDnlink && !iTmsDnlinkEffect) + { + status = iFactory->CreateEffect(TMS_EFFECT_VOLUME, iTmsDnlinkEffect); + if (status == TMS_RESULT_SUCCESS) + { + static_cast (iTmsDnlinkEffect)->AddObserver( + *this, NULL); + } + } + return status; + } + +gint CTmsTestEngine::AddVolumeEffectToStream() + { + gint status(TMS_RESULT_SUCCESS); + + if (iTmsDnlink && iTmsDnlinkEffect) + { + status = iTmsDnlink->AddEffect(iTmsDnlinkEffect); + } + return status; + } + +gint CTmsTestEngine::CreateGainEffect() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && iTmsUplink && !iTmsUplinkEffect) + { + status = iFactory->CreateEffect(TMS_EFFECT_GAIN, iTmsUplinkEffect); + if (status == TMS_RESULT_SUCCESS) + { + static_cast (iTmsUplinkEffect)->AddObserver(*this, + NULL); + } + } + return status; + } + +gint CTmsTestEngine::CreateGlobalRouting() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory) + { + status = iFactory->CreateGlobalRouting(iTmsGlobalRouting); + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("TMS routing created"); + iTmsGlobalRouting->AddObserver(*this, NULL); + } + else + { + DisplayText("Global routing failed: ", status); + } + } + return status; + } + +gint CTmsTestEngine::AddGainEffectToStream() + { + gint status(TMS_RESULT_SUCCESS); + + if (iTmsUplink && iTmsUplinkEffect) + { + status = iTmsUplink->AddEffect(iTmsUplinkEffect); + } + return status; + } + +gint CTmsTestEngine::CreateRingTonePlayer() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory) + { + status = iFactory->CreateRingTonePlayer(iTmsRingTonePlayer); + + if (iTmsRingTonePlayer && status == TMS_RESULT_SUCCESS) + { + iTmsRingTonePlayer->AddObserver(*this, NULL); + DisplayText("RingTone Player created"); + } + else + { + DisplayText("RT create failed: ", status); + } + } + return status; + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::ConfigureDecoder() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::ConfigureDecoder() + { + // NOTE: These calls can ONLY be made when codec is in a STOPPED state. + + switch (iDnLinkCodec) + { + case TMS_FORMAT_G711: + { + gboolean cng(TRUE); + static_cast (iDecFormatIntfc)->SetCNG(cng); + static_cast (iDecFormatIntfc)->GetCNG(cng); + gboolean plc(FALSE); + static_cast (iDecFormatIntfc)->SetPlc(plc); + static_cast (iDecFormatIntfc)->GetPlc(plc); + TMSG711CodecMode mode(TMS_G711_CODEC_MODE_ALAW); + static_cast (iDecFormatIntfc)->SetMode(mode); + static_cast (iDecFormatIntfc)->GetMode(mode); + break; + } + case TMS_FORMAT_ILBC: + { + gboolean cng(TRUE); + static_cast (iDecFormatIntfc)->SetCNG(cng); + static_cast (iDecFormatIntfc)->GetCNG(cng); + TMSILBCCodecMode mode(TMS_ILBC_CODEC_MODE_20MS_FRAME); + static_cast (iDecFormatIntfc)->SetMode(mode); + static_cast (iDecFormatIntfc)->GetMode(mode); + break; + } + case TMS_FORMAT_G729: + case TMS_FORMAT_AMR: + case TMS_FORMAT_PCM: + default: + { + break; + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetMaxVolume() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetMaxVolume() + { + if (iTmsDnlinkEffect) + { + static_cast (iTmsDnlinkEffect)->GetMaxLevel( + iMaxVolume); + } + DisplayText("Max Volume: ", iMaxVolume); + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetVolume +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetVolume() + { + if (iTmsDnlinkEffect) + { + static_cast (iTmsDnlinkEffect)->GetLevel(iVolume); + } + DisplayText("Volume ", iVolume); + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::MuteSpeaker() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::MuteSpeaker() + { + SetVolume(0); + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetMaxVolume +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetMaxVolume() + { + SetVolume(iMaxVolume); + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetVolume +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetVolume(guint aVolume) + { + iVolume = aVolume; + + if (iTmsDnlinkEffect) + { + static_cast (iTmsDnlinkEffect)->SetLevel(aVolume); + } + else + { + DisplayText("Create Dnlink VolumeEffect first"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::VolumeUp() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::VolumeUp() + { + if ((iDnLinkStatus == EReady || iDnLinkStatus == EStreaming) + && iTmsDnlinkEffect) + { + if (iVolume < iMaxVolume) + { + static_cast (iTmsDnlinkEffect)->SetLevel( + ++iVolume); + } + } + else + { + DisplayText("Create DNL first"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::VolumeDn() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::VolumeDn() + { + if ((iDnLinkStatus == EReady || iDnLinkStatus == EStreaming) + && iTmsDnlinkEffect) + { + if (iVolume > 0) + { + static_cast (iTmsDnlinkEffect)->SetLevel( + --iVolume); + } + } + else + { + DisplayText("Open DNL first"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::OpenUplink() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::OpenUplink() + { + gint status = TMS_RESULT_SUCCESS; + + if (iTmsUplink) + { + iTmsUplink->AddObserver(*this, NULL); + status = iTmsUplink->Init(); //retry for ~3 sec + if (status != TMS_RESULT_SUCCESS) + { + DisplayText("UPL init error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::StartUplink() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::StartUplink() + { + if (iUpLinkStatus == EReady) + { +#ifdef __TEST_CODE_COVERAGE__ + ConfigureEncoder(); + ToggleVad(); + GetVad(); + GetSupportedBitrates(); + SelectMaxBitrate(); + GetBitrate(); + gint id = iTmsUplink->GetStreamId(); +#endif //__TEST_CODE_COVERAGE__ + + iTmsUplink->Start(4); //retry for ~4 sec + iUpLinkStatus = EStreaming; + } + else + { + DisplayText("UPL not ready"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::StopUplink() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::StopUplink() + { + if (iUpLinkStatus == EStreaming) + { + iTmsUplink->Stop(); + iUpLinkStatus = EReady; + iOneTouchLoopback = EFalse; + DisplayText("UPL stopped"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::CloseUplink() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::CloseUplink() + { + iRecBufReady = EFalse; + iOneTouchLoopback = EFalse; + + if (iTmsUplink && iUpLinkStatus != ENotReady) + { + if (iTmsUplinkEffect) + { + iTmsUplink->RemoveEffect(iTmsUplinkEffect); + } + if (iTmsMicSource) + { + iTmsUplink->RemoveSource(iTmsMicSource); + } + if (iTmsClientSink) + { + iTmsUplink->RemoveSink(iTmsClientSink); + } + if (iTmsModemSink) + { + iTmsUplink->RemoveSink(iTmsModemSink); + } + iTmsUplink->Deinit(); + iUpLinkStatus = ENotReady; + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetUplinkFormat() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetUplinkFormat(TMSFormatType aCodecFormat) + { + gint status(TMS_RESULT_SUCCESS); + + if (!iTmsCall) + { + SetCallType(TMS_CALL_IP); + } + if (iFactory && iEncFormatIntfc) + { + iFactory->DeleteFormat(iEncFormatIntfc); + } + + iUpLinkCodec = aCodecFormat; + + if (iFactory && iTmsUplink) + { + status = iFactory->CreateFormat(iUpLinkCodec, iEncFormatIntfc); + status |= iTmsUplink->SetFormat(iEncFormatIntfc); + } + +#ifdef __TEST_CODE_COVERAGE__ + TMSFormatType ft; +#endif //__TEST_CODE_COVERAGE__ + + switch (iUpLinkCodec) + { + case TMS_FORMAT_G711: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iEncFormatIntfc->GetType(ft); + if (ft != TMS_FORMAT_G711) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("G.711 UPL Codec Set"); + break; + } + case TMS_FORMAT_G729: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iEncFormatIntfc->GetType(ft); + if (ft != TMS_FORMAT_G729) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("G.729 UPL Codec Set"); + break; + } + case TMS_FORMAT_ILBC: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iEncFormatIntfc->GetType(ft); + if (ft != TMS_FORMAT_ILBC) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("iLBC UPL Codec Set"); + break; + } + case TMS_FORMAT_AMR: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iEncFormatIntfc->GetType(ft); + if (ft != TMS_FORMAT_AMR) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("AMR-NB UPL Codec Set"); + break; + } + case TMS_FORMAT_PCM: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iEncFormatIntfc->GetType(ft); + if (ft != TMS_FORMAT_PCM) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("PCM-16 UPL Codec Set"); + break; + } + default: + { + status = KErrNotSupported; + } + } + + if (status == TMS_RESULT_SUCCESS) + { + OpenUplink(); //Initialize UPL + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::ConfigureEncoder() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::ConfigureEncoder() + { + // Any of these calls can ONLY be made when encoder is in a STOPPED state. + + switch (iUpLinkCodec) + { + case TMS_FORMAT_G711: + { + TMSG711CodecMode mode(TMS_G711_CODEC_MODE_ALAW); + static_cast (iEncFormatIntfc)->SetMode(mode); + static_cast (iEncFormatIntfc)->GetMode(mode); + break; + } + case TMS_FORMAT_ILBC: + { + TMSILBCCodecMode mode(TMS_ILBC_CODEC_MODE_20MS_FRAME); + static_cast (iEncFormatIntfc)->SetMode(mode); + static_cast (iEncFormatIntfc)->GetMode(mode); + break; + } + case TMS_FORMAT_G729: + case TMS_FORMAT_AMR: + case TMS_FORMAT_PCM: + default: + { + break; + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetMaxGain() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetMaxGain() + { + if (iTmsUplinkEffect) + { + static_cast (iTmsUplinkEffect)->GetMaxLevel(iMaxGain); + DisplayText("MaxGain: ", iMaxGain); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetGain() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetGain() + { + guint gain; + if (iTmsUplinkEffect) + { + static_cast (iTmsUplinkEffect)->GetLevel(gain); + DisplayText("Gain: ", gain); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetMaxGain() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetMaxGain() + { + static_cast (iTmsUplinkEffect)->SetLevel(iMaxGain); + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::MuteMic() +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::MuteMic() + { + static_cast (iTmsUplinkEffect)->SetLevel(0); + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetSupportedBitrates +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetSupportedBitrates() + { + TInt status = GetSupportedBitrates(iBitratesVector); + + if (status == TMS_RESULT_SUCCESS) + { + std::vector::iterator itBitrates = iBitratesVector.begin(); + for (; itBitrates < iBitratesVector.end(); itBitrates++) + { + DisplayText("BR ", *itBitrates); + } + } + else + { + DisplayText("BR Error: ", status); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetSupportedBitrates +// +// ---------------------------------------------------------------------------- +// +TInt CTmsTestEngine::GetSupportedBitrates(BitRateVector& aBrArr) + { + TInt status = KErrNotFound; + + switch (iUpLinkCodec) + { + case TMS_FORMAT_G711: + status = static_cast + (iEncFormatIntfc)->GetSupportedBitRates(aBrArr); + break; + case TMS_FORMAT_G729: + status = static_cast + (iEncFormatIntfc)->GetSupportedBitRates(aBrArr); + break; + case TMS_FORMAT_ILBC: + status = static_cast + (iEncFormatIntfc)->GetSupportedBitRates(aBrArr); + break; + case TMS_FORMAT_AMR: + status = static_cast + (iEncFormatIntfc)->GetSupportedBitRates(aBrArr); + break; + case TMS_FORMAT_PCM: + default: + status = KErrNotSupported; + break; + } + return status; + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SelectMinBitrate +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SelectMinBitrate() + { + if (iBitratesVector.size() > 0) + { + std::vector::iterator bitrate = iBitratesVector.begin(); + iBitrate = *bitrate; + SetBitrate(iBitrate); + DisplayText("BR set: ", iBitrate); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SelectMaxBitrate +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SelectMaxBitrate() + { + if (iBitratesVector.size() > 0) + { + iBitrate = iBitratesVector.back(); + SetBitrate(iBitrate); + DisplayText("BR set: ", iBitrate); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetBitrate +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetBitrate(TUint aBitrate) + { + switch (iUpLinkCodec) + { + case TMS_FORMAT_G711: + static_cast (iEncFormatIntfc)->SetBitRate(aBitrate); + DisplayText("Set BR: ", iBitrate); + break; + case TMS_FORMAT_G729: + static_cast (iEncFormatIntfc)->SetBitRate(aBitrate); + DisplayText("Set BR: ", iBitrate); + break; + case TMS_FORMAT_ILBC: + static_cast (iEncFormatIntfc)->SetBitRate(aBitrate); + DisplayText("Set BR: ", iBitrate); + break; + case TMS_FORMAT_AMR: + static_cast (iEncFormatIntfc)->SetBitRate(aBitrate); + DisplayText("Set BR: ", iBitrate); + break; + case TMS_FORMAT_PCM: + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetBitrate +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetBitrate() + { + if (iUpLinkCodec != TMS_FORMAT_PCM) + { + GetBitrate(iBitrate); + DisplayText("Current BR: ", iBitrate); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetBitrate +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetBitrate(TUint& aBitrate) + { + switch (iUpLinkCodec) + { + case TMS_FORMAT_G711: + static_cast (iEncFormatIntfc)->GetBitRate(aBitrate); + break; + case TMS_FORMAT_G729: + static_cast (iEncFormatIntfc)->GetBitRate(aBitrate); + break; + case TMS_FORMAT_ILBC: + static_cast (iEncFormatIntfc)->GetBitRate(aBitrate); + break; + case TMS_FORMAT_AMR: + static_cast (iEncFormatIntfc)->GetBitRate(aBitrate); + break; + case TMS_FORMAT_PCM: + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::ToggleVad +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::ToggleVad() + { + iVad = (iVad) ? EFalse : ETrue; + + switch (iUpLinkCodec) + { + case TMS_FORMAT_G711: + static_cast (iEncFormatIntfc)->SetVADMode(iVad); + DisplayText("Set VAD: ", iVad); + break; + case TMS_FORMAT_G729: + static_cast (iEncFormatIntfc)->SetVADMode(iVad); + DisplayText("Set VAD: ", iVad); + break; + case TMS_FORMAT_ILBC: + static_cast (iEncFormatIntfc)->SetVADMode(iVad); + DisplayText("Set VAD: ", iVad); + break; + case TMS_FORMAT_AMR: + //static_cast (iEncFormatIntfc)->SetVADMode(iVad); + //DisplayText("Set VAD: ", iVad); + break; + case TMS_FORMAT_PCM: + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetVad +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetVad() + { + switch (iUpLinkCodec) + { + case TMS_FORMAT_G711: + static_cast (iEncFormatIntfc)->GetVADMode(iVad); + DisplayText("Current VAD: ", iVad); + break; + case TMS_FORMAT_G729: + static_cast (iEncFormatIntfc)->GetVADMode(iVad); + DisplayText("Current VAD: ", iVad); + break; + case TMS_FORMAT_ILBC: + static_cast (iEncFormatIntfc)->GetVADMode(iVad); + DisplayText("Current VAD: ", iVad); + break; + case TMS_FORMAT_AMR: + //static_cast (iEncFormatIntfc)->GetVADMode(iVad); + //DisplayText("Current VAD: ", iVad); + break; + case TMS_FORMAT_PCM: + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::ToggleCng +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::ToggleCng() + { + iCng = (iCng) ? EFalse : ETrue; + + switch (iDnLinkCodec) + { + case TMS_FORMAT_G711: + static_cast (iDecFormatIntfc)->SetCNG(iCng); + DisplayText("Set CNG ", iCng); + break; + case TMS_FORMAT_ILBC: + static_cast (iDecFormatIntfc)->SetCNG(iCng); + DisplayText("Set CNG ", iCng); + break; + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetCng +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetCng() + { + switch (iDnLinkCodec) + { + case TMS_FORMAT_G711: + static_cast (iDecFormatIntfc)->GetCNG(iCng); + DisplayText("Current CNG ", iCng); + break; + case TMS_FORMAT_ILBC: + static_cast (iDecFormatIntfc)->GetCNG(iCng); + DisplayText("Current CNG ", iCng); + break; + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::TogglePlc +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::TogglePlc() + { + iPlc = (iPlc) ? EFalse : ETrue; + if (iDnLinkCodec == TMS_FORMAT_G711) + { + static_cast (iDecFormatIntfc)->SetPlc(ETrue); + DisplayText("Set PLC ", iPlc); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetPlc +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetPlc() + { + if (iDnLinkCodec == TMS_FORMAT_G711) + { + static_cast (iDecFormatIntfc)->GetPlc(iPlc); + DisplayText("Current PLC ", iPlc); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetDnLinkG711ALAW +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetDnLinkG711ALAW() + { + if (iDnLinkCodec == TMS_FORMAT_G711) + { + static_cast (iDecFormatIntfc)->SetMode( + TMS_G711_CODEC_MODE_ALAW); + DisplayText("DNL G.711 Mode Set: [aLaw]"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetDnLinkG711uLAW +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetDnLinkG711uLAW() + { + if (iDnLinkCodec == TMS_FORMAT_G711) + { + static_cast (iDecFormatIntfc)->SetMode( + TMS_G711_CODEC_MODE_MULAW); + DisplayText("DNL G.711 Mode Set: [uLaw]"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetDnLinkG711Mode +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetDnLinkG711Mode() + { + if (iDnLinkCodec == TMS_FORMAT_G711) + { + TMSG711CodecMode mode; + TInt status = static_cast (iDecFormatIntfc)->GetMode( + mode); + + if (status == TMS_RESULT_SUCCESS) + { + if (mode == TMS_G711_CODEC_MODE_MULAW) + { + DisplayText("DNL G711 Mode: [uLaw]"); + } + else + { + DisplayText("DNL G711 Mode: [aLaw]"); + } + } + else + { + DisplayText("DNL G711 GetMode Error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetDnLinkILBC20MS +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetDnLinkILBC20MS() + { + if (iDnLinkCodec == TMS_FORMAT_ILBC) + { + static_cast (iDecFormatIntfc)->SetMode( + TMS_ILBC_CODEC_MODE_20MS_FRAME); + DisplayText("DNL iLBC Mode Set: [20ms]"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetDnLinkILBC30MS +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetDnLinkILBC30MS() + { + if (iDnLinkCodec == TMS_FORMAT_ILBC) + { + static_cast (iDecFormatIntfc)->SetMode( + TMS_ILBC_CODEC_MODE_30MS_FRAME); + DisplayText("DNL iLBC Mode Set: [30ms]"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetDnLinkILBCMode +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetDnLinkILBCMode() + { + if (iDnLinkCodec == TMS_FORMAT_ILBC) + { + TMSILBCCodecMode mode; + gint status = static_cast (iDecFormatIntfc)->GetMode( + mode); + + if (status == TMS_RESULT_SUCCESS) + { + if (mode == TMS_ILBC_CODEC_MODE_30MS_FRAME) + { + DisplayText("DNL iLBC Mode: [30ms]"); + } + else if (mode == TMS_ILBC_CODEC_MODE_20MS_FRAME) + { + DisplayText("DNL iLBC Mode: [20ms]"); + } + } + else + { + DisplayText("DNL iLBC GetMode Error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetUpLinkG711ALAW +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetUpLinkG711ALAW() + { + if (iUpLinkCodec == TMS_FORMAT_G711) + { + static_cast (iEncFormatIntfc)->SetMode( + TMS_G711_CODEC_MODE_ALAW); + DisplayText("UPL G.711 Mode Set: [aLaw]"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetUpLinkG711uLAW +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetUpLinkG711uLAW() + { + + if (iUpLinkCodec == TMS_FORMAT_G711) + { + static_cast (iEncFormatIntfc)->SetMode( + TMS_G711_CODEC_MODE_MULAW); + DisplayText("UPL G.711 Mode Set: [uLaw]"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetUpLinkG711Mode +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetUpLinkG711Mode() + { + gint status(TMS_RESULT_SUCCESS); + if (iUpLinkCodec == TMS_FORMAT_G711) + { + TMSG711CodecMode mode; + status = static_cast (iEncFormatIntfc)->GetMode(mode); + + if (status == TMS_RESULT_SUCCESS) + { + if (mode == TMS_G711_CODEC_MODE_MULAW) + { + DisplayText("UPL G.711 Mode: [uLaw]"); + } + else if (mode == TMS_G711_CODEC_MODE_ALAW) + { + DisplayText("UPL G.711 Mode: [aLaw]"); + } + } + else + { + DisplayText("UPL G.711 GetMode Error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetUpLinkILBC20MS +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetUpLinkILBC20MS() + { + if (iUpLinkCodec == TMS_FORMAT_ILBC) + { + static_cast (iEncFormatIntfc)->SetMode( + TMS_ILBC_CODEC_MODE_20MS_FRAME); + DisplayText("UPL iLBC Mode Set: [20ms]"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetUpLinkILBC30MS +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetUpLinkILBC30MS() + { + if (iUpLinkCodec == TMS_FORMAT_ILBC) + { + static_cast (iEncFormatIntfc)->SetMode( + TMS_ILBC_CODEC_MODE_30MS_FRAME); + DisplayText("UPL iLBC Mode Set: [30ms]"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetUpLinkILBCMode +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetUpLinkILBCMode() + { + gint status(TMS_RESULT_SUCCESS); + if (iUpLinkCodec == TMS_FORMAT_ILBC) + { + TMSILBCCodecMode mode; + status = static_cast (iEncFormatIntfc)->GetMode(mode); + + if (status == TMS_RESULT_SUCCESS) + { + if (mode == TMS_ILBC_CODEC_MODE_30MS_FRAME) + { + DisplayText("UPL iLBC Mode: [30ms]"); + } + else if (mode == TMS_ILBC_CODEC_MODE_20MS_FRAME) + { + DisplayText("UPL iLBC Mode: [20ms]"); + } + } + else + { + DisplayText("UPL iLBC GetMode Error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::CreateGlobalVol +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::CreateGlobalVol() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iGlobalVol) + { + status = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_VOL, iGlobalVol); + + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("Global Vol Created"); + static_cast (iGlobalVol)->AddObserver(*this, + NULL); + } + else + { + DisplayText("Global Vol failed: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::CreateGlobalGain +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::CreateGlobalGain() + { + gint status(TMS_RESULT_SUCCESS); + + if (iFactory && !iGlobalGain) + { + status = iFactory->CreateEffect(TMS_EFFECT_GLOBAL_GAIN, iGlobalGain); + + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("Global Gain Created"); + static_cast (iGlobalGain)->AddObserver(*this, + NULL); + } + else + { + DisplayText("Global Gain failed: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetGlobalVol +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetGlobalVol() + { + if (iGlobalVol) + { + TUint level(0); + static_cast (iGlobalVol)->GetLevel(level); + DisplayText("Global Vol: ", level); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetGlobalMaxVol +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetGlobalMaxVol() + { + if (iGlobalVol) + { + TUint level(0); + static_cast (iGlobalVol)->GetMaxLevel(level); + DisplayText("Global Max Vol: ", level); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetGlobalVol +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetGlobalVol() + { + TUint level(0); + if (iGlobalVol) + { + static_cast (iGlobalVol)->GetMaxLevel(level); + static_cast (iGlobalVol)->SetLevel(level); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetGlobalGain +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetGlobalGain() + { + if (iGlobalGain) + { + TUint level(0); + static_cast (iGlobalGain)->GetLevel(level); + DisplayText("Global Gain: ", level); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetGlobalMaxGain +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetGlobalMaxGain() + { + if (iGlobalGain) + { + TUint level(0); + static_cast (iGlobalGain)->GetMaxLevel(level); + DisplayText("Global Max gain: ", level); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetGlobalGain +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetGlobalGain() + { + TUint level(0); + if (iGlobalGain) + { + static_cast (iGlobalGain)->GetMaxLevel(level); + static_cast (iGlobalGain)->SetLevel(level); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetOutputDevice +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetOutputDevice(TMSAudioOutput device) + { + gint status(TMS_RESULT_SUCCESS); + + if (iTmsGlobalRouting) + { + switch (device) + { + case TMS_AUDIO_OUTPUT_NONE: + status = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_NONE); + DisplayText("Routing none"); + break; + case TMS_AUDIO_OUTPUT_PUBLIC: + status = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_PUBLIC); + DisplayText("Routing public"); + break; + case TMS_AUDIO_OUTPUT_PRIVATE: + status = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_PRIVATE); + DisplayText("Routing private"); + break; + case TMS_AUDIO_OUTPUT_HANDSET: + status = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_HANDSET); + DisplayText("Routing to handset"); + break; + case TMS_AUDIO_OUTPUT_LOUDSPEAKER: + status = iTmsGlobalRouting->SetOutput( + TMS_AUDIO_OUTPUT_LOUDSPEAKER); + DisplayText("Routing to Loudspeaker"); + break; + case TMS_AUDIO_OUTPUT_WIRED_ACCESSORY: + status = iTmsGlobalRouting->SetOutput( + TMS_AUDIO_OUTPUT_WIRED_ACCESSORY); + DisplayText("Routing to Wired accessory"); + break; + case TMS_AUDIO_OUTPUT_ACCESSORY: + status = iTmsGlobalRouting->SetOutput( + TMS_AUDIO_OUTPUT_ACCESSORY); + DisplayText("Routing to BT accessory"); + break; + case TMS_AUDIO_OUTPUT_ETTY: + status = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_ETTY); + DisplayText("Routing to TTY"); + break; + default: // ENoPreference + DisplayText("Default Device Routing"); + break; + } + } + if (status != TMS_RESULT_SUCCESS) + { + DisplayText("Routing failed: ", status); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetHandset +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetHandset() + { + gint status(TMS_RESULT_SUCCESS); + + if (iTmsGlobalRouting) + { + status = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_HANDSET); + + if (status != TMS_RESULT_SUCCESS) + { + DisplayText("SetHandSet failed: ", status); + } + else + { + DisplayText("SetHandSet"); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::SetLoudSpeaker +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::SetLoudSpeaker() + { + gint status(TMS_RESULT_SUCCESS); + + if (iTmsGlobalRouting) + { + status = iTmsGlobalRouting->SetOutput(TMS_AUDIO_OUTPUT_LOUDSPEAKER); + + if (status != TMS_RESULT_SUCCESS) + { + DisplayText("SetLoudSpeaker failed: ", status); + } + else + { + DisplayText("SetLoudSpeaker"); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetAudioDevice +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetAudioDevice() + { + TMSAudioOutput device; + + if (iTmsGlobalRouting) + { + iTmsGlobalRouting->GetOutput(device); +#ifdef __TEST_CODE_COVERAGE__ + TMSAudioOutput prevdevice; + iTmsGlobalRouting->GetPreviousOutput(prevdevice); +#endif //__TEST_CODE_COVERAGE__ + + switch (device) + { + case TMS_AUDIO_OUTPUT_NONE: + DisplayText("Routing none"); + break; + case TMS_AUDIO_OUTPUT_PUBLIC: + DisplayText("Routing public"); + break; + case TMS_AUDIO_OUTPUT_PRIVATE: + DisplayText("Routing private"); + break; + case TMS_AUDIO_OUTPUT_HANDSET: + DisplayText("Routing to handset"); + break; + case TMS_AUDIO_OUTPUT_LOUDSPEAKER: + DisplayText("Routing to Loudspeaker"); + break; + case TMS_AUDIO_OUTPUT_WIRED_ACCESSORY: + DisplayText("Routing to Wired accessory"); + break; + case TMS_AUDIO_OUTPUT_ACCESSORY: + DisplayText("Routing to BT accessory"); + break; + case TMS_AUDIO_OUTPUT_ETTY: + DisplayText("Routing to TTY"); + break; + default: // ENoPreference + DisplayText("Default Device Routing"); + break; + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::GetAvailableOutput +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::GetAvailableOutput() + { + TInt status(TMS_RESULT_SUCCESS); + + if (iTmsGlobalRouting) + { + status = iTmsGlobalRouting->GetAvailableOutputs(iAvailableoutputs); + + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("Available outputs: ", iAvailableoutputs.size()); + std::vector::iterator outputs = iAvailableoutputs.begin(); + for (; outputs < iAvailableoutputs.end(); outputs++) + { + DisplayDevice(*outputs); + } + } + else + { + DisplayText("Available output error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::DisplayDevice +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::DisplayDevice(TMSAudioOutput device) + { + switch (device) + { + case TMS_AUDIO_OUTPUT_NONE: + DisplayText("none"); + break; + case TMS_AUDIO_OUTPUT_PUBLIC: + DisplayText("Public"); + break; + case TMS_AUDIO_OUTPUT_PRIVATE: + DisplayText("Private"); + break; + case TMS_AUDIO_OUTPUT_HANDSET: + DisplayText("Handset"); + break; + case TMS_AUDIO_OUTPUT_LOUDSPEAKER: + DisplayText("Loudspeaker"); + break; + case TMS_AUDIO_OUTPUT_WIRED_ACCESSORY: + DisplayText("Wired accessory"); + break; + case TMS_AUDIO_OUTPUT_ACCESSORY: + DisplayText("Accessory"); + break; + case TMS_AUDIO_OUTPUT_ETTY: + DisplayText("TTY"); + break; + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::InitDTMFTonePlayerDnlink +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::InitDTMFTonePlayerDnlink() + { + gint status(TMS_RESULT_SUCCESS); + if (iFactory) + { + status = iFactory->CreateDTMF(TMS_STREAM_DOWNLINK, iDTMFTonePlayerDn); + } + if (iDTMFTonePlayerDn && status == TMS_RESULT_SUCCESS) + { + // Note: It is sufficient to register only 1 DTMF observer per client. + // Since callbacks from UPL and DNL DTMF players are handled by the + // same client, and callback mechanism doesn't distinguish between + // UPL and DNL DTMF event, registering same client twice will result + // in duplicated callbacks. + if (iHasDTMFObserver == 0) + { + status = iDTMFTonePlayerDn->AddObserver(*this, NULL); + iHasDTMFObserver++; + } + } + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("DTMF Downlink OK"); + } + else + { + DisplayText("DTMF Downlink failed:", status); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::InitDTMFTonePlayerUplink +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::InitDTMFTonePlayerUplink() + { + gint status(TMS_RESULT_SUCCESS); + if (iFactory) + { + status = iFactory->CreateDTMF(TMS_STREAM_UPLINK, iDTMFTonePlayerUp); + } + if (iDTMFTonePlayerUp && status == TMS_RESULT_SUCCESS) + { + // Note: It is sufficient to register only 1 DTMF observer per client. + // Since callbacks from UPL and DNL DTMF players are handled by the + // same client, and callback mechanism doesn't distinguish between + // UPL and DNL DTMF event, registering same client twice will result + // in duplicated callbacks. + if (iHasDTMFObserver == 0) + { + status = iDTMFTonePlayerUp->AddObserver(*this, NULL); + iHasDTMFObserver++; + } + } + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("DTMF Uplink OK"); + } + else + { + DisplayText("DTMF Uplink failed: ", status); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::DTMFTonePlayDnlink +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::DTMFTonePlayDnlink() + { + GString* dtmfstring; + gint status(TMS_RESULT_SUCCESS); + if (iDTMFTonePlayerDn) + { + dtmfstring = g_string_new("4723"); + status = iDTMFTonePlayerDn->SetTone(dtmfstring); + if (status == TMS_RESULT_SUCCESS) + { + status = iDTMFTonePlayerDn->Start(); + if (status != TMS_RESULT_SUCCESS) + { + DisplayText("DTMF downlink start failed: ", status); + } + } + else + { + DisplayText("DTMF downlink settone failed: ", status); + } + g_string_free(dtmfstring, TRUE); + } + else + { + DisplayText("Downlink not ready"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::DTMFTonePlayUplink +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::DTMFTonePlayUplink() + { + GString* dtmfstring; + gint status(TMS_RESULT_SUCCESS); + // Note: uplink must be in the streaming state (disable for testing) + if (iDTMFTonePlayerUp && iUpLinkStatus == EStreaming) + { + dtmfstring = g_string_new("4567890*#123"); + //dtmfstring = g_string_append_c(dtmfstring, '4'); + status = iDTMFTonePlayerUp->SetTone(dtmfstring); + if (status == TMS_RESULT_SUCCESS) + { +#ifdef __TEST_CODE_COVERAGE__ + // CS call only + iDTMFTonePlayerUp->ContinueDTMFStringSending(TRUE); +#endif //__TEST_CODE_COVERAGE__ + + status = iDTMFTonePlayerUp->Start(); + + if (status != TMS_RESULT_SUCCESS) + { + DisplayText("DTMF uplink start failed: ", status); + } + } + else + { + DisplayText("DTMF uplink settone failed: ", status); + } + g_string_free(dtmfstring, TRUE); + } + else + { + DisplayText("Uplink not ready"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::CloseDTMFPlayerDnlink +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::CloseDTMFPlayerDnlink() + { + if (iFactory && iDTMFTonePlayerDn) + { + iDTMFTonePlayerDn->Stop(); + iDTMFTonePlayerDn->RemoveObserver(*this); + iHasDTMFObserver--; + iFactory->DeleteDTMF(iDTMFTonePlayerDn); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::CloseDTMFPlayerUplink +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::CloseDTMFPlayerUplink() + { + if (iFactory && iDTMFTonePlayerUp) + { + iDTMFTonePlayerUp->Stop(); + iDTMFTonePlayerUp->RemoveObserver(*this); + iHasDTMFObserver--; + iFactory->DeleteDTMF(iDTMFTonePlayerUp); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::InitRingTonePlayerFromProfiles +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::InitRingTonePlayerFromProfiles() + { + if (iTmsRingTonePlayer) + { + gint status = iTmsRingTonePlayer->Init(TMS_RINGTONE_DEFAULT); + DisplayText("RT Init Profile: ", status); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::InitRingTonePlayerFromFile +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::InitRingTonePlayerFromFile() + { + if (iTmsRingTonePlayer) + { + TBuf buf(KTestFile1); + iRTStr = g_string_new_len((gchar*) buf.Ptr(), buf.Length() * 2); + gint status = iTmsRingTonePlayer->Init(TMS_RINGTONE_FILE, iRTStr); + DisplayText("RT Init File: ", status); + g_string_free(iRTStr, TRUE); + iRTStr = NULL; + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::InitRingToneVideoPlayer +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::InitRingToneVideoPlayer() + { + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::InitRingToneSequencePlayer +// Creates sequence player to play custom sequence in descriptor format +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::InitRingToneSequencePlayer() + { + if (iTmsRingTonePlayer) + { + TBuf8 buf(KRTBeepSequence); + iRTStr = g_string_new_len((gchar*) buf.Ptr(), buf.Length()); + gint status = iTmsRingTonePlayer->Init(TMS_RINGTONE_SEQUENCE, iRTStr); + DisplayText("RT Init Sequence:", status); + g_string_free(iRTStr, TRUE); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::InitRingToneBeepOnce +// Creates sequence player to play single beep +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::InitRingToneBeepOnce() + { + if (iTmsRingTonePlayer) + { + gint status = iTmsRingTonePlayer->Init(TMS_RINGTONE_BEEP_ONCE); + DisplayText("RT Init BeepOnce: ", status); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::InitRingToneSilent +// Creates sequence player to play silent tone +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::InitRingToneSilent() + { + if (iTmsRingTonePlayer) + { + gint status = iTmsRingTonePlayer->Init(TMS_RINGTONE_SILENT); + DisplayText("RT Init Silent: ", status); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::InitRingToneUnsecureVoIP +// Creates sequence player to play tone for unsecured VoIP call. +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::InitRingToneUnsecureVoIP() + { + if (iTmsRingTonePlayer) + { + gint status = iTmsRingTonePlayer->Init(TMS_RINGTONE_UNSECURE_VOIP); + DisplayText("RT Init UnsecVoIP: ", status); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::InitRingToneWithTTS +// Creates sequence player to play default RT with Text-To-Speech +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::InitRingToneWithTTS() + { + if (iTmsRingTonePlayer) + { + TBuf buf(KTextToSpeak); + iTTSStr = g_string_new_len((gchar*) buf.Ptr(), buf.Length() * 2); + gint status = iTmsRingTonePlayer->Init(TMS_RINGTONE_DEFAULT, NULL, + iTTSStr); + DisplayText("RT Init TTS:", status); + g_string_free(iTTSStr, TRUE); + } + iTTSStr = NULL; + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::PlayRingTone +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::PlayRingTone() + { + if (iTmsRingTonePlayer) + { + iTmsRingTonePlayer->Play(); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::StopRingTone +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::StopRingTone() + { + if (iTmsRingTonePlayer) + { + iTmsRingTonePlayer->Stop(); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::MuteRingTone +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::MuteRingTone() + { + if (iTmsRingTonePlayer) + { + iTmsRingTonePlayer->Mute(); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::PauseVideoRingTone +// Pause audio for video RT only +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::PauseVideoRingTone() + { + if (iTmsRingTonePlayer) + { + iTmsRingTonePlayer->Pause(); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::DeinitRingTonePlayer +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::DeinitRingTonePlayer() + { + if (iTmsRingTonePlayer) + { + iTmsRingTonePlayer->Deinit(); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::CloseRingTonePlayer +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::CloseRingTonePlayer() + { + if (iFactory && iTmsRingTonePlayer) + { + DeinitRingTonePlayer(); + iTmsRingTonePlayer->RemoveObserver(*this); + iFactory->DeleteRingTonePlayer(iTmsRingTonePlayer); + DisplayText("RT Player Closed"); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::CreateInbandTonePlayer +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::CreateInbandTonePlayer() + { + gint status(TMS_RESULT_SUCCESS); + if (iFactory && !iInbandTonePlayer) + { + status = iFactory->CreateInbandTonePlayer(iInbandTonePlayer); + if (iInbandTonePlayer && status == TMS_RESULT_SUCCESS) + { + iInbandTonePlayer->AddObserver(*this, NULL); + DisplayText("Inband Tone Player created"); + } + else + { + DisplayText("Inband Tone Player failed: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::StartInbandTone +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::StartInbandTone(TMSInbandToneType inbandtone) + { + gint status(TMS_RESULT_SUCCESS); + CreateInbandTonePlayer(); + if (iFactory && iInbandTonePlayer) + { + status = iInbandTonePlayer->Start(inbandtone); + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("Inband Tone Player Start"); + } + else + { + DisplayText("Inband tone failed: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::StopInbandTone +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::StopInbandTone() + { + gint status(TMS_RESULT_SUCCESS); + if (iFactory && iInbandTonePlayer) + { + status = iInbandTonePlayer->Stop(); + if (status == TMS_RESULT_SUCCESS) + { + DisplayText("Inband Tone Player Stop"); + } + else + { + DisplayText("Inband tone failed: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::OneTouchLoopback +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::OneTouchLoopback() + { + iOneTouchLoopback = ETrue; + + // Change between CS and IP call type for testing. + //SetCallType(TMS_CALL_CS); //will activate streams + SetCallType(TMS_CALL_IP); + + if (iTmsCall->GetCallType() == TMS_CALL_IP) + { +#ifdef __WINSCW__ + SetDownlinkFormat(TMS_FORMAT_PCM); + SetUplinkFormat(TMS_FORMAT_PCM); +#else //__WINSCW__ + SetDownlinkFormat(TMS_FORMAT_AMR); + SetUplinkFormat(TMS_FORMAT_AMR); +#endif //__WINSCW__ + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::DoLoopback +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::DoLoopback() + { + if (iPlayBufReady && iRecBufReady) + { + guint8* srcptr(NULL); + guint8* desptr(NULL); + guint srcsize(0); + guint dessize(0); + + iPlayBuf->GetDataPtr(desptr); + iPlayBuf->GetDataSize(dessize); + iRecBuf->GetDataPtr(srcptr); + iRecBuf->GetDataSize(srcsize); + +#ifdef __WINSCW__ + // This is the case when the size of the play buffer is larger than + // the size of the recorded buffer. In WINS, DirectX views partially + // filled buffers as an EOS and throws (-10). So, we will collect + // multiple buffers here. + Mem::Copy(desptr + iBufIndex, srcptr, srcsize); + iBufIndex += srcsize; + if (iBufIndex >= dessize) + { + iPlayBuf->SetDataSize(dessize); + static_cast (iTmsClientSource)->BufferFilled( + *iPlayBuf); + iPlayBufReady = EFalse; // buf filled, ready for next FillBuffer + iBufIndex = 0; + } +#else //__WINSCW__ + Mem::Copy(desptr, srcptr, srcsize); + iPlayBuf->SetDataSize(srcsize); + static_cast (iTmsClientSource)->BufferFilled( + *iPlayBuf); + iPlayBufReady = EFalse; // buf filled, ready for FillBuffer +#endif //__WINSCW__ + iRecBufReady = EFalse; // buf consumed, ready for next EmptyBuffer + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::EndCall +// +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::EndCall() + { + StopUplink(); + StopDownlink(); + CloseUplink(); + CloseDownlink(); + CloseDTMFPlayerUplink(); + CloseDTMFPlayerDnlink(); + + if (iTmsUplink && iTmsCall) + { + iTmsCall->DeleteStream(iTmsUplink); + } + if (iTmsDnlink && iTmsCall) + { + iTmsCall->DeleteStream(iTmsDnlink); + } + if (iFactory && iTmsCall) + { + iFactory->DeleteCall(iTmsCall); + } + if (iFactory && iTmsClientSource) + { + if (iCallType == TMS_CALL_IP) + { + static_cast (iTmsClientSource)->RemoveObserver( + *this); + } + iFactory->DeleteSource(iTmsClientSource); + } + if (iFactory && iTmsMicSource) + { + iFactory->DeleteSource(iTmsMicSource); + } + if (iFactory && iTmsModemSource) + { + iFactory->DeleteSource(iTmsModemSource); + } + if (iFactory && iTmsClientSink) + { + if (iCallType == TMS_CALL_IP) + { + static_cast (iTmsClientSink)->RemoveObserver(*this); + } + iFactory->DeleteSink(iTmsClientSink); + } + if (iFactory && iTmsSpeakerSink) + { + iFactory->DeleteSink(iTmsSpeakerSink); + } + if (iFactory && iTmsModemSink) + { + iFactory->DeleteSink(iTmsModemSink); + } + if (iFactory && iTmsDnlinkEffect) + { + static_cast (iTmsDnlinkEffect)->RemoveObserver(*this); + iFactory->DeleteEffect(iTmsDnlinkEffect); + } + if (iFactory && iTmsUplinkEffect) + { + static_cast (iTmsUplinkEffect)->RemoveObserver(*this); + iFactory->DeleteEffect(iTmsUplinkEffect); + } + if (iFactory && iEncFormatIntfc) + { + iFactory->DeleteFormat(iEncFormatIntfc); + } + if (iFactory && iDecFormatIntfc) + { + iFactory->DeleteFormat(iDecFormatIntfc); + } + if (iFactory && iDTMFTonePlayerDn) + { + iFactory->DeleteDTMF(iDTMFTonePlayerDn); + } + if (iFactory && iDTMFTonePlayerUp) + { + iFactory->DeleteDTMF(iDTMFTonePlayerUp); + } + } + +#ifdef __RECORD_WAV_TO_FILE__ +void CTmsTestEngine::WriteToFile(const guint8* str, const guint len) + { + TPtrC8 ptr(str, len); + TPtr8 p = iWriteBuf->Des(); + p.Copy(ptr); + iFile.Write(p); + } +#endif //__RECORD_WAV_TO_FILE__ + +// CALLBACKS + +void CTmsTestEngine::TMSStreamEvent(const TMSStream& stream, + TMSSignalEvent event) + { + switch (const_cast (stream).GetStreamType()) + { + case TMS_STREAM_UPLINK: + { + switch (event.type) + { + case TMS_EVENT_STREAM_STATE_CHANGED: + { + switch (event.curr_state) + { + case TMS_STREAM_INITIALIZED: + { +#ifdef __PROFILING_ENABLED__ + TAG_CALLBACK_TIME_PROFILING_END; + PRINT_CALLBACK_TIME_LATENCY; +#endif //__PROFILING_ENABLED__ + iUpLinkStatus = EReady; + DisplayText("Uplink initialized "); + if (iOneTouchLoopback) + { + StartUplink(); + } + break; + } + case TMS_STREAM_UNINITIALIZED: + iTmsUplink->RemoveObserver(*this); + DisplayText("Uplink uninitialized"); + break; + case TMS_STREAM_PAUSED: + DisplayText("Uplink paused"); + break; + case TMS_STREAM_STARTED: + DisplayText("Uplink started"); + break; + default: + break; + } + break; + } + case TMS_EVENT_STREAM_STATE_CHANGE_ERROR: + DisplayText("Uplink Error ", event.reason); + break; + default: + break; + } + break; + } + case TMS_STREAM_DOWNLINK: + { + switch (event.type) + { + case TMS_EVENT_STREAM_STATE_CHANGED: + { + switch (event.curr_state) + { + case TMS_STREAM_INITIALIZED: + { +#ifdef __PROFILING_ENABLED__ + TAG_CALLBACK_TIME_PROFILING_END; + PRINT_CALLBACK_TIME_LATENCY; + TAG_CALLBACK_TIME_PROFILING_START; +#endif //__PROFILING_ENABLED__ + GetMaxVolume(); + SetVolume(iMaxVolume / 2); + iDnLinkStatus = EReady; + DisplayText("Downlink initialized"); + if (iOneTouchLoopback) + { +#ifndef __WINSCW__ + // No audio mixing in WINS - do not start + StartDownlink(); +#endif //__WINSCW__ + } + break; + } + case TMS_STREAM_UNINITIALIZED: + iTmsDnlink->RemoveObserver(*this); + DisplayText("Downlink uninitialized"); + break; + case TMS_STREAM_PAUSED: + DisplayText("Downlink paused"); + break; + case TMS_STREAM_STARTED: + DisplayText("Downlink started"); + break; + default: + break; + } + break; + } + case TMS_EVENT_STREAM_STATE_CHANGE_ERROR: + DisplayText("Downlink Error ", event.reason); + break; + default: + break; + } + break; + } + default: + break; + } + } + +//From TMSClientSourceObserver +void CTmsTestEngine::FillBuffer(TMSBuffer& buffer) + { + iPlayBufReady = ETrue; + iPlayBuf = &buffer; + +#ifdef __PLAY_WAV_FROM_FILE__ + guint8* gptr(NULL); + iPlayBuf->GetDataPtr(gptr); + guint gsize; + iPlayBuf->GetDataSize(gsize); + if (!iBuf) + { + iBuf = HBufC8::NewL(gsize); + } + TPtr8 p = iBuf->Des(); + + if ((iReadPos + gsize) > iFileLen) + { + gsize = iFileLen - iReadPos; + iEOF = ETrue; + } + + iFile.Read(iReadPos, p, gsize); + // DEBPRN1(_L("CVoIPTestEngine[0x%x]::FillBuffer [%d]"), iReadPos); + + if (!iEOF) + { + iReadPos += gsize; + } + else + { + // start over from the beginning + iReadPos = 0; + iEOF = EFalse; + } + + Mem::Copy(gptr, (TUint8*) iBuf->Ptr(), iBuf->Size()); + iPlayBuf->SetDataSize(iBuf->Size()); + static_cast (iTmsClientSource)->BufferFilled(*iPlayBuf); + User::After(TTimeIntervalMicroSeconds32(100000)); //clears choppy audio + + iPlayBufReady = EFalse; // buf filled, ready for FillBuffer + iRecBufReady = EFalse; // buf consumed, ready for EmptyBuffer + +#else //__PLAY_WAV_FROM_FILE__ + if (iDnLinkStatus == EStreaming) + { + DoLoopback(); + } +#endif //__PLAY_WAV_FROM_FILE__ + } + +//From TMSClientSourceObserver +void CTmsTestEngine::BufferProcessed(const TMSBuffer* /*buffer*/, + gint /*reason*/) + { + } + +// From TMSClientSinkObserver +void CTmsTestEngine::ProcessBuffer(const TMSBuffer* buffer) + { + iRecBufReady = ETrue; + iRecBuf = const_cast (buffer); + + if (iUpLinkStatus == EStreaming) + { + // Process recorded buffer here. + +#ifdef __RECORD_WAV_TO_FILE__ + guint8* p(NULL); + guint len(0); + iRecBuf->GetDataPtr(p); + iRecBuf->GetDataSize(len); + WriteToFile(p, len); +#endif //__RECORD_WAV_TO_FILE__ + + DoLoopback(); + static_cast (iTmsClientSink)->BufferProcessed(iRecBuf); + } + } + +// From TMSEffectObserver +void CTmsTestEngine::EffectsEvent(const TMSEffect& tmseffect, + TMSSignalEvent event) + { + gint reason = event.reason; + + if (reason == TMS_RESULT_SUCCESS) + { + TMSEffectType effecttype; + const_cast (tmseffect).GetType(effecttype); + switch (effecttype) + { + case TMS_EFFECT_GLOBAL_VOL: + { + switch (event.type) + { + case TMS_EVENT_EFFECT_VOL_CHANGED: + DisplayText("Global vol effect change"); + TMSVolumeEventChangeData* vd; + vd = static_cast + (event.event_data); + DisplayText("Volume level: ", vd->level); + DisplayText("Output device: ", vd->output); + break; + default: + break; + } + } + break; + case TMS_EFFECT_GLOBAL_GAIN: + { + switch (event.type) + { + case TMS_EVENT_EFFECT_GAIN_CHANGED: + DisplayText("Global gain effect change"); + break; + default: + break; + } + } + break; + case TMS_EFFECT_VOLUME: + { + switch (event.type) + { + case TMS_EVENT_EFFECT_VOL_CHANGED: + DisplayText("Stream vol effect change"); + break; + default: + break; + } + } + break; + case TMS_EFFECT_GAIN: + { + switch (event.type) + { + case TMS_EVENT_EFFECT_GAIN_CHANGED: + DisplayText("Stream gain effect change"); + break; + default: + break; + } + } + break; + default: + break; + } + } + else + { + DisplayText("Effect failed: ", reason); + } + } + +// From TMSGlobalRoutingObserver +void CTmsTestEngine::GlobalRoutingEvent(const TMSGlobalRouting& /*routing*/, + TMSSignalEvent event, TMSAudioOutput output) + { + gint reason = event.reason; + + if (reason == TMS_RESULT_SUCCESS) + { + switch (event.type) + { + case TMS_EVENT_ROUTING_AVAIL_OUTPUTS_CHANGED: + DisplayText("Available outputs changed"); + break; + case TMS_EVENT_ROUTING_OUTPUT_CHANGED: + DisplayText("output changed"); + break; + case TMS_EVENT_ROUTING_SET_OUTPUT_COMPLETE: + DisplayText("set output complete"); + break; + default: + break; + } + DisplayDevice(output); + } + else + { + DisplayText("Routing failed", reason); + } + } + +// From TMSRingToneObserver +void CTmsTestEngine::RingtoneEvent(const TMSRingTone& /*rt*/, + TMSSignalEvent event) + { + gint reason = event.reason; + + if (reason == TMS_RESULT_SUCCESS) + { + switch (event.type) + { + case TMS_EVENT_RINGTONE_OPEN_COMPLETE: + DisplayText("RT Open Complete"); + break; + case TMS_EVENT_RINGTONE_PLAY_COMPLETE: + DisplayText("RT Play Complete"); + break; + case TMS_EVENT_RINGTONE_DEINIT_COMPLETE: + DisplayText("RT Deinit Complete"); + break; + default: + break; + } + } + else + { + DisplayText("Ringtone failed", reason); + } + } + +// From TMSDTMFObserver +void CTmsTestEngine::DTMFEvent(const TMSDTMF& /*dtmf*/, TMSSignalEvent event) + { + gint reason = event.reason; + + if (reason == TMS_RESULT_SUCCESS) + { + switch (event.type) + { + case TMS_EVENT_DTMF_TONE_STARTED: + DisplayText("DTMF Started"); + break; + case TMS_EVENT_DTMF_TONE_STOPPED: + DisplayText("DTMF Stopped"); + break; + default: + break; + } + } + else + { + DisplayText("DTMF failed", reason); + } + } + +// From TMSInbandToneObserver +void CTmsTestEngine::InbandToneEvent(const TMSInbandTone& /*inbandtone*/, + TMSSignalEvent event) + { + gint reason = event.reason; + + if (reason != TMS_RESULT_SUCCESS) + { + switch (event.type) + { + case TMS_EVENT_INBAND_TONE_STARTED: + DisplayText("Inband Tone Started"); + break; + case TMS_EVENT_INBAND_TONE_STOPPED: + DisplayText("Inband Tone Stopped"); + break; + default: + break; + } + } + else + { + DisplayText("Inband tone failed", reason); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::DisplayText +// Print text with status code. +// ---------------------------------------------------------------------------- +// +void CTmsTestEngine::DisplayText(const QString& str, const gint num) + { + if (num != 0) + { + iStatusDisplay->append(str + " " + QString::number(num)); + } + else + { + iStatusDisplay->append(str); + } + } + +// End of file diff -r 3b098142db83 -r 92dbd2a406d9 qtms/tsrc/qttmstestapp/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtms/tsrc/qttmstestapp/src/main.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -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: Telephony Multimedia Service - TestApp + * + */ + +#include +#include +#include "qttmstestapp.h" + +int main(int argc, char *argv[]) + { + QApplication app(argc, argv); + QApplication::setOrganizationName("Nokia"); + QApplication::setOrganizationDomain("nokia.com"); + QApplication::setApplicationName("QTTMStestapp"); + + TmsTestApp tmsapp; + tmsapp.showMaximized(); + tmsapp.show(); + return app.exec(); + } diff -r 3b098142db83 -r 92dbd2a406d9 qtms/tsrc/qttmstestapp/src/qtmstestengine.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtms/tsrc/qttmstestapp/src/qtmstestengine.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,3352 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Telephony Multimedia Service - TestApp + * + */ + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "qtmstestengine.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 + +//#define __PROFILING_ENABLED__ + +#ifdef __PROFILING_ENABLED__ +#include "perfutility.h" +#endif //__PROFILING_ENABLED__ + +//#define __TEST_CODE_COVERAGE__ + +// CONSTANTS +_LIT8(KRTBeepSequence, "\x00\x11\x0A\x0A\x08\x73\x0A\x40\x28\x0A\xF7\ +\x05\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B"); +_LIT16(KTextToSpeak, "THE PHONE IS RINGING"); +_LIT16(KTestFile1, "C:\\Data\\Sounds\\Digital\\NokiaTest.aac"); + +#ifdef __RECORD_WAV_TO_FILE__ +_LIT(KFileName, "c:\\data\\tmsrec.amr"); +const TUint KFileBufLen = 4096; +const TInt KAMRNBHeaderLen = 6; +const TUint8 KAMRNBHeader[KAMRNBHeaderLen] = {0x23,0x21,0x41,0x4d,0x52,0x0a}; +#endif + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::QTmsTestEngine() +// constructor +// ---------------------------------------------------------------------------- +// +QTmsTestEngine::QTmsTestEngine() + { + // Disable GLib slice allocators; will take care of memory leaks + // caused by g_string_free(). + g_setenv("G_SLICE", "always-malloc", 1); + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::~QTmsTestEngine +// destructor +// ---------------------------------------------------------------------------- +// +QTmsTestEngine::~QTmsTestEngine() + { + EndCall(); + CloseRingTonePlayer(); + + if (iFactory && iGlobalVol) + { + iFactory->DeleteEffect(iGlobalVol); + } + if (iFactory && iGlobalGain) + { + iFactory->DeleteEffect(iGlobalGain); + } + if (iFactory && iTmsGlobalRouting) + { + iFactory->DeleteGlobalRouting(iTmsGlobalRouting); + } + if (iFactory && iInbandTonePlayer) + { + iFactory->DeleteInbandTonePlayer(iInbandTonePlayer); + } + + delete iFactory; + +#ifdef __PLAY_WAV_FROM_FILE__ + iFile.Close(); + iFs.Close(); + delete iBuf; +#endif +#ifdef __RECORD_WAV_TO_FILE__ + iFile.Close(); + iFs.Close(); + delete iWriteBuf; +#endif + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::NewL +// Symbian constructor. +// ---------------------------------------------------------------------------- +// +QTmsTestEngine* QTmsTestEngine::NewL(QTextEdit* statusDisplay) + { + QTmsTestEngine* self(NULL); + self = QTmsTestEngine::NewLC(statusDisplay); + return self; + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::NewL +// Symbian constructor with self pointer pushed into the cleanup stack. +// ---------------------------------------------------------------------------- +// +QTmsTestEngine* QTmsTestEngine::NewLC(QTextEdit* statusDisplay) + { + QTmsTestEngine* self = new (ELeave) QTmsTestEngine; + //CleanupStack::PushL(self); + self->ConstructL(statusDisplay); + return self; + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::NewL +// Standard Symbian 2nd phase constructor +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::ConstructL(QTextEdit* statusDisplay) + { + DEBPRN0(_L("QTmsTestEngine[0x%x]::ConstructL :>")); + iStatusDisplay = statusDisplay; + +#ifdef __PLAY_WAV_FROM_FILE__ + iReadSize = KFileBufLen; + TInt err = iFs.Connect(); + if (err == QTMS_RESULT_SUCCESS) + { + err = iFile.Open(iFs, KTestFile1, EFileShareAny | EFileRead); + } + if (err == QTMS_RESULT_SUCCESS) + { + iFile.Size(iFileLen); + } + iBuf = HBufC8::NewL(iReadSize); +#endif + +#ifdef __RECORD_WAV_TO_FILE__ + TInt err = iFs.Connect(); + if (err == TMS_RESULT_SUCCESS) + { + err = iFile.Replace(iFs, KFileName, EFileWrite); +#ifndef __WINSCW__ + if (err == KErrNone) + { + // Prefix file with AMR-NB header + TBuf8 buf; + buf.Append(KAMRNBHeader, 6); + iFile.Write(buf, KAMRNBHeaderLen); + } +#endif //__WINSCW__ + } + iWriteLen = KFileBufLen; + iWriteBuf = HBufC8::NewL(iWriteLen); +#endif //__RECORD_WAV_TO_FILE__ + + CreateFactory(); + CreateGlobalRouting(); + CreateGlobalVol(); + CreateGlobalGain(); + CreateRingTonePlayer(); + + DEBPRN0(_L("QTmsTestEngine[0x%x]::ConstructL :<")); + } + +gint QTmsTestEngine::CreateFactory() + { + gint status(QTMS_RESULT_SUCCESS); + QTMSVer v(10,0,0); + status = QTMSFactory::CreateFactory(iFactory, v); + + if (status != QTMS_RESULT_SUCCESS || !iFactory) + { + DisplayText("QTms create factory failed: ", status); + } + else + { +#ifdef __TEST_CODE_COVERAGE__ + QTMSBuffer* qtmsbuffer(NULL); + QTMSBufferType buftype(QTMS_BUFFER_MEMORY); + guint size(100); + iFactory->CreateBuffer(QTMS_BUFFER_MEMORY, size, qtmsbuffer); + if (qtmsbuffer) + { + qtmsbuffer->GetType(buftype); + qtmsbuffer->GetDataSize(size); + qtmsbuffer->SetDataSize(size); + guint8* pbuf(NULL); + qtmsbuffer->GetDataPtr(pbuf); + guint64 ts(0); + qtmsbuffer->GetTimeStamp(ts); + qtmsbuffer->SetTimeStamp(ts); + iFactory->DeleteBuffer(qtmsbuffer); + } +#endif //__TEST_CODE_COVERAGE__ + + DisplayText("Tms factory created"); + } + return status; + } + +gint QTmsTestEngine::CreateCall(QTMSCallType calltype) + { + gint status(QTMS_RESULT_SUCCESS); + if (iFactory && !iTmsCall) + { + status = iFactory->CreateCall(calltype, iTmsCall, 0); + if (status == QTMS_RESULT_SUCCESS) + { +#ifdef __TEST_CODE_COVERAGE__ + guint ctxid; + iTmsCall->GetCallContextId(ctxid); +#endif //__TEST_CODE_COVERAGE__ + DisplayText("Tms call created"); + } + else + { + DisplayText("Tms call create failed: ", status); + } + } + return status; + } + +gint QTmsTestEngine::CreateUplink() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iTmsCall) + { + status = iTmsCall->CreateStream(QTMS_STREAM_UPLINK, iTmsUplink); + if (status == QTMS_RESULT_SUCCESS) + { +#ifdef __TEST_CODE_COVERAGE__ + guint ctxid; + iTmsCall->GetCallContextId(ctxid); +#endif //__TEST_CODE_COVERAGE__ + DisplayText("Connected to uplink signal"); + connect(iTmsUplink, + SIGNAL(TMSStreamEvent(const QTMSStream&, QTMSSignalEvent)), + this, + SLOT(TMSStreamEvent(const QTMSStream&, QTMSSignalEvent))); + } + else + { + DisplayText("TMS uplink failed: ", status); + } + } + return status; + } + +gint QTmsTestEngine::CreateDownlink() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iTmsCall) + { + status = iTmsCall->CreateStream(QTMS_STREAM_DOWNLINK, iTmsDnlink); + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("Connected to downlink signal"); + connect(iTmsDnlink, + SIGNAL(TMSStreamEvent(const QTMSStream&, QTMSSignalEvent)), + this, + SLOT(TMSStreamEvent(const QTMSStream&, QTMSSignalEvent))); + } + else + { + DisplayText("TMS downlink failed: ", status); + } + } + return status; + } + +gint QTmsTestEngine::CreateClientSource() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory && !iTmsClientSource) + { + status = iFactory->CreateSource(QTMS_SOURCE_CLIENT, iTmsClientSource); + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("TMS clientsource created"); + } + else + { + DisplayText("TMS clientsource failed: ", status); + } + } + return status; + } + +gint QTmsTestEngine::CreateModemSource() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory && !iTmsModemSource) + { + status = iFactory->CreateSource(QTMS_SOURCE_MODEM, iTmsModemSource); + if (status == QTMS_RESULT_SUCCESS) + { +#ifdef __TEST_CODE_COVERAGE__ + QTMSSourceType st; + iTmsModemSource->GetType(st); +#endif //__TEST_CODE_COVERAGE__ + DisplayText("TMS modemsource created"); + } + else + { + DisplayText("TMS modemsource failed: ", status); + } + } + return status; + } + +gint QTmsTestEngine::AddClientSourceToStream() + { + gint status(QTMS_RESULT_SUCCESS); + if (iTmsDnlink && iTmsClientSource) + { + connect(static_cast (iTmsClientSource), + SIGNAL(FillBuffer(QTMSBuffer&)), this, + SLOT(FillBuffer(QTMSBuffer&))); + status = iTmsDnlink->AddSource(iTmsClientSource); + +#ifdef __TEST_CODE_COVERAGE__ + QTMSSourceType st; + static_cast(iTmsClientSource)->GetType(st); + gboolean enqueue(false); + static_cast(iTmsClientSource)->GetEnqueueMode(enqueue); + static_cast(iTmsClientSource)->SetEnqueueMode(FALSE); + static_cast(iTmsClientSource)->Flush(); +#endif //__TEST_CODE_COVERAGE__ + } + return status; + } + +gint QTmsTestEngine::AddModemSourceToStream() + { + gint status(QTMS_RESULT_SUCCESS); + if (iTmsDnlink && iTmsModemSource) + { + status = iTmsDnlink->AddSource(iTmsModemSource); + } + return status; + } + +gint QTmsTestEngine::CreateClientSink() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory && !iTmsClientSink) + { + status = iFactory->CreateSink(QTMS_SINK_CLIENT, iTmsClientSink); + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("TMS client sink created"); + } + else + { + DisplayText("TMS client sink failed: ", status); + } + } + return status; + } + +gint QTmsTestEngine::CreateModemSink() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory && !iTmsModemSink) + { + status = iFactory->CreateSink(QTMS_SINK_MODEM, iTmsModemSink); + if (status == QTMS_RESULT_SUCCESS) + { +#ifdef __TEST_CODE_COVERAGE__ + QTMSSinkType st; + iTmsModemSink->GetType(st); +#endif //__TEST_CODE_COVERAGE__ + DisplayText("TMS modem sink created"); + } + else + { + DisplayText("TMS modem sink failed: ", status); + } + } + return status; + } + +gint QTmsTestEngine::AddClientSinkToStream() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iTmsUplink && iTmsClientSink) + { + connect(static_cast (iTmsClientSink), + SIGNAL(ProcessBuffer(const QTMSBuffer*)), this, + SLOT(ProcessBuffer(const QTMSBuffer*))); + status = iTmsUplink->AddSink(iTmsClientSink); + } + return status; + } + +gint QTmsTestEngine::AddModemSinkToStream() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iTmsUplink && iTmsModemSink) + { + status = iTmsUplink->AddSink(iTmsModemSink); + } + return status; + } + +gint QTmsTestEngine::CreateMicSource() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory && !iTmsMicSource) + { + status = iFactory->CreateSource(QTMS_SOURCE_MIC, iTmsMicSource); + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("TMS mic source created"); + } + else + { + DisplayText("TMS mic source failed: ", status); + } + } + return status; + } + +gint QTmsTestEngine::AddMicSourceToStream() + { + gint status(QTMS_RESULT_SUCCESS); + if (iTmsUplink && iTmsMicSource) + { + status = iTmsUplink->AddSource(iTmsMicSource); + } + return status; + } + +gint QTmsTestEngine::CreateSpeakerSink() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory && !iTmsSpeakerSink) + { + status = iFactory->CreateSink(QTMS_SINK_SPEAKER, iTmsSpeakerSink); + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("TMS speaker sink created"); + } + else + { + DisplayText("TMS speaker sink failed: ", status); + } + } + return status; + } + +gint QTmsTestEngine::AddSpeakerSinkToStream() + { + gint status(QTMS_RESULT_SUCCESS); + if (iTmsDnlink && iTmsSpeakerSink) + { + status = iTmsDnlink->AddSink(iTmsSpeakerSink); + } + return status; + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetCallType +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetCallType(QTMSCallType calltype) + { + gint status(KErrNotFound); + +#ifdef __PROFILING_ENABLED__ + TAG_CALLBACK_TIME_PROFILING_START; +#endif //__PROFILING_ENABLED__ + + if (iFactory) + { + iCallType = calltype; + + if (!iTmsCall) + { + gboolean issupported(FALSE); + iFactory->IsCallTypeSupported(iCallType, issupported); + if (issupported) + { + status = iFactory->CreateCall(iCallType, iTmsCall); + } + else + { + status = KErrNotSupported; + } + } + + iCallType = iTmsCall->GetCallType(); + + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("Tms call created"); + } + else + { + DisplayText("Tms call creation failed: ", status); + } + } + if (status == QTMS_RESULT_SUCCESS) + { + status = CreateUplink(); + } + if (status == QTMS_RESULT_SUCCESS) + { + status = CreateDownlink(); + } + if (iCallType == QTMS_CALL_IP) + { + if (status == QTMS_RESULT_SUCCESS) + { + status = CreateMicSource(); + status |= AddMicSourceToStream(); + status |= CreateClientSink(); + status |= AddClientSinkToStream(); + } + + if (status == QTMS_RESULT_SUCCESS) + { + status |= CreateClientSource(); + status |= AddClientSourceToStream(); + status |= CreateSpeakerSink(); + status |= AddSpeakerSinkToStream(); + } + } + else if (iCallType == QTMS_CALL_CS) + { + if (status == QTMS_RESULT_SUCCESS) + { + status = CreateMicSource(); + status |= AddMicSourceToStream(); + status |= CreateModemSink(); + status |= AddModemSinkToStream(); + } + if (status == QTMS_RESULT_SUCCESS) + { + status = CreateModemSource(); + status |= AddModemSourceToStream(); + status |= CreateSpeakerSink(); + status |= AddSpeakerSinkToStream(); + } + } + + if (status == QTMS_RESULT_SUCCESS) + { + status = CreateVolumeEffect(); + status |= AddVolumeEffectToStream(); + status |= CreateGainEffect(); + status |= AddGainEffectToStream(); + } + + //NOTE: CS does not call SetDownlinkFormat/SetUplinkFormat + //so it is OK to open downlink and uplink at this point. + if (status == QTMS_RESULT_SUCCESS && iCallType == QTMS_CALL_CS) + { + // To avoid asyc calback racing situation, it may be safer to + // start second stream after receiving TMS_STREAM_INITIALIZED event. + // But for now, let's try opening both at the same time. + OpenDownlink(); + OpenUplink(); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetSupportedDownlinkFormats +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetSupportedDownlinkFormats(TBool aDisplayList) + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory) + { + status = iFactory->GetSupportedFormats(QTMS_STREAM_DOWNLINK, + iDnlCodecs); + + if (status != QTMS_RESULT_SUCCESS) + { + DisplayText("DNL Codecs retrieve error: ", status); + } + + if (iDnlCodecs.size() > 0 && aDisplayList) + { + DisplayText("Supported DNL codecs"); + std::vector::iterator itDnlCodecs = + iDnlCodecs.begin(); + QTMSFormatType fmttype; + for (; itDnlCodecs < iDnlCodecs.end(); itDnlCodecs++) + { + (*itDnlCodecs)->GetType(fmttype); + DisplayFormat(fmttype); + } + gint size = iDnlCodecs.size(); + for (gint i = 0; i < size; i++) + { + itDnlCodecs = iDnlCodecs.begin(); + iFactory->DeleteFormat(*itDnlCodecs); + iDnlCodecs.erase(itDnlCodecs); + } + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetSupportedUplinkFormats +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetSupportedUplinkFormats(TBool aDisplayList) + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory) + { + status = iFactory->GetSupportedFormats(QTMS_STREAM_UPLINK, iUplCodecs); + if (status != QTMS_RESULT_SUCCESS) + { + DisplayText("UPL Codecs retrieve error: ", status); + } + + if (iUplCodecs.size() > 0 && aDisplayList) + { + DisplayText("Supported UPL codecs"); + std::vector::iterator codecs = iUplCodecs.begin(); + QTMSFormatType fmttype; + for (; codecs < iUplCodecs.end(); codecs++) + { + (*codecs)->GetType(fmttype); + DisplayFormat(fmttype); + } + gint size = iUplCodecs.size(); + for (gint i = 0; i < size; i++) + { + codecs = iUplCodecs.begin(); + iFactory->DeleteFormat(*codecs); + iUplCodecs.erase(codecs); + } + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::DisplayFormat +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::DisplayFormat(QTMSFormatType aFormat) + { + switch (aFormat) + { + case QTMS_FORMAT_AMR: + DisplayText("AMR-NB"); + break; + case QTMS_FORMAT_G711: + DisplayText("G.711"); + break; + case QTMS_FORMAT_G729: + DisplayText("G.729"); + break; + case QTMS_FORMAT_ILBC: + DisplayText("iLBC"); + break; + case QTMS_FORMAT_PCM: + DisplayText("PCM-16"); + break; + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetDownlinkFormat() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetDownlinkFormat(QTMSFormatType aCodecFormat) + { + gint status(QTMS_RESULT_SUCCESS); + + if (!iTmsCall) + { + SetCallType(QTMS_CALL_IP); + } + if (iFactory && iDecFormatIntfc) + { + iFactory->DeleteFormat(iDecFormatIntfc); + } + + iDnLinkCodec = aCodecFormat; + + if (iFactory && iTmsDnlink) + { + status = iFactory->CreateFormat(iDnLinkCodec, iDecFormatIntfc); + status |= iTmsDnlink->SetFormat(iDecFormatIntfc); + } + +#ifdef __TEST_CODE_COVERAGE__ + TMSFormatType ft; +#endif //__TEST_CODE_COVERAGE__ + + switch (iDnLinkCodec) + { + case QTMS_FORMAT_G711: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iDecFormatIntfc->GetType(ft); + if (ft != QTMS_FORMAT_G711) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("G.711 DNL Codec Set"); + break; + } + case QTMS_FORMAT_G729: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iDecFormatIntfc->GetType(ft); + if (ft != QTMS_FORMAT_G729) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("G.729 DNL Codec Set"); + break; + } + case QTMS_FORMAT_ILBC: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iDecFormatIntfc->GetType(ft); + if (ft != QTMS_FORMAT_ILBC) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("iLBC DNL Codec Set"); + break; + } + case QTMS_FORMAT_AMR: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iDecFormatIntfc->GetType(ft); + if (ft != QTMS_FORMAT_AMR) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("AMR-NB DNL Codec Set"); + break; + } + case QTMS_FORMAT_PCM: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iDecFormatIntfc->GetType(ft); + if (ft != QTMS_FORMAT_PCM) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("PCM-16 DNL Codec Set"); + break; + } + default: + { + status = KErrNotSupported; + } + } + + if (status == QTMS_RESULT_SUCCESS) + { + OpenDownlink(); //Initialize DNL + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::OpenDownlink() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::OpenDownlink() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iTmsDnlink) + { + status = iTmsDnlink->Init(); + if (status != QTMS_RESULT_SUCCESS) + { + DisplayText("DNL init error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::StartDownlink() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::StartDownlink() + { + if (iDnLinkStatus == EReady) + { +#ifdef __TEST_CODE_COVERAGE__ + ConfigureDecoder(); + gint id = iTmsDnlink->GetStreamId(); +#endif //__TEST_CODE_COVERAGE__ + + iTmsDnlink->Start(2); //retry for ~2 sec + iDnLinkStatus = EStreaming; +#ifdef __WINSCW__ + iBufIndex = 0; +#endif //__WINSCW__ + } + else + { + DisplayText("DNL not ready"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::StopDownlink() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::StopDownlink() + { + if (iDnLinkStatus == EStreaming) + { +#ifdef __TEST_CODE_COVERAGE__ + iTmsDnlink->Pause(); + iTmsDnlink->GetState(); +#endif //__TEST_CODE_COVERAGE__ + + iTmsDnlink->Stop(); + iDnLinkStatus = EReady; + iOneTouchLoopback = EFalse; + DisplayText("DNL stopped"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::CloseDownlink() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::CloseDownlink() + { + if (iTmsDnlink && iDnLinkStatus != ENotReady) + { + if (iTmsDnlinkEffect) + { + iTmsDnlink->RemoveEffect(iTmsDnlinkEffect); + } + if (iTmsClientSource) + { + iTmsDnlink->RemoveSource(iTmsClientSource); + } + if (iTmsModemSource) + { + iTmsDnlink->RemoveSource(iTmsModemSource); + } + if (iTmsSpeakerSink) + { + iTmsDnlink->RemoveSink(iTmsSpeakerSink); + } + iTmsDnlink->Deinit(); + iDnLinkStatus = ENotReady; + } + iPlayBufReady = EFalse; + iOneTouchLoopback = EFalse; + } + +gint QTmsTestEngine::CreateVolumeEffect() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory && iTmsDnlink && !iTmsDnlinkEffect) + { + status = iFactory->CreateEffect(QTMS_EFFECT_VOLUME, iTmsDnlinkEffect); + } + return status; + } + +gint QTmsTestEngine::AddVolumeEffectToStream() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iTmsDnlink && iTmsDnlinkEffect) + { + status = iTmsDnlink->AddEffect(iTmsDnlinkEffect); + } + return status; + } + +gint QTmsTestEngine::CreateGainEffect() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory && iTmsUplink && !iTmsUplinkEffect) + { + status = iFactory->CreateEffect(QTMS_EFFECT_GAIN, iTmsUplinkEffect); + } + return status; + } + +gint QTmsTestEngine::CreateGlobalRouting() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory) + { + status = iFactory->CreateGlobalRouting(iTmsGlobalRouting); + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("TMS routing created"); + connect(iTmsGlobalRouting, + SIGNAL(GlobalRoutingEvent(const QTMSGlobalRouting&,QTMSSignalEvent,QTMSAudioOutput)), + this, + SLOT(GlobalRoutingEvent(const QTMSGlobalRouting&,QTMSSignalEvent,QTMSAudioOutput))); + // DisplayText("connected to routing signal"); + } + else + { + DisplayText("Global routing failed: ", status); + } + } + return status; + } + +gint QTmsTestEngine::AddGainEffectToStream() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iTmsUplink && iTmsUplinkEffect) + { + status = iTmsUplink->AddEffect(iTmsUplinkEffect); + } + return status; + } + +gint QTmsTestEngine::CreateRingTonePlayer() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory) + { + status = iFactory->CreateRingTonePlayer(iTmsRingTonePlayer); + + if (iTmsRingTonePlayer && status == QTMS_RESULT_SUCCESS) + { + connect(iTmsRingTonePlayer, + SIGNAL(RingtoneEvent(const QTMSRingTone&,QTMSSignalEvent)), + this, + SLOT(RingtoneEvent(const QTMSRingTone&,QTMSSignalEvent))); + DisplayText("RingTone Player created"); + } + else + { + DisplayText("RT create failed: ", status); + } + } + return status; + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::ConfigureDecoder() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::ConfigureDecoder() + { + // NOTE: These calls can ONLY be made when codec is in a STOPPED state. + + switch (iDnLinkCodec) + { + case QTMS_FORMAT_G711: + { + gboolean cng(TRUE); + static_cast (iDecFormatIntfc)->SetCNG(cng); + static_cast (iDecFormatIntfc)->GetCNG(cng); + gboolean plc(FALSE); + static_cast (iDecFormatIntfc)->SetPlc(plc); + static_cast (iDecFormatIntfc)->GetPlc(plc); + QTMSG711CodecMode mode(QTMS_G711_CODEC_MODE_ALAW); + static_cast (iDecFormatIntfc)->SetMode(mode); + static_cast (iDecFormatIntfc)->GetMode(mode); + break; + } + case QTMS_FORMAT_ILBC: + { + gboolean cng(TRUE); + static_cast (iDecFormatIntfc)->SetCNG(cng); + static_cast (iDecFormatIntfc)->GetCNG(cng); + QTMSILBCCodecMode mode(QTMS_ILBC_CODEC_MODE_20MS_FRAME); + static_cast (iDecFormatIntfc)->SetMode(mode); + static_cast (iDecFormatIntfc)->GetMode(mode); + break; + } + case QTMS_FORMAT_G729: + case QTMS_FORMAT_AMR: + case QTMS_FORMAT_PCM: + default: + { + break; + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetMaxVolume() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetMaxVolume() + { + if (iTmsDnlinkEffect) + { + static_cast (iTmsDnlinkEffect)->GetMaxLevel( + iMaxVolume); + } + DisplayText("Max Volume: ", iMaxVolume); + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetVolume +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetVolume() + { + if (iTmsDnlinkEffect) + { + static_cast (iTmsDnlinkEffect)->GetLevel(iVolume); + } + DisplayText("Volume ", iVolume); + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::MuteSpeaker() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::MuteSpeaker() + { + SetVolume(0); + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetMaxVolume +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetMaxVolume() + { + SetVolume(iMaxVolume); + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetVolume +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetVolume(guint aVolume) + { + iVolume = aVolume; + + if (iTmsDnlinkEffect) + { + static_cast (iTmsDnlinkEffect)->SetLevel(aVolume); + } + else + { + DisplayText("Create Dnlink VolumeEffect first"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::VolumeUp() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::VolumeUp() + { + if ((iDnLinkStatus == EReady || iDnLinkStatus == EStreaming) + && iTmsDnlinkEffect) + { + if (iVolume < iMaxVolume) + { + static_cast (iTmsDnlinkEffect)->SetLevel( + ++iVolume); + } + } + else + { + DisplayText("Create DNL first"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::VolumeDn() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::VolumeDn() + { + if ((iDnLinkStatus == EReady || iDnLinkStatus == EStreaming) + && iTmsDnlinkEffect) + { + if (iVolume > 0) + { + static_cast (iTmsDnlinkEffect)->SetLevel( + --iVolume); + } + } + else + { + DisplayText("Open DNL first"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::OpenUplink() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::OpenUplink() + { + gint status = QTMS_RESULT_SUCCESS; + + if (iTmsUplink) + { + status = iTmsUplink->Init(3); //retry for ~3 sec + if (status != QTMS_RESULT_SUCCESS) + { + DisplayText("UPL init error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::StartUplink() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::StartUplink() + { + if (iUpLinkStatus == EReady) + { +#ifdef __TEST_CODE_COVERAGE__ + ConfigureEncoder(); + ToggleVad(); + GetVad(); + GetSupportedBitrates(); + SelectMaxBitrate(); + GetBitrate(); + gint id = iTmsUplink->GetStreamId(); +#endif //__TEST_CODE_COVERAGE__ + + iTmsUplink->Start(4); //retry for ~4 sec + iUpLinkStatus = EStreaming; + } + else + { + DisplayText("UPL not ready"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::StopUplink() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::StopUplink() + { + if (iUpLinkStatus == EStreaming) + { + iTmsUplink->Stop(); + iUpLinkStatus = EReady; + iOneTouchLoopback = EFalse; + DisplayText("UPL stopped"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::CloseUplink() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::CloseUplink() + { + iRecBufReady = EFalse; + iOneTouchLoopback = EFalse; + + if (iTmsUplink && iUpLinkStatus != ENotReady) + { + if (iTmsUplinkEffect) + { + iTmsUplink->RemoveEffect(iTmsUplinkEffect); + } + if (iTmsMicSource) + { + iTmsUplink->RemoveSource(iTmsMicSource); + } + if (iTmsClientSink) + { + iTmsUplink->RemoveSink(iTmsClientSink); + } + if (iTmsModemSink) + { + iTmsUplink->RemoveSink(iTmsModemSink); + } + iTmsUplink->Deinit(); + iUpLinkStatus = ENotReady; + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetUplinkFormat() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetUplinkFormat(QTMSFormatType aCodecFormat) + { + gint status(QTMS_RESULT_SUCCESS); + + if (!iTmsCall) + { + SetCallType(QTMS_CALL_IP); + } + if (iFactory && iEncFormatIntfc) + { + iFactory->DeleteFormat(iEncFormatIntfc); + } + + iUpLinkCodec = aCodecFormat; + + if (iFactory && iTmsUplink) + { + status = iFactory->CreateFormat(iUpLinkCodec, iEncFormatIntfc); + status |= iTmsUplink->SetFormat(iEncFormatIntfc); + } + +#ifdef __TEST_CODE_COVERAGE__ + TMSFormatType ft; +#endif //__TEST_CODE_COVERAGE__ + + switch (iUpLinkCodec) + { + case QTMS_FORMAT_G711: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iEncFormatIntfc->GetType(ft); + if (ft != QTMS_FORMAT_G711) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("G.711 UPL Codec Set"); + break; + } + case QTMS_FORMAT_G729: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iEncFormatIntfc->GetType(ft); + if (ft != QTMS_FORMAT_G729) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("G.729 UPL Codec Set"); + break; + } + case QTMS_FORMAT_ILBC: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iEncFormatIntfc->GetType(ft); + if (ft != QTMS_FORMAT_ILBC) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("iLBC UPL Codec Set"); + break; + } + case QTMS_FORMAT_AMR: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iEncFormatIntfc->GetType(ft); + if (ft != QTMS_FORMAT_AMR) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("AMR-NB UPL Codec Set"); + break; + } + case QTMS_FORMAT_PCM: + { +#ifdef __TEST_CODE_COVERAGE__ + status = iEncFormatIntfc->GetType(ft); + if (ft != QTMS_FORMAT_PCM) + { + status = KErrArgument; + } +#endif //__TEST_CODE_COVERAGE__ + DisplayText("PCM-16 UPL Codec Set"); + break; + } + default: + { + status = KErrNotSupported; + } + } + + if (status == QTMS_RESULT_SUCCESS) + { + OpenUplink(); //Initialize UPL + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::ConfigureEncoder() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::ConfigureEncoder() + { + // Any of these calls can ONLY be made when encoder is in a STOPPED state. + + switch (iUpLinkCodec) + { + case QTMS_FORMAT_G711: + { + QTMSG711CodecMode mode(QTMS_G711_CODEC_MODE_ALAW); + static_cast (iEncFormatIntfc)->SetMode(mode); + static_cast (iEncFormatIntfc)->GetMode(mode); + break; + } + case QTMS_FORMAT_ILBC: + { + QTMSILBCCodecMode mode(QTMS_ILBC_CODEC_MODE_20MS_FRAME); + static_cast (iEncFormatIntfc)->SetMode(mode); + static_cast (iEncFormatIntfc)->GetMode(mode); + break; + } + case QTMS_FORMAT_G729: + case QTMS_FORMAT_AMR: + case QTMS_FORMAT_PCM: + default: + { + break; + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetMaxGain() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetMaxGain() + { + if (iTmsUplinkEffect) + { + static_cast (iTmsUplinkEffect)->GetMaxLevel(iMaxGain); + DisplayText("MaxGain: ", iMaxGain); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetGain() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetGain() + { + guint gain; + if (iTmsUplinkEffect) + { + static_cast (iTmsUplinkEffect)->GetLevel(gain); + DisplayText("Gain: ", gain); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetMaxGain() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetMaxGain() + { + static_cast (iTmsUplinkEffect)->SetLevel(iMaxGain); + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::MuteMic() +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::MuteMic() + { + static_cast (iTmsUplinkEffect)->SetLevel(0); + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetSupportedBitrates +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetSupportedBitrates() + { + TInt status = GetSupportedBitrates(iBitratesVector); + + if (status == QTMS_RESULT_SUCCESS) + { + std::vector::iterator itBitrates = iBitratesVector.begin(); + for (; itBitrates < iBitratesVector.end(); itBitrates++) + { + DisplayText("BR ", *itBitrates); + } + } + else + { + DisplayText("BR Error: ", status); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetSupportedBitrates +// +// ---------------------------------------------------------------------------- +// +gint QTmsTestEngine::GetSupportedBitrates(BitRateVector& aBrArr) + { + gint status = KErrNotFound; + + switch (iUpLinkCodec) + { + case QTMS_FORMAT_G711: + status = static_cast + (iEncFormatIntfc)->GetSupportedBitRates(aBrArr); + break; + case QTMS_FORMAT_G729: + status = static_cast + (iEncFormatIntfc)->GetSupportedBitRates(aBrArr); + break; + case QTMS_FORMAT_ILBC: + status = static_cast + (iEncFormatIntfc)->GetSupportedBitRates(aBrArr); + break; + case QTMS_FORMAT_AMR: + status = static_cast + (iEncFormatIntfc)->GetSupportedBitRates(aBrArr); + break; + case QTMS_FORMAT_PCM: + default: + status = KErrNotSupported; + break; + } + return status; + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SelectMinBitrate +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SelectMinBitrate() + { + if (iBitratesVector.size() > 0) + { + std::vector::iterator bitrate = iBitratesVector.begin(); + iBitrate = *bitrate; + SetBitrate(iBitrate); + DisplayText("BR set: ", iBitrate); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SelectMaxBitrate +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SelectMaxBitrate() + { + if (iBitratesVector.size() > 0) + { + iBitrate = iBitratesVector.back(); + SetBitrate(iBitrate); + DisplayText("BR set: ", iBitrate); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetBitrate +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetBitrate(TUint aBitrate) + { + switch (iUpLinkCodec) + { + case QTMS_FORMAT_G711: + static_cast (iEncFormatIntfc)->SetBitRate( + aBitrate); + DisplayText("Set BR: ", iBitrate); + break; + case QTMS_FORMAT_G729: + static_cast (iEncFormatIntfc)->SetBitRate( + aBitrate); + DisplayText("Set BR: ", iBitrate); + break; + case QTMS_FORMAT_ILBC: + static_cast (iEncFormatIntfc)->SetBitRate( + aBitrate); + DisplayText("Set BR: ", iBitrate); + break; + case QTMS_FORMAT_AMR: + static_cast (iEncFormatIntfc)->SetBitRate( + aBitrate); + DisplayText("Set BR: ", iBitrate); + break; + case QTMS_FORMAT_PCM: + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetBitrate +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetBitrate() + { + if (iUpLinkCodec != QTMS_FORMAT_PCM) + { + GetBitrate(iBitrate); + DisplayText("Current BR: ", iBitrate); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetBitrate +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetBitrate(TUint& aBitrate) + { + switch (iUpLinkCodec) + { + case QTMS_FORMAT_G711: + static_cast (iEncFormatIntfc)->GetBitRate( + aBitrate); + break; + case QTMS_FORMAT_G729: + static_cast (iEncFormatIntfc)->GetBitRate( + aBitrate); + break; + case QTMS_FORMAT_ILBC: + static_cast (iEncFormatIntfc)->GetBitRate( + aBitrate); + break; + case QTMS_FORMAT_AMR: + static_cast (iEncFormatIntfc)->GetBitRate( + aBitrate); + break; + case QTMS_FORMAT_PCM: + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::ToggleVad +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::ToggleVad() + { + iVad = (iVad) ? EFalse : ETrue; + + switch (iUpLinkCodec) + { + case QTMS_FORMAT_G711: + static_cast (iEncFormatIntfc)->SetVADMode(iVad); + DisplayText("Set VAD: ", iVad); + break; + case QTMS_FORMAT_G729: + static_cast (iEncFormatIntfc)->SetVADMode(iVad); + DisplayText("Set VAD: ", iVad); + break; + case QTMS_FORMAT_ILBC: + static_cast (iEncFormatIntfc)->SetVADMode(iVad); + DisplayText("Set VAD: ", iVad); + break; + case QTMS_FORMAT_AMR: + //static_cast (iEncFormatIntfc)->SetVADMode(iVad); + //DisplayText("Set VAD: ", iVad); + break; + case QTMS_FORMAT_PCM: + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetVad +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetVad() + { + switch (iUpLinkCodec) + { + case QTMS_FORMAT_G711: + static_cast (iEncFormatIntfc)->GetVADMode(iVad); + DisplayText("Current VAD: ", iVad); + break; + case QTMS_FORMAT_G729: + static_cast (iEncFormatIntfc)->GetVADMode(iVad); + DisplayText("Current VAD: ", iVad); + break; + case QTMS_FORMAT_ILBC: + static_cast (iEncFormatIntfc)->GetVADMode(iVad); + DisplayText("Current VAD: ", iVad); + break; + case QTMS_FORMAT_AMR: + //static_cast (iEncFormatIntfc)->GetVADMode(iVad); + //DisplayText("Current VAD: ", iVad); + break; + case QTMS_FORMAT_PCM: + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::ToggleCng +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::ToggleCng() + { + iCng = (iCng) ? EFalse : ETrue; + + switch (iDnLinkCodec) + { + case QTMS_FORMAT_G711: + static_cast (iDecFormatIntfc)->SetCNG(iCng); + DisplayText("Set CNG ", iCng); + break; + case QTMS_FORMAT_ILBC: + static_cast (iDecFormatIntfc)->SetCNG(iCng); + DisplayText("Set CNG ", iCng); + break; + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetCng +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetCng() + { + switch (iDnLinkCodec) + { + case QTMS_FORMAT_G711: + static_cast (iDecFormatIntfc)->GetCNG(iCng); + DisplayText("Current CNG: ", iCng); + break; + case QTMS_FORMAT_ILBC: + static_cast (iDecFormatIntfc)->GetCNG(iCng); + DisplayText("Current CNG: ", iCng); + break; + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::TogglePlc +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::TogglePlc() + { + iPlc = (iPlc) ? EFalse : ETrue; + if (iDnLinkCodec == QTMS_FORMAT_G711) + { + static_cast (iDecFormatIntfc)->SetPlc(iPlc); + DisplayText("Set PLC: ", iPlc); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetPlc +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetPlc() + { + if (iDnLinkCodec == QTMS_FORMAT_G711) + { + static_cast (iDecFormatIntfc)->GetPlc(iPlc); + DisplayText("Current PLC: ", iPlc); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetDnLinkG711ALAW +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetDnLinkG711ALAW() + { + if (iDnLinkCodec == QTMS_FORMAT_G711) + { + static_cast (iDecFormatIntfc)->SetMode( + QTMS_G711_CODEC_MODE_ALAW); + DisplayText("DNL G.711 Mode Set: [aLaw]"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetDnLinkG711uLAW +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetDnLinkG711uLAW() + { + if (iDnLinkCodec == QTMS_FORMAT_G711) + { + static_cast (iDecFormatIntfc)->SetMode( + QTMS_G711_CODEC_MODE_MULAW); + DisplayText("DNL G.711 Mode Set: [uLaw]"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetDnLinkG711Mode +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetDnLinkG711Mode() + { + if (iDnLinkCodec == QTMS_FORMAT_G711) + { + QTMSG711CodecMode mode; + TInt status = static_cast (iDecFormatIntfc)->GetMode( + mode); + + if (status == QTMS_RESULT_SUCCESS) + { + if (mode == QTMS_G711_CODEC_MODE_MULAW) + { + DisplayText("DNL G711 Mode: [uLaw]"); + } + else + { + DisplayText("DNL G711 Mode: [aLaw]"); + } + } + else + { + DisplayText("DNL G711 GetMode Error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetDnLinkILBC20MS +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetDnLinkILBC20MS() + { + if (iDnLinkCodec == QTMS_FORMAT_ILBC) + { + static_cast (iDecFormatIntfc)->SetMode( + QTMS_ILBC_CODEC_MODE_20MS_FRAME); + DisplayText("DNL iLBC Mode Set: [20ms]"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetDnLinkILBC30MS +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetDnLinkILBC30MS() + { + if (iDnLinkCodec == QTMS_FORMAT_ILBC) + { + static_cast (iDecFormatIntfc)->SetMode( + QTMS_ILBC_CODEC_MODE_30MS_FRAME); + DisplayText("DNL iLBC Mode Set: [30ms]"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetDnLinkILBCMode +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetDnLinkILBCMode() + { + if (iDnLinkCodec == QTMS_FORMAT_ILBC) + { + QTMSILBCCodecMode mode; + gint status = static_cast (iDecFormatIntfc)->GetMode( + mode); + + if (status == QTMS_RESULT_SUCCESS) + { + if (mode == QTMS_ILBC_CODEC_MODE_30MS_FRAME) + { + DisplayText("DNL iLBC Mode: [30ms]"); + } + else if (mode == QTMS_ILBC_CODEC_MODE_20MS_FRAME) + { + DisplayText("DNL iLBC Mode: [20ms]"); + } + } + else + { + DisplayText("DNL iLBC GetMode Error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetUpLinkG711ALAW +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetUpLinkG711ALAW() + { + if (iUpLinkCodec == QTMS_FORMAT_G711) + { + static_cast (iEncFormatIntfc)->SetMode( + QTMS_G711_CODEC_MODE_ALAW); + DisplayText("UPL G.711 Mode Set: [aLaw]"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetUpLinkG711uLAW +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetUpLinkG711uLAW() + { + + if (iUpLinkCodec == QTMS_FORMAT_G711) + { + static_cast (iEncFormatIntfc)->SetMode( + QTMS_G711_CODEC_MODE_MULAW); + DisplayText("UPL G.711 Mode Set: [uLaw]"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetUpLinkG711Mode +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetUpLinkG711Mode() + { + gint status(QTMS_RESULT_SUCCESS); + if (iUpLinkCodec == QTMS_FORMAT_G711) + { + QTMSG711CodecMode mode; + status = static_cast (iEncFormatIntfc)->GetMode(mode); + + if (status == QTMS_RESULT_SUCCESS) + { + if (mode == QTMS_G711_CODEC_MODE_MULAW) + { + DisplayText("UPL G.711 Mode: [uLaw]"); + } + else if (mode == QTMS_G711_CODEC_MODE_ALAW) + { + DisplayText("UPL G.711 Mode: [aLaw]"); + } + } + else + { + DisplayText("UPL G.711 GetMode Error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetUpLinkILBC20MS +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetUpLinkILBC20MS() + { + if (iUpLinkCodec == QTMS_FORMAT_ILBC) + { + static_cast (iEncFormatIntfc)->SetMode( + QTMS_ILBC_CODEC_MODE_20MS_FRAME); + DisplayText("UPL iLBC Mode Set: [20ms]"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetUpLinkILBC30MS +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetUpLinkILBC30MS() + { + if (iUpLinkCodec == QTMS_FORMAT_ILBC) + { + static_cast (iEncFormatIntfc)->SetMode( + QTMS_ILBC_CODEC_MODE_30MS_FRAME); + DisplayText("UPL iLBC Mode Set: [30ms]"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetUpLinkILBCMode +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetUpLinkILBCMode() + { + gint status(QTMS_RESULT_SUCCESS); + if (iUpLinkCodec == QTMS_FORMAT_ILBC) + { + QTMSILBCCodecMode mode; + status = static_cast (iEncFormatIntfc)->GetMode(mode); + + if (status == QTMS_RESULT_SUCCESS) + { + if (mode == QTMS_ILBC_CODEC_MODE_30MS_FRAME) + { + DisplayText("UPL iLBC Mode: [30ms]"); + } + else if (mode == QTMS_ILBC_CODEC_MODE_20MS_FRAME) + { + DisplayText("UPL iLBC Mode: [20ms]"); + } + } + else + { + DisplayText("UPL iLBC GetMode Error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::CreateGlobalVol +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::CreateGlobalVol() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory && !iGlobalVol) + { + status = iFactory->CreateEffect(QTMS_EFFECT_GLOBAL_VOL, iGlobalVol); + + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("Global Vol Created"); + connect(static_cast (iGlobalVol), + SIGNAL(EffectsEvent(const QTMSEffect&,QTMSSignalEvent)), + this, + SLOT(EffectsEvent(const QTMSEffect&,QTMSSignalEvent))); + // DisplayText("connected to global vol signal"); + } + else + { + DisplayText("Global Vol failed: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::CreateGlobalGain +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::CreateGlobalGain() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iFactory && !iGlobalGain) + { + status = iFactory->CreateEffect(QTMS_EFFECT_GLOBAL_GAIN, iGlobalGain); + + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("Global Gain Created"); + connect(static_cast (iGlobalGain), + SIGNAL(EffectsEvent(const QTMSEffect&,QTMSSignalEvent)), + this, + SLOT(EffectsEvent(const QTMSEffect&,QTMSSignalEvent))); + // DisplayText("connected to global gain signal"); + } + else + { + DisplayText("Global Gain failed: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetGlobalVol +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetGlobalVol() + { + if (iGlobalVol) + { + TUint level(0); + static_cast (iGlobalVol)->GetLevel(level); + DisplayText("Global Vol: ", level); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetGlobalMaxVol +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetGlobalMaxVol() + { + if (iGlobalVol) + { + TUint level(0); + static_cast (iGlobalVol)->GetMaxLevel(level); + DisplayText("Global Max Vol: ", level); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetGlobalVol +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetGlobalVol() + { + TUint level(0); + if (iGlobalVol) + { + static_cast (iGlobalVol)->GetMaxLevel(level); + static_cast (iGlobalVol)->SetLevel(level); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetGlobalGain +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetGlobalGain() + { + if (iGlobalGain) + { + TUint level(0); + static_cast (iGlobalGain)->GetLevel(level); + DisplayText("Global Gain: ", level); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetGlobalMaxGain +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetGlobalMaxGain() + { + if (iGlobalGain) + { + TUint level(0); + static_cast (iGlobalGain)->GetMaxLevel(level); + DisplayText("Global Max gain: ", level); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetGlobalGain +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetGlobalGain() + { + TUint level(0); + if (iGlobalGain) + { + static_cast (iGlobalGain)->GetMaxLevel(level); + static_cast (iGlobalGain)->SetLevel(level); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetOutputDevice +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetOutputDevice(QTMSAudioOutput device) + { + gint status(QTMS_RESULT_SUCCESS); + + if (iTmsGlobalRouting) + { + switch (device) + { + case QTMS_AUDIO_OUTPUT_NONE: + status = iTmsGlobalRouting->SetOutput(QTMS_AUDIO_OUTPUT_NONE); + DisplayText("Routing none"); + break; + case QTMS_AUDIO_OUTPUT_PUBLIC: + status = iTmsGlobalRouting->SetOutput(QTMS_AUDIO_OUTPUT_PUBLIC); + DisplayText("Routing public"); + break; + case QTMS_AUDIO_OUTPUT_PRIVATE: + status = iTmsGlobalRouting->SetOutput( + QTMS_AUDIO_OUTPUT_PRIVATE); + DisplayText("Routing private"); + break; + case QTMS_AUDIO_OUTPUT_HANDSET: + status = iTmsGlobalRouting->SetOutput( + QTMS_AUDIO_OUTPUT_HANDSET); + DisplayText("Routing to handset"); + break; + case QTMS_AUDIO_OUTPUT_LOUDSPEAKER: + status = iTmsGlobalRouting->SetOutput( + QTMS_AUDIO_OUTPUT_LOUDSPEAKER); + DisplayText("Routing to Loudspeaker"); + break; + case QTMS_AUDIO_OUTPUT_WIRED_ACCESSORY: + status = iTmsGlobalRouting->SetOutput( + QTMS_AUDIO_OUTPUT_WIRED_ACCESSORY); + DisplayText("Routing to Wired accessory"); + break; + case QTMS_AUDIO_OUTPUT_ACCESSORY: + status = iTmsGlobalRouting->SetOutput( + QTMS_AUDIO_OUTPUT_ACCESSORY); + DisplayText("Routing to BT accessory"); + break; + case QTMS_AUDIO_OUTPUT_ETTY: + status = iTmsGlobalRouting->SetOutput(QTMS_AUDIO_OUTPUT_ETTY); + DisplayText("Routing to TTY"); + break; + default: // ENoPreference + DisplayText("Default Device Routing"); + break; + } + } + if (status != QTMS_RESULT_SUCCESS) + { + DisplayText("Routing failed: ", status); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetHandset +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetHandset() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iTmsGlobalRouting) + { + status = iTmsGlobalRouting->SetOutput(QTMS_AUDIO_OUTPUT_HANDSET); + + if (status != QTMS_RESULT_SUCCESS) + { + DisplayText("SetHandSet failed: ", status); + } + else + { + DisplayText("SetHandSet"); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::SetLoudSpeaker +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::SetLoudSpeaker() + { + gint status(QTMS_RESULT_SUCCESS); + + if (iTmsGlobalRouting) + { + status = iTmsGlobalRouting->SetOutput(QTMS_AUDIO_OUTPUT_LOUDSPEAKER); + + if (status != QTMS_RESULT_SUCCESS) + { + DisplayText("SetLoudSpeaker failed: ", status); + } + else + { + DisplayText("SetLoudSpeaker"); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetAudioDevice +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetAudioDevice() + { + QTMSAudioOutput device; + + if (iTmsGlobalRouting) + { + iTmsGlobalRouting->GetOutput(device); +#ifdef __TEST_CODE_COVERAGE__ + TMSAudioOutput prevdevice; + iTmsGlobalRouting->GetPreviousOutput(prevdevice); +#endif //__TEST_CODE_COVERAGE__ + + switch (device) + { + case QTMS_AUDIO_OUTPUT_NONE: + DisplayText("Routing none"); + break; + case QTMS_AUDIO_OUTPUT_PUBLIC: + DisplayText("Routing public"); + break; + case QTMS_AUDIO_OUTPUT_PRIVATE: + DisplayText("Routing private"); + break; + case QTMS_AUDIO_OUTPUT_HANDSET: + DisplayText("Routing to handset"); + break; + case QTMS_AUDIO_OUTPUT_LOUDSPEAKER: + DisplayText("Routing to Loudspeaker"); + break; + case QTMS_AUDIO_OUTPUT_WIRED_ACCESSORY: + DisplayText("Routing to Wired accessory"); + break; + case QTMS_AUDIO_OUTPUT_ACCESSORY: + DisplayText("Routing to BT accessory"); + break; + case QTMS_AUDIO_OUTPUT_ETTY: + DisplayText("Routing to TTY"); + break; + default: // ENoPreference + DisplayText("Default Device Routing"); + break; + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::GetAvailableOutput +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::GetAvailableOutput() + { + TInt status(QTMS_RESULT_SUCCESS); + + if (iTmsGlobalRouting) + { + status = iTmsGlobalRouting->GetAvailableOutputs(iAvailableoutputs); + + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("Available outputs: ", iAvailableoutputs.size()); + std::vector::iterator outputs = iAvailableoutputs.begin(); + for (; outputs < iAvailableoutputs.end(); outputs++) + { + DisplayDevice(*outputs); + } + } + else + { + DisplayText("Available output error: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::DisplayDevice +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::DisplayDevice(QTMSAudioOutput device) + { + switch (device) + { + case QTMS_AUDIO_OUTPUT_NONE: + DisplayText("none"); + break; + case QTMS_AUDIO_OUTPUT_PUBLIC: + DisplayText("Public"); + break; + case QTMS_AUDIO_OUTPUT_PRIVATE: + DisplayText("Private"); + break; + case QTMS_AUDIO_OUTPUT_HANDSET: + DisplayText("Handset"); + break; + case QTMS_AUDIO_OUTPUT_LOUDSPEAKER: + DisplayText("Loudspeaker"); + break; + case QTMS_AUDIO_OUTPUT_WIRED_ACCESSORY: + DisplayText("Wired accessory"); + break; + case QTMS_AUDIO_OUTPUT_ACCESSORY: + DisplayText("Accessory"); + break; + case QTMS_AUDIO_OUTPUT_ETTY: + DisplayText("TTY"); + break; + default: + break; + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::InitDTMFTonePlayerDnlink +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::InitDTMFTonePlayerDnlink() + { + gint status(QTMS_RESULT_SUCCESS); + if (iFactory) + { + status = iFactory->CreateDTMF(QTMS_STREAM_DOWNLINK, iDTMFTonePlayerDn); + } + if (iDTMFTonePlayerDn && status == QTMS_RESULT_SUCCESS) + { + connect(iDTMFTonePlayerDn, + SIGNAL(DTMFEvent(QTMSDTMF*,QTMSSignalEvent)), this, + SLOT(DTMFEvent(QTMSDTMF*,QTMSSignalEvent))); + } + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("DTMF Downlink OK"); + } + else + { + DisplayText("DTMF Downlink failed: ", status); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::InitDTMFTonePlayerUplink +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::InitDTMFTonePlayerUplink() + { + gint status(QTMS_RESULT_SUCCESS); + if (iFactory) + { + status = iFactory->CreateDTMF(QTMS_STREAM_UPLINK, iDTMFTonePlayerUp); + } + if (iDTMFTonePlayerUp && status == QTMS_RESULT_SUCCESS) + { + connect(iDTMFTonePlayerUp, + SIGNAL(DTMFEvent(QTMSDTMF*,QTMSSignalEvent)), this, + SLOT(DTMFEvent(QTMSDTMF*,QTMSSignalEvent))); + } + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("DTMF Uplink OK"); + } + else + { + DisplayText("DTMF Uplink failed: ", status); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::DTMFTonePlayDnlink +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::DTMFTonePlayDnlink() + { + GString* dtmfstring; + gint status(QTMS_RESULT_SUCCESS); + if (iDTMFTonePlayerDn) + { + dtmfstring = g_string_new("4723"); + status = iDTMFTonePlayerDn->SetTone(dtmfstring); + if (status == QTMS_RESULT_SUCCESS) + { + status = iDTMFTonePlayerDn->Start(); + if (status != QTMS_RESULT_SUCCESS) + { + DisplayText("DTMF downlink start failed: ", status); + } + } + else + { + DisplayText("DTMF downlink settone failed: ", status); + } + g_string_free(dtmfstring, TRUE); + } + else + { + DisplayText("Downlink not ready"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::DTMFTonePlayUplink +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::DTMFTonePlayUplink() + { + GString* dtmfstring; + gint status(QTMS_RESULT_SUCCESS); + // Note: uplink must be in the streaming state (disable for testing) + if (iDTMFTonePlayerUp && iUpLinkStatus == EStreaming) + { + dtmfstring = g_string_new("4567890*#123"); + //dtmfstring = g_string_append_c(dtmfstring, '4'); + status = iDTMFTonePlayerUp->SetTone(dtmfstring); + if (status == QTMS_RESULT_SUCCESS) + { +#ifdef __TEST_CODE_COVERAGE__ + // CS call only + iDTMFTonePlayerUp->ContinueDTMFStringSending(TRUE); +#endif //__TEST_CODE_COVERAGE__ + + status = iDTMFTonePlayerUp->Start(); + + if (status != QTMS_RESULT_SUCCESS) + { + DisplayText("DTMF uplink start failed: ", status); + } + } + else + { + DisplayText("DTMF uplink settone failed: ", status); + } + g_string_free(dtmfstring, TRUE); + } + else + { + DisplayText("Uplink not ready"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::CloseDTMFPlayerDnlink +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::CloseDTMFPlayerDnlink() + { + if (iFactory && iDTMFTonePlayerDn) + { + iDTMFTonePlayerDn->Stop(); + iFactory->DeleteDTMF(iDTMFTonePlayerDn); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::CloseDTMFPlayerUplink +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::CloseDTMFPlayerUplink() + { + if (iFactory && iDTMFTonePlayerUp) + { + iDTMFTonePlayerUp->Stop(); + iFactory->DeleteDTMF(iDTMFTonePlayerUp); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::InitRingTonePlayerFromProfiles +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::InitRingTonePlayerFromProfiles() + { + if (iTmsRingTonePlayer) + { + gint status = iTmsRingTonePlayer->Init(QTMS_RINGTONE_DEFAULT); + DisplayText("RT Init Profile: ", status); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::InitRingTonePlayerFromFile +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::InitRingTonePlayerFromFile() + { + if (iTmsRingTonePlayer) + { + TBuf buf(KTestFile1); + iRTStr = g_string_new_len((gchar*) buf.Ptr(), buf.Length() * 2); + gint status = iTmsRingTonePlayer->Init(QTMS_RINGTONE_FILE, iRTStr); + DisplayText("RT Init File: ", status); + g_string_free(iRTStr, TRUE); + iRTStr = NULL; + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::InitRingToneVideoPlayer +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::InitRingToneVideoPlayer() + { + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::InitRingToneSequencePlayer +// Creates sequence player to play custom sequence in descriptor format +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::InitRingToneSequencePlayer() + { + if (iTmsRingTonePlayer) + { + TBuf8 buf(KRTBeepSequence); + iRTStr = g_string_new_len((gchar*) buf.Ptr(), buf.Length()); + gint status = iTmsRingTonePlayer->Init(QTMS_RINGTONE_SEQUENCE, iRTStr); + DisplayText("RT Init Sequence: ", status); + g_string_free(iRTStr, TRUE); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::InitRingToneBeepOnce +// Creates sequence player to play single beep +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::InitRingToneBeepOnce() + { + if (iTmsRingTonePlayer) + { + gint status = iTmsRingTonePlayer->Init(QTMS_RINGTONE_BEEP_ONCE); + DisplayText("RT Init BeepOnce: ", status); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::InitRingToneSilent +// Creates sequence player to play silent tone +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::InitRingToneSilent() + { + if (iTmsRingTonePlayer) + { + gint status = iTmsRingTonePlayer->Init(QTMS_RINGTONE_SILENT); + DisplayText("RT Init Silent: ", status); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::InitRingToneUnsecureVoIP +// Creates sequence player to play tone for unsecured VoIP call. +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::InitRingToneUnsecureVoIP() + { + if (iTmsRingTonePlayer) + { + gint status = iTmsRingTonePlayer->Init(QTMS_RINGTONE_UNSECURE_VOIP); + DisplayText("RT Init UnsecVoIP: ", status); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::InitRingToneWithTTS +// Creates sequence player to play default RT with Text-To-Speech +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::InitRingToneWithTTS() + { + if (iTmsRingTonePlayer) + { + TBuf buf(KTextToSpeak); + iTTSStr = g_string_new_len((gchar*) buf.Ptr(), buf.Length() * 2); + gint status = iTmsRingTonePlayer->Init(QTMS_RINGTONE_DEFAULT, NULL, + iTTSStr); + DisplayText("RT Init TTS: ", status); + g_string_free(iTTSStr, TRUE); + } + iTTSStr = NULL; + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::PlayRingTone +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::PlayRingTone() + { + if (iTmsRingTonePlayer) + { + iTmsRingTonePlayer->Play(); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::StopRingTone +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::StopRingTone() + { + if (iTmsRingTonePlayer) + { + iTmsRingTonePlayer->Stop(); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::MuteRingTone +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::MuteRingTone() + { + if (iTmsRingTonePlayer) + { + iTmsRingTonePlayer->Mute(); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::PauseVideoRingTone +// Pause audio for video RT only +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::PauseVideoRingTone() + { + if (iTmsRingTonePlayer) + { + iTmsRingTonePlayer->Pause(); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::DeinitRingTonePlayer +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::DeinitRingTonePlayer() + { + if (iTmsRingTonePlayer) + { + iTmsRingTonePlayer->Deinit(); + } + } + +// ---------------------------------------------------------------------------- +// CTmsTestEngine::CloseRingTonePlayer +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::CloseRingTonePlayer() + { + if (iFactory && iTmsRingTonePlayer) + { + DeinitRingTonePlayer(); + iFactory->DeleteRingTonePlayer(iTmsRingTonePlayer); + DisplayText("RT Player Closed"); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::CreateInbandTonePlayer +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::CreateInbandTonePlayer() + { + gint status(QTMS_RESULT_SUCCESS); + if (iFactory && !iInbandTonePlayer) + { + status = iFactory->CreateInbandTonePlayer(iInbandTonePlayer); + if (iInbandTonePlayer && status == QTMS_RESULT_SUCCESS) + { + connect(iInbandTonePlayer, + SIGNAL(InbandToneEvent(QTMSInbandTone*, QTMSSignalEvent)), + this, + SLOT(InbandToneEvent(QTMSInbandTone* , QTMSSignalEvent))); + DisplayText("Inband Tone Player created"); + } + else + { + DisplayText("Inband Tone Player failed: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::StartInbandTone +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::StartInbandTone(QTMSInbandToneType inbandtone) + { + gint status(QTMS_RESULT_SUCCESS); + CreateInbandTonePlayer(); + if (iFactory && iInbandTonePlayer) + { + status = iInbandTonePlayer->Start(inbandtone); + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("Inband Tone Player Start"); + } + else + { + DisplayText("Inband tone failed: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::StopInbandTone +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::StopInbandTone() + { + gint status(QTMS_RESULT_SUCCESS); + if (iFactory && iInbandTonePlayer) + { + status = iInbandTonePlayer->Stop(); + if (status == QTMS_RESULT_SUCCESS) + { + DisplayText("Inband Tone Player Stop"); + } + else + { + DisplayText("Inband tone failed: ", status); + } + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::OneTouchLoopback +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::OneTouchLoopback() + { + iOneTouchLoopback = ETrue; + + // Change between CS and IP call type for testing. + //SetCallType(QTMS_CALL_CS); //will activate streams + SetCallType(QTMS_CALL_IP); + + if (iTmsCall->GetCallType() == QTMS_CALL_IP) + { +#ifdef __WINSCW__ + SetDownlinkFormat(QTMS_FORMAT_PCM); + SetUplinkFormat(QTMS_FORMAT_PCM); +#else //__WINSCW__ + SetDownlinkFormat(QTMS_FORMAT_AMR); + SetUplinkFormat(QTMS_FORMAT_AMR); +#endif //__WINSCW__ + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::DoLoopback +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::DoLoopback() + { + if (iPlayBufReady && iRecBufReady) + { + guint8* srcptr(NULL); + guint8* desptr(NULL); + guint srcsize(0); + guint dessize(0); + + iPlayBuf->GetDataPtr(desptr); + iPlayBuf->GetDataSize(dessize); + iRecBuf->GetDataPtr(srcptr); + iRecBuf->GetDataSize(srcsize); + +#ifdef __WINSCW__ + // This is the case when the size of the play buffer is larger than + // the size of the recorded buffer. In WINS, DirectX views partially + // filled buffers as an EOS and throws (-10). So, we will collect + // multiple buffers here. + Mem::Copy(desptr + iBufIndex, srcptr, srcsize); + iBufIndex += srcsize; + if (iBufIndex >= dessize) + { + iPlayBuf->SetDataSize(dessize); + static_cast (iTmsClientSource)->BufferFilled( + *iPlayBuf); + iPlayBufReady = EFalse; // buf filled, ready for next FillBuffer + iBufIndex = 0; + } +#else //__WINSCW__ + Mem::Copy(desptr, srcptr, srcsize); + iPlayBuf->SetDataSize(srcsize); + static_cast (iTmsClientSource)->BufferFilled( + *iPlayBuf); + iPlayBufReady = EFalse; // buf filled, ready for FillBuffer +#endif //__WINSCW__ + iRecBufReady = EFalse; // buf consumed, ready for next EmptyBuffer + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine::EndCall +// +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::EndCall() + { + StopUplink(); + StopDownlink(); + CloseUplink(); + CloseDownlink(); + CloseDTMFPlayerUplink(); + CloseDTMFPlayerDnlink(); + + if (iTmsUplink && iTmsCall) + { + iTmsCall->DeleteStream(iTmsUplink); + } + if (iTmsDnlink && iTmsCall) + { + iTmsCall->DeleteStream(iTmsDnlink); + } + if (iFactory && iTmsCall) + { + iFactory->DeleteCall(iTmsCall); + } + if (iFactory && iTmsClientSource) + { + iFactory->DeleteSource(iTmsClientSource); + } + if (iFactory && iTmsMicSource) + { + iFactory->DeleteSource(iTmsMicSource); + } + if (iFactory && iTmsModemSource) + { + iFactory->DeleteSource(iTmsModemSource); + } + if (iFactory && iTmsClientSink) + { + iFactory->DeleteSink(iTmsClientSink); + } + if (iFactory && iTmsSpeakerSink) + { + iFactory->DeleteSink(iTmsSpeakerSink); + } + if (iFactory && iTmsModemSink) + { + iFactory->DeleteSink(iTmsModemSink); + } + if (iFactory && iTmsDnlinkEffect) + { + iFactory->DeleteEffect(iTmsDnlinkEffect); + } + if (iFactory && iTmsUplinkEffect) + { + iFactory->DeleteEffect(iTmsUplinkEffect); + } + if (iFactory && iEncFormatIntfc) + { + iFactory->DeleteFormat(iEncFormatIntfc); + } + if (iFactory && iDecFormatIntfc) + { + iFactory->DeleteFormat(iDecFormatIntfc); + } + if (iFactory && iDTMFTonePlayerDn) + { + iFactory->DeleteDTMF(iDTMFTonePlayerDn); + } + if (iFactory && iDTMFTonePlayerUp) + { + iFactory->DeleteDTMF(iDTMFTonePlayerUp); + } + } + +#ifdef __RECORD_WAV_TO_FILE__ +void CTmsTestEngine::WriteToFile(const guint8* str, const guint len) + { + TPtrC8 ptr(str, len); + TPtr8 p = iWriteBuf->Des(); + p.Copy(ptr); + iFile.Write(p); + } +#endif //__RECORD_WAV_TO_FILE__ + +// CALLBACKS + +void QTmsTestEngine::TMSStreamEvent(const QTMSStream& stream, + QTMSSignalEvent event) + { + switch (const_cast (stream).GetStreamType()) + { + case QTMS_STREAM_UPLINK: + { + switch (event.type) + { + case QTMS_EVENT_STREAM_STATE_CHANGED: + { + switch (event.curr_state) + { + case QTMS_STREAM_INITIALIZED: + { +#ifdef __PROFILING_ENABLED__ + TAG_CALLBACK_TIME_PROFILING_END; + PRINT_CALLBACK_TIME_LATENCY; +#endif //__PROFILING_ENABLED__ + iUpLinkStatus = EReady; + DisplayText("Uplink initialized "); + if (iOneTouchLoopback) + { + StartUplink(); + } + break; + } + case QTMS_STREAM_UNINITIALIZED: + DisplayText("Uplink uninitialized "); + break; + case QTMS_STREAM_PAUSED: + DisplayText("Uplink paused "); + break; + case QTMS_STREAM_STARTED: + DisplayText("Uplink started "); + break; + default: + break; + } + break; + } + case QTMS_EVENT_STREAM_STATE_CHANGE_ERROR: + DisplayText("Uplink Error ", event.reason); + break; + default: + break; + } + break; + } + case QTMS_STREAM_DOWNLINK: + { + switch (event.type) + { + case QTMS_EVENT_STREAM_STATE_CHANGED: + { + switch (event.curr_state) + { + case QTMS_STREAM_INITIALIZED: + { +#ifdef __PROFILING_ENABLED__ + TAG_CALLBACK_TIME_PROFILING_END; + PRINT_CALLBACK_TIME_LATENCY; + TAG_CALLBACK_TIME_PROFILING_START; +#endif //__PROFILING_ENABLED__ + GetMaxVolume(); + SetVolume(iMaxVolume / 2); + iDnLinkStatus = EReady; + DisplayText("Downlink initialized"); + if (iOneTouchLoopback) + { +#ifndef __WINSCW__ + // No audio mixing in WINS - do not start + StartDownlink(); +#endif //__WINSCW__ + } + break; + } + case QTMS_STREAM_UNINITIALIZED: + DisplayText("Downlink uninitialized"); + break; + case QTMS_STREAM_PAUSED: + DisplayText("Downlink paused"); + break; + case QTMS_STREAM_STARTED: + DisplayText("Downlink started"); + break; + default: + break; + } + break; + } + case QTMS_EVENT_STREAM_STATE_CHANGE_ERROR: + DisplayText("Downlink Error ", event.reason); + break; + default: + break; + } + break; + } + default: + break; + } + } + +//From TMSClientSourceObserver +void QTmsTestEngine::FillBuffer(QTMSBuffer& buffer) + { + iPlayBufReady = ETrue; + iPlayBuf = &buffer; + +#ifdef __PLAY_WAV_FROM_FILE__ + guint8* gptr(NULL); + iPlayBuf->GetDataPtr(gptr); + guint gsize; + iPlayBuf->GetDataSize(gsize); + if (!iBuf) + { + iBuf = HBufC8::NewL(gsize); + } + TPtr8 p = iBuf->Des(); + + if ((iReadPos + gsize) > iFileLen) + { + gsize = iFileLen - iReadPos; + iEOF = ETrue; + } + + iFile.Read(iReadPos, p, gsize); + // DEBPRN1(_L("CVoIPTestEngine[0x%x]::FillBuffer [%d]"), iReadPos); + + if (!iEOF) + { + iReadPos += gsize; + } + else + { + // start over from the beginning + iReadPos = 0; + iEOF = EFalse; + } + + Mem::Copy(gptr, (TUint8*) iBuf->Ptr(), iBuf->Size()); + iPlayBuf->SetDataSize(iBuf->Size()); + static_cast (iTmsClientSource)->BufferFilled(*iPlayBuf); + User::After(TTimeIntervalMicroSeconds32(100000)); //clears choppy audio + + iPlayBufReady = EFalse; // buf filled, ready for FillBuffer + iRecBufReady = EFalse; // buf consumed, ready for EmptyBuffer + +#else //__PLAY_WAV_FROM_FILE__ + if (iDnLinkStatus == EStreaming) + { + DoLoopback(); + } +#endif //__PLAY_WAV_FROM_FILE__ + } + +//From TMSClientSourceObserver +void QTmsTestEngine::BufferProcessed(const QTMSBuffer* /*buffer*/, + gint /*reason*/) + { + } + +// From TMSClientSinkObserver +void QTmsTestEngine::ProcessBuffer(const QTMSBuffer* buffer) + { + iRecBufReady = ETrue; + iRecBuf = const_cast (buffer); + + if (iUpLinkStatus == EStreaming) + { + // Process recorded buffer here. + +#ifdef __RECORD_WAV_TO_FILE__ + guint8* p(NULL); + guint len(0); + iRecBuf->GetDataPtr(p); + iRecBuf->GetDataSize(len); + WriteToFile(p, len); +#endif //__RECORD_WAV_TO_FILE__ + + DoLoopback(); + static_cast (iTmsClientSink)->BufferProcessed( + iRecBuf); + } + } + +// From TMSEffectObserver +void QTmsTestEngine::EffectsEvent(const QTMSEffect& tmseffect, + QTMSSignalEvent event) + { + gint reason = event.reason; + + if (reason == QTMS_RESULT_SUCCESS) + { + QTMSEffectType effecttype; + const_cast (tmseffect).GetType(effecttype); + switch (effecttype) + { + case QTMS_EFFECT_GLOBAL_VOL: + { + switch (event.type) + { + case QTMS_EVENT_EFFECT_VOL_CHANGED: + DisplayText("Global vol effect change"); + QTMSVolumeEventChangeData* vd; + vd = static_cast + (event.event_data); + DisplayText("Volume level: ", vd->level); + DisplayText("Output device: ", vd->output); + break; + default: + break; + } + } + break; + case QTMS_EFFECT_GLOBAL_GAIN: + { + switch (event.type) + { + case QTMS_EVENT_EFFECT_GAIN_CHANGED: + DisplayText("Global gain effect change"); + break; + default: + break; + } + } + break; + case QTMS_EFFECT_VOLUME: + { + switch (event.type) + { + case QTMS_EVENT_EFFECT_VOL_CHANGED: + DisplayText("Stream vol effect change"); + break; + default: + break; + } + } + break; + case QTMS_EFFECT_GAIN: + { + switch (event.type) + { + case QTMS_EVENT_EFFECT_GAIN_CHANGED: + DisplayText("Stream gain effect change"); + break; + default: + break; + } + } + break; + default: + break; + } + } + else + { + DisplayText("Effect failed: ", reason); + } + } + +// From TMSGlobalRoutingObserver +void QTmsTestEngine::GlobalRoutingEvent(const QTMSGlobalRouting& /*routing*/, + QTMSSignalEvent event, QTMSAudioOutput output) + { + gint reason = event.reason; + + if (reason == QTMS_RESULT_SUCCESS) + { + switch (event.type) + { + case QTMS_EVENT_ROUTING_AVAIL_OUTPUTS_CHANGED: + DisplayText("Available outputs changed"); + break; + case QTMS_EVENT_ROUTING_OUTPUT_CHANGED: + DisplayText("output changed"); + break; + case QTMS_EVENT_ROUTING_SET_OUTPUT_COMPLETE: + DisplayText("set output complete"); + break; + default: + break; + } + DisplayDevice(output); + } + else + { + DisplayText("Routing failed: ", reason); + } + } + +// From TMSRingToneObserver +void QTmsTestEngine::RingtoneEvent(const QTMSRingTone& /*rt*/, + QTMSSignalEvent event) + { + gint reason = event.reason; + + if (reason == QTMS_RESULT_SUCCESS) + { + switch (event.type) + { + case QTMS_EVENT_RINGTONE_OPEN_COMPLETE: + DisplayText("RT Open Complete"); + break; + case QTMS_EVENT_RINGTONE_PLAY_COMPLETE: + DisplayText("RT Play Complete"); + break; + case QTMS_EVENT_RINGTONE_DEINIT_COMPLETE: + DisplayText("RT Deinit Complete"); + break; + default: + break; + } + } + else + { + DisplayText("Ringtone failed: ", reason); + } + } + +// From TMSDTMFObserver +void QTmsTestEngine::DTMFEvent(const QTMSDTMF& /*dtmf*/, QTMSSignalEvent event) + { + gint reason = event.reason; + + if (reason == QTMS_RESULT_SUCCESS) + { + switch (event.type) + { + case QTMS_EVENT_DTMF_TONE_STARTED: + DisplayText("DTMF Started"); + break; + case QTMS_EVENT_DTMF_TONE_STOPPED: + DisplayText("DTMF Stopped"); + break; + default: + break; + } + } + else + { + DisplayText("DTMF failed: ", reason); + } + } + +// From TMSInbandToneObserver +void QTmsTestEngine::InbandToneEvent(const QTMSInbandTone& /*inbandtone*/, + QTMSSignalEvent event) + { + gint reason = event.reason; + + if (reason == QTMS_RESULT_SUCCESS) + { + switch (event.type) + { + case QTMS_EVENT_INBAND_TONE_STARTED: + DisplayText("Inband Tone Started"); + break; + case QTMS_EVENT_INBAND_TONE_STOPPED: + DisplayText("Inband Tone Stopped"); + break; + default: + break; + } + } + else + { + DisplayText("Inband tone failed: ", reason); + } + } + +// ---------------------------------------------------------------------------- +// QTmsTestEngine:://DisplayText +// Print text with status code. +// ---------------------------------------------------------------------------- +// +void QTmsTestEngine::DisplayText(const QString& str, const gint num) + { + if (num != 0) + { + iStatusDisplay->append(str + " " + QString::number(num)); + } + else + { + iStatusDisplay->append(str); + } + } + +// End of file diff -r 3b098142db83 -r 92dbd2a406d9 qtms/tsrc/qttmstestapp/src/qttmstestapp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qtms/tsrc/qttmstestapp/src/qttmstestapp.cpp Mon Oct 04 00:50:27 2010 +0300 @@ -0,0 +1,925 @@ +/* + * 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: Telephony Multimedia Service - QTmsTestApp + * + */ + +#include "qtmstestengine.h" +#include "ctmstestengine.h" +#include "mtmstestengine.h" +#include "qttmstestapp.h" + +#define CHECKENGINE if(!iTmsEngine){QMessageBox::critical(0, tr("Error"),\ + tr("Engine not ready."),\ + QMessageBox::Ok);\ + return;} + +TmsTestApp::TmsTestApp(QWidget *parent) : + QMainWindow(parent) + { + mainContainer = new QWidget(this); + setCentralWidget(mainContainer); + + iTmsEngine = NULL; + + statusDisplay = new QTextEdit(mainContainer); + + statusDisplay->setReadOnly(true); + + statusDisplay->setAlignment(Qt::AlignTop); + + statusDisplay->setTextColor(QColor(Qt::black)); + statusDisplay->setText("Qt TMS test app"); + + QPalette p = statusDisplay->palette(); + p.setColor(QPalette::Base, QColor(Qt::white)); + statusDisplay->setPalette(p); + QGridLayout *layout = new QGridLayout; + + layout->addWidget(statusDisplay); + statusDisplay->setForegroundRole(QPalette::Foreground); + + mainContainer->setLayout(layout); + + createActions(); + createMenus(); + } + +TmsTestApp::~TmsTestApp() + { + delete iTmsEngine; + } + +void TmsTestApp::createActions() + { + //Select engine + qtmsengine = new QAction(tr("QT TMS"),this); + connect(qtmsengine, SIGNAL(triggered()), this, SLOT(qtmsengineslot())); + tmsengine = new QAction(tr("TMS"),this); + connect(tmsengine, SIGNAL(triggered()), this, SLOT(tmsengineslot())); + + //Call type actions + cscall = new QAction(tr("CS"), this); + connect(cscall, SIGNAL(triggered()), this, SLOT(cscallslot())); + ipcall = new QAction(tr("IP"), this); + connect(ipcall, SIGNAL(triggered()), this, SLOT(ipcallslot())); + + //Stream actions + pcmdec = new QAction(tr("PCM-16"),this); + connect(pcmdec, SIGNAL(triggered()), this, SLOT(pcmdecslot())); + amrdec = new QAction(tr("AMR-NB"),this); + connect(amrdec, SIGNAL(triggered()), this, SLOT(amrdecslot())); + g711dec = new QAction(tr("G711"),this); + connect(g711dec, SIGNAL(triggered()), this, SLOT(g711decslot())); + g729dec = new QAction(tr("G729"),this); + connect(g729dec, SIGNAL(triggered()), this, SLOT(g729decslot())); + ilbcdec = new QAction(tr("iLBC"),this); + connect(ilbcdec, SIGNAL(triggered()), this, SLOT(ilbcdecslot())); + + pcmenc = new QAction(tr("PCM-16"),this); + connect(pcmenc, SIGNAL(triggered()), this, SLOT(pcmencslot())); + amrenc = new QAction(tr("AMR-NB"),this); + connect(amrenc, SIGNAL(triggered()), this, SLOT(amrencslot())); + g711enc = new QAction(tr("G711"),this); + connect(g711enc, SIGNAL(triggered()), this, SLOT(g711encslot())); + g729enc = new QAction(tr("G729"),this); + connect(g729enc, SIGNAL(triggered()), this, SLOT(g729encslot())); + ilbcenc = new QAction(tr("iLBC"),this); + connect(ilbcenc, SIGNAL(triggered()), this, SLOT(ilbcencslot())); + + downlinkformats = new QAction(tr("Get downlink formats"),this); + connect(downlinkformats, SIGNAL(triggered()), this, SLOT(downlinkformatsslot())); + strmdnstart = new QAction(tr("Start Dnlink"), this); + connect(strmdnstart, SIGNAL(triggered()), this, SLOT(strmdnstartslot())); + strmdnstop = new QAction(tr("Stop Dnlink"), this); + connect(strmdnstop, SIGNAL(triggered()), this, SLOT(strmdnstopslot())); + strmdnclose = new QAction(tr("Close Dnlink"), this); + connect(strmdnclose, SIGNAL(triggered()), this, SLOT(strmdncloseslot())); + + uplinkformats = new QAction(tr("Get uplink formats"),this); + connect(uplinkformats, SIGNAL(triggered()), this, SLOT(uplinkformatsslot())); + strmupstart = new QAction(tr("Start Uplink"), this); + connect(strmupstart, SIGNAL(triggered()), this, SLOT(strmupstartslot())); + strmupstop = new QAction(tr("Stop Uplink"), this); + connect(strmupstop, SIGNAL(triggered()), this, SLOT(strmupstopslot())); + strmupclose = new QAction(tr("Close Uplink"), this); + connect(strmupclose, SIGNAL(triggered()), this, SLOT(strmupcloseslot())); + + //Routing actions + availoutputact = new QAction(tr("Available outputs"), this); + connect(availoutputact, SIGNAL(triggered()), this, SLOT(availoutputslot())); + currentoutputact = new QAction(tr("Current Device Output"), this); + connect(currentoutputact, SIGNAL(triggered()), this, SLOT(currentoutputslot())); + handsetact = new QAction(tr("Select HandSet"), this); + connect(handsetact, SIGNAL(triggered()), this, SLOT(handsetslot())); + loudspkract = new QAction(tr("Select Loudspkr"), this); + connect(loudspkract, SIGNAL(triggered()), this, SLOT(loudspkrslot())); + wiredact = new QAction(tr("Select Wired accessory"), this); + connect(wiredact, SIGNAL(triggered()), this, SLOT(wiredslot())); + btact = new QAction(tr("Select BlueTooth"), this); + connect(btact, SIGNAL(triggered()), this, SLOT(btslot())); + ttyact = new QAction(tr("Select TTY"), this); + connect(ttyact, SIGNAL(triggered()), this, SLOT(ttyslot())); + + //Stream gain effect actions + stmgainact = new QAction(tr("Get gain"), this); + connect(stmgainact, SIGNAL(triggered()), this, SLOT(stmgainslot())); + stmmaxgainact = new QAction(tr("Get max gain"), this); + connect(stmmaxgainact, SIGNAL(triggered()), this, SLOT(stmmaxgainslot())); + stmsetgainact = new QAction(tr("Set gain"), this); + connect(stmsetgainact, SIGNAL(triggered()), this, SLOT(stmsetgainslot())); + stmmutegainact = new QAction(tr("Mute mic"), this); + connect(stmmutegainact, SIGNAL(triggered()), this, SLOT(stmmutegainslot())); + + //Stream vol effect actions + stmvolact = new QAction(tr("Get vol"), this); + connect(stmvolact, SIGNAL(triggered()), this, SLOT(stmvolslot())); + stmmaxvolact = new QAction(tr("Get max vol"), this); + connect(stmmaxvolact, SIGNAL(triggered()), this, SLOT(stmmaxvolslot())); + stmsetvolact = new QAction(tr("Set vol"), this); + connect(stmsetvolact, SIGNAL(triggered()), this, SLOT(stmsetvolslot())); + stmmutevolact = new QAction(tr("Mute spkr"), this); + connect(stmmutevolact, SIGNAL(triggered()), this, SLOT(stmmutevolslot())); + + //Global vol effects actions + globalvolact = new QAction(tr("Get global vol"), this); + connect(globalvolact, SIGNAL(triggered()), this, SLOT(globalvolslot())); + globalmaxvolact = new QAction(tr("Get global max vol"), this); + connect(globalmaxvolact, SIGNAL(triggered()), this, SLOT(globalmaxvolslot())); + globalsetvolact = new QAction(tr("Set global vol"), this); + connect(globalsetvolact, SIGNAL(triggered()), this, SLOT(globalsetvolslot())); + + //Global gain effects actions + globalgainact = new QAction(tr("Get global gain"), this); + connect(globalgainact, SIGNAL(triggered()), this, SLOT(globalgainslot())); + globalmaxgainact = new QAction(tr("Get global max gain"), this); + connect(globalmaxgainact, SIGNAL(triggered()), this, SLOT(globalmaxgainslot())); + globalsetgainact = new QAction(tr("Set global gain"), this); + connect(globalsetgainact, SIGNAL(triggered()), this, SLOT(globalsetgainslot())); + + //Decoder settings + togglecng = new QAction(tr("ToggleCng G711/iLBC"), this); + connect(togglecng,SIGNAL(triggered()), this ,SLOT(togglecngslot())); + getcng = new QAction(tr("GetCng G711/iLBC"), this); + connect(getcng,SIGNAL(triggered()), this ,SLOT(getcngslot())); + toggleplc = new QAction(tr("Toggle PLC G711"), this); + connect(toggleplc,SIGNAL(triggered()), this ,SLOT(toggleplcslot())); + getplc = new QAction(tr("Get PLC G711"), this); + connect(getplc,SIGNAL(triggered()), this ,SLOT(getplcslot())); + setalawdecg711 = new QAction(tr("Set ALaw G711"), this); + connect(setalawdecg711,SIGNAL(triggered()), this ,SLOT(setalawdecg711slot())); + setulawdecg711 = new QAction(tr("Set uLaw G711"), this); + connect(setulawdecg711,SIGNAL(triggered()), this ,SLOT(setulawdecg711slot())); + getmodedecg711 = new QAction(tr("Get mode G711"), this); + connect(getmodedecg711,SIGNAL(triggered()), this ,SLOT(getmodegdec711slot())); + set20msdecilbc = new QAction(tr("Set 20ms frm iLBC"), this); + connect(set20msdecilbc,SIGNAL(triggered()), this ,SLOT(set20msdecilbcslot())); + set30msdecilbc = new QAction(tr("Set 30ms frm iLBC"), this); + connect(set30msdecilbc,SIGNAL(triggered()), this ,SLOT(set30msdecilbcslot())); + getmodedecilbc = new QAction(tr("Getmode iLBC"), this); + connect(getmodedecilbc,SIGNAL(triggered()), this ,SLOT(getmodedecilbcslot())); + + //Encoder settings + getsupportedbr = new QAction(tr("Get supported bitrates"), this); + connect(getsupportedbr,SIGNAL(triggered()), this ,SLOT(getsupportedbrslot())); + setminbr = new QAction(tr("Set min br"), this); + connect(setminbr,SIGNAL(triggered()), this ,SLOT(setminbrslot())); + setmaxbr = new QAction(tr("Set max br"), this); + connect(setmaxbr,SIGNAL(triggered()), this ,SLOT(setmaxbrslot())); + getbr = new QAction(tr("Get br"), this); + connect(getbr,SIGNAL(triggered()), this ,SLOT(getbrslot())); + togglevad = new QAction(tr("Toggle VAD"), this); + connect(togglevad,SIGNAL(triggered()), this ,SLOT(togglevadslot())); + getvad = new QAction(tr("Get VAD"), this); + connect(getvad,SIGNAL(triggered()), this ,SLOT(getvadslot())); + setalawencg711 = new QAction(tr("Set ALaw G711"), this); + connect(setalawencg711,SIGNAL(triggered()), this ,SLOT(setalawencg711slot())); + setulawencg711 = new QAction(tr("Set uLaw G711"), this); + connect(setulawencg711,SIGNAL(triggered()), this ,SLOT(setulawencg711slot())); + getmodeencg711 = new QAction(tr("Get mode G711"), this); + connect(getmodeencg711,SIGNAL(triggered()), this ,SLOT(getmodeencg711slot())); + set20msencilbc = new QAction(tr("Set 20ms fr iLBC"), this); + connect(set20msencilbc,SIGNAL(triggered()), this ,SLOT(set20msencilbcslot())); + set30msencilbc = new QAction(tr("Set 30ms fr iLBC"), this); + connect(set30msencilbc,SIGNAL(triggered()), this ,SLOT(set30msencilbcslot())); + getmodeencilbc = new QAction(tr("Get mode iLBC"), this); + connect(getmodeencilbc,SIGNAL(triggered()), this ,SLOT(getmodeencilbcslot())); + + //DTMF actions + dtmfdninit = new QAction(tr("Init DTMF Dnlink"), this); + connect(dtmfdninit, SIGNAL(triggered()), this, SLOT(dtmfdninitslot())); + dtmfdnplay = new QAction(tr("Play DTMF Dnlink"), this); + connect(dtmfdnplay, SIGNAL(triggered()), this, SLOT(dtmfdnplayslot())); + dtmfdnstop = new QAction(tr("Stop DTMF Dnlink"), this); + connect(dtmfdnstop, SIGNAL(triggered()), this, SLOT(dtmfdnstopslot())); + dtmfupinit = new QAction(tr("Init DTMF Uplink"), this); + connect(dtmfupinit, SIGNAL(triggered()), this, SLOT(dtmfupinitslot())); + dtmfupplay = new QAction(tr("Play DTMF Uplink"), this); + connect(dtmfupplay, SIGNAL(triggered()), this, SLOT(dtmfupplayslot())); + dtmfupstop = new QAction(tr("Stop DTMF Uplink"), this); + connect(dtmfupstop, SIGNAL(triggered()), this, SLOT(dtmfupstopslot())); + + //Inband tones actions + inbandbusy = new QAction(tr("Busy"), this); + connect(inbandbusy,SIGNAL(triggered()), this ,SLOT(inbandbusyslot())); + inbandpathnotaval = new QAction(tr("RadioPath Not Available"), this); + connect(inbandpathnotaval,SIGNAL(triggered()), this ,SLOT(inbandpathnotavilslot())); + inbandcongestion = new QAction(tr("Congestion"), this); + connect(inbandcongestion,SIGNAL(triggered()), this ,SLOT(inbandcongestionslot())); + inbandspecialinfo = new QAction(tr("Special Info"), this); + connect(inbandspecialinfo,SIGNAL(triggered()), this ,SLOT(inbandspecialinfoslot())); + inbandreorder = new QAction(tr("Reorder"), this); + connect(inbandreorder,SIGNAL(triggered()), this ,SLOT(inbandreorderslot())); + inbandremotealert = new QAction(tr("Remote alert"), this); + connect(inbandremotealert,SIGNAL(triggered()), this ,SLOT(inbandremotealertslot())); + inbandcallwait = new QAction(tr("Call waiting"), this); + connect(inbandcallwait,SIGNAL(triggered()), this ,SLOT(inbandcallwaitslot())); + inbanddatacall = new QAction(tr("Data Call"), this); + connect(inbanddatacall,SIGNAL(triggered()), this ,SLOT(inbanddatacallslot())); + inbandnoseq = new QAction(tr("No sequence"), this); + connect(inbandnoseq,SIGNAL(triggered()), this ,SLOT(inbandnoseqslot())); + inbandbeepseq = new QAction(tr("Beep seq"), this); + connect(inbandbeepseq,SIGNAL(triggered()), this ,SLOT(inbandbeepseqslot())); + inbandstop = new QAction(tr("Stop"), this); + connect(inbandstop,SIGNAL(triggered()), this ,SLOT(inbandstopslot())); + + //Ring tone actions + rtplay = new QAction(tr("Play"), this); + connect(rtplay, SIGNAL(triggered()), this, SLOT(rtplayslot())); + rtpause = new QAction(tr("Pause"), this); + connect(rtpause, SIGNAL(triggered()), this, SLOT(rtpauseslot())); + rtmute = new QAction(tr("Mute"), this); + connect(rtmute, SIGNAL(triggered()), this, SLOT(rtmuteslot())); + rtstop = new QAction(tr("Stop"), this); + connect(rtstop, SIGNAL(triggered()), this, SLOT(rtstopslot())); + rtdeinit = new QAction(tr("Deinit"), this); + connect(rtdeinit, SIGNAL(triggered()), this, SLOT(rtdeinitslot())); + rtprofile = new QAction(tr("Current Profile"), this); + connect(rtprofile, SIGNAL(triggered()), this, SLOT(rtprofileslot())); + rtaudiofile = new QAction(tr("Audio File"), this); + connect(rtaudiofile, SIGNAL(triggered()), this, SLOT(rtfileslot())); + rttts = new QAction(tr("Profile with TTS"), this); + connect(rttts, SIGNAL(triggered()), this, SLOT(rtttsslot())); + rtsequence = new QAction(tr("Sequence"), this); + connect(rtsequence, SIGNAL(triggered()), this, SLOT(rtsequenceslot())); + rtbeep = new QAction(tr("Beep"), this); + connect(rtbeep, SIGNAL(triggered()), this, SLOT(rtbeepslot())); + rtsilent = new QAction(tr("Silent"), this); + connect(rtsilent, SIGNAL(triggered()), this, SLOT(rtsilentslot())); + + onetouch = new QAction(tr("One Touch Loopback"),this); + connect(onetouch,SIGNAL(triggered()), this ,SLOT(onetouchslot())); + + exitAction = new QAction(tr("&Exit"), this); + connect(exitAction, SIGNAL(triggered()), this, SLOT(quit())); + } + +void TmsTestApp::createMenus() + { + enginemenu = menuBar()->addMenu("Select Engine"); + enginemenu->addAction(qtmsengine); + enginemenu->addAction(tmsengine); + + //Call type menu options + QMenu* calltypemenu; + calltypemenu = menuBar()->addMenu("CallType"); + calltypemenu->addAction(cscall); + calltypemenu->addAction(ipcall); + + //Stream type menu options + QMenu* strmdnmenu; + strmdnmenu = menuBar()->addMenu("Downlink Stream"); + + strmdnmenu->addAction(downlinkformats); + + QMenu* decodermenu; + decodermenu = strmdnmenu->addMenu("Init Decoder..."); + + decodermenu->addAction(pcmdec); + decodermenu->addAction(amrdec); + decodermenu->addAction(g711dec); + decodermenu->addAction(g729dec); + decodermenu->addAction(ilbcdec); + + strmdnmenu->addAction(strmdnstart); + strmdnmenu->addAction(strmdnstop); + strmdnmenu->addAction(strmdnclose); + + QMenu* speakermenu; + speakermenu = strmdnmenu->addMenu("Speaker Settings"); + speakermenu->addAction(stmvolact); + speakermenu->addAction(stmmaxvolact); + speakermenu->addAction(stmsetvolact); + speakermenu->addAction(stmmutevolact); + QMenu* routingmenu; + routingmenu = strmdnmenu->addMenu("Output device"); + routingmenu->addAction(availoutputact); + routingmenu->addAction(currentoutputact); + routingmenu->addAction(handsetact); + routingmenu->addAction(loudspkract); + routingmenu->addAction(wiredact); + routingmenu->addAction(btact); + routingmenu->addAction(ttyact); + + QMenu* decodersettings; + decodersettings = strmdnmenu->addMenu("Decoder Settings"); + decodersettings->addAction(togglecng); + decodersettings->addAction(getcng); + decodersettings->addAction(toggleplc); + decodersettings->addAction(getplc); + decodersettings->addAction(setalawdecg711); + decodersettings->addAction(setulawdecg711); + decodersettings->addAction(getmodedecg711); + decodersettings->addAction(set20msdecilbc); + decodersettings->addAction(set30msdecilbc); + decodersettings->addAction(getmodedecilbc); + + QMenu* strmupmenu; + strmupmenu = menuBar()->addMenu("Uplink Stream"); + + strmupmenu->addAction(uplinkformats); + QMenu* encodermenu; + encodermenu = strmupmenu->addMenu("Init Encoder..."); + + strmupmenu->addAction(strmupstart); + strmupmenu->addAction(strmupstop); + strmupmenu->addAction(strmupclose); + + encodermenu->addAction(pcmenc); + encodermenu->addAction(amrenc); + encodermenu->addAction(g711enc); + encodermenu->addAction(g729enc); + encodermenu->addAction(ilbcenc); + + QMenu* micmenu; + micmenu = strmupmenu->addMenu("Mic Settings"); + micmenu->addAction(stmgainact); + micmenu->addAction(stmmaxgainact); + micmenu->addAction(stmsetgainact); + micmenu->addAction(stmmutegainact); + + QMenu* encodersettings; + encodersettings = strmupmenu->addMenu("Encoder Settings"); + encodersettings->addAction(getsupportedbr); + encodersettings->addAction(setminbr); + encodersettings->addAction(setmaxbr); + encodersettings->addAction(getbr); + encodersettings->addAction(togglevad); + encodersettings->addAction(getvad); + encodersettings->addAction(setalawencg711); + encodersettings->addAction(setulawencg711); + encodersettings->addAction(getmodeencg711); + encodersettings->addAction(set20msencilbc); + encodersettings->addAction(set30msencilbc); + encodersettings->addAction(getmodeencilbc); + + //DTMF tone player options + QMenu* dtmfmenu; + dtmfmenu = menuBar()->addMenu("DTMF Tone player"); + dtmfmenu->addAction(dtmfdninit); + dtmfmenu->addAction(dtmfdnplay); + dtmfmenu->addAction(dtmfdnstop); + dtmfmenu->addAction(dtmfupinit); + dtmfmenu->addAction(dtmfupplay); + dtmfmenu->addAction(dtmfupstop); + + //Inband tone options + QMenu* inbandmenu; + inbandmenu = menuBar()->addMenu("Inband Tones"); + inbandmenu->addAction(inbandbusy); + inbandmenu->addAction(inbandpathnotaval); + inbandmenu->addAction(inbandcongestion); + inbandmenu->addAction(inbandspecialinfo); + inbandmenu->addAction(inbandreorder); + inbandmenu->addAction(inbandremotealert); + inbandmenu->addAction(inbandcallwait); + inbandmenu->addAction(inbanddatacall); + inbandmenu->addAction(inbandnoseq); + inbandmenu->addAction(inbandbeepseq); + inbandmenu->addAction(inbandstop); + + QMenu* globalffectsmenu; + globalffectsmenu = menuBar()->addMenu("Global Effects"); + globalffectsmenu->addAction(globalvolact); + globalffectsmenu->addAction(globalmaxvolact); + globalffectsmenu->addAction(globalsetvolact); + globalffectsmenu->addAction(globalgainact); + globalffectsmenu->addAction(globalmaxgainact); + globalffectsmenu->addAction(globalsetgainact); + + + QMenu* rtmenu; + rtmenu = menuBar()->addMenu("RingTone Player"); + QMenu* rtmenuinit; + rtmenuinit = rtmenu->addMenu("Init Player"); + rtmenuinit->addAction(rtprofile); + rtmenuinit->addAction(rtaudiofile); + rtmenuinit->addAction(rttts); + rtmenuinit->addAction(rtbeep); + rtmenuinit->addAction(rtsilent); + rtmenu->addAction(rtplay); + rtmenu->addAction(rtmute); + rtmenu->addAction(rtpause); + rtmenu->addAction(rtstop); + rtmenu->addAction(rtdeinit); + + //One Touch Loopback + menuBar()->addAction(onetouch); + + menuBar()->addAction(exitAction); + } + +void TmsTestApp::qtmsengineslot() + { + statusDisplay->append("Using QT TMS api"); + iTmsEngine = QTmsTestEngine::NewL(statusDisplay); + + //After an engine has been selected hide option + enginemenu->menuAction()->setVisible(false); + } + +void TmsTestApp::tmsengineslot() + { + statusDisplay->append("Using openC TMS api"); + iTmsEngine = CTmsTestEngine::NewL(statusDisplay); + + //After an engine has been selected hide option + enginemenu->menuAction()->setVisible(false); + } + +void TmsTestApp::cscallslot() + { + CHECKENGINE + iTmsEngine->SetCallType(TMS_CALL_CS); + } +void TmsTestApp::ipcallslot() + { + CHECKENGINE + iTmsEngine->SetCallType(TMS_CALL_IP); + } +void TmsTestApp::downlinkformatsslot() + { + CHECKENGINE + iTmsEngine->GetSupportedDownlinkFormats(ETrue); + } +void TmsTestApp::strmdnstartslot() + { + CHECKENGINE + iTmsEngine->StartDownlink(); + } +void TmsTestApp::strmdnstopslot() + { + CHECKENGINE + iTmsEngine->StopDownlink(); + } +void TmsTestApp::strmdncloseslot() + { + CHECKENGINE + iTmsEngine->CloseDownlink(); + } +void TmsTestApp::uplinkformatsslot() + { + CHECKENGINE + iTmsEngine->GetSupportedUplinkFormats(ETrue); + } +void TmsTestApp::strmupstartslot() + { + CHECKENGINE + iTmsEngine->StartUplink(); + } +void TmsTestApp::strmupstopslot() + { + CHECKENGINE + iTmsEngine->StopUplink(); + } +void TmsTestApp::strmupcloseslot() + { + CHECKENGINE + iTmsEngine->CloseUplink(); + } +void TmsTestApp::dtmfdninitslot() + { + CHECKENGINE + iTmsEngine->InitDTMFTonePlayerDnlink(); + } +void TmsTestApp::dtmfdnplayslot() + { + CHECKENGINE + iTmsEngine->DTMFTonePlayDnlink(); + } +void TmsTestApp::dtmfdnstopslot() + { + CHECKENGINE + iTmsEngine->CloseDTMFPlayerDnlink(); + } +void TmsTestApp::dtmfupinitslot() + { + CHECKENGINE + iTmsEngine->InitDTMFTonePlayerUplink(); + } +void TmsTestApp::dtmfupplayslot() + { + CHECKENGINE + iTmsEngine->DTMFTonePlayUplink(); + } +void TmsTestApp::dtmfupstopslot() + { + CHECKENGINE + iTmsEngine->CloseDTMFPlayerUplink(); + } +void TmsTestApp::inbandbusyslot() + { + CHECKENGINE + iTmsEngine->StartInbandTone(TMS_INBAND_USER_BUSY); + } + void TmsTestApp::inbandpathnotavilslot() + { + CHECKENGINE + iTmsEngine->StartInbandTone(TMS_INBAND_RADIO_PATH_NOT_AVAIL); + } + void TmsTestApp::inbandcongestionslot() + { + CHECKENGINE + iTmsEngine->StartInbandTone(TMS_INBAND_CONGESTION); + } + void TmsTestApp::inbandspecialinfoslot() + { + CHECKENGINE + iTmsEngine->StartInbandTone(TMS_INBAND_SPECIAL_INFO); + } + void TmsTestApp::inbandremotealertslot() + { + CHECKENGINE + iTmsEngine->StartInbandTone(TMS_INBAND_REMOTE_ALEARTING); + } +void TmsTestApp::inbanddatacallslot() + { + CHECKENGINE + iTmsEngine->StartInbandTone(TMS_INBAND_DATA_CALL); + } +void TmsTestApp::inbandcallwaitslot() + { + CHECKENGINE + iTmsEngine->StartInbandTone(TMS_INBAND_CALL_WAITING); + } +void TmsTestApp::inbandreorderslot() + { + CHECKENGINE + iTmsEngine->StartInbandTone(TMS_INBAND_REORDER); + } +void TmsTestApp::inbandnoseqslot() + { + CHECKENGINE + iTmsEngine->StartInbandTone(TMS_INBAND_NO_SEQUENCE); + } +void TmsTestApp::inbandbeepseqslot() + { + CHECKENGINE + iTmsEngine->StartInbandTone(TMS_INBAND_BEEP_SEQUENCE); + } +void TmsTestApp::inbandstopslot() + { + CHECKENGINE + iTmsEngine->StopInbandTone(); + } +void TmsTestApp::globalvolslot() + { + CHECKENGINE + iTmsEngine->GetGlobalVol(); + } +void TmsTestApp::globalmaxvolslot() + { + CHECKENGINE + iTmsEngine->GetGlobalMaxVol(); + } +void TmsTestApp::globalsetvolslot() + { + CHECKENGINE + iTmsEngine->SetGlobalVol(); + } +void TmsTestApp::globalgainslot() + { + CHECKENGINE + iTmsEngine->GetGlobalGain(); + } +void TmsTestApp::globalmaxgainslot() + { + CHECKENGINE + iTmsEngine->GetGlobalMaxGain(); + } +void TmsTestApp::globalsetgainslot() + { + CHECKENGINE + iTmsEngine->SetGlobalGain(); + } +void TmsTestApp::stmgainslot() + { + CHECKENGINE + iTmsEngine->GetGain(); + } +void TmsTestApp::stmmaxgainslot() + { + CHECKENGINE + iTmsEngine->GetMaxGain(); + } +void TmsTestApp::stmsetgainslot() + { + CHECKENGINE + iTmsEngine->SetMaxGain(); + } +void TmsTestApp::stmmutegainslot() + { + CHECKENGINE + iTmsEngine->MuteMic(); + } +void TmsTestApp::stmvolslot() + { + CHECKENGINE + iTmsEngine->GetVolume(); + } +void TmsTestApp::stmmaxvolslot() + { + CHECKENGINE + iTmsEngine->GetMaxVolume(); + } +void TmsTestApp::stmsetvolslot() + { + CHECKENGINE + iTmsEngine->SetMaxVolume(); + } +void TmsTestApp::stmmutevolslot() + { + CHECKENGINE + iTmsEngine->MuteSpeaker(); + } +void TmsTestApp::handsetslot() + { + CHECKENGINE + iTmsEngine->SetOutputDevice(TMS_AUDIO_OUTPUT_HANDSET); + } +void TmsTestApp::loudspkrslot() + { + CHECKENGINE + iTmsEngine->SetOutputDevice(TMS_AUDIO_OUTPUT_LOUDSPEAKER); + } +void TmsTestApp::wiredslot() + { + CHECKENGINE + iTmsEngine->SetOutputDevice(TMS_AUDIO_OUTPUT_WIRED_ACCESSORY); + } +void TmsTestApp::btslot() + { + CHECKENGINE + iTmsEngine->SetOutputDevice(TMS_AUDIO_OUTPUT_ACCESSORY); + } +void TmsTestApp::ttyslot() + { + CHECKENGINE + iTmsEngine->SetOutputDevice(TMS_AUDIO_OUTPUT_ETTY); + } +void TmsTestApp::currentoutputslot() + { + CHECKENGINE + iTmsEngine->GetAudioDevice(); + } +void TmsTestApp::availoutputslot() + { + CHECKENGINE + iTmsEngine->GetAvailableOutput(); + } +void TmsTestApp::pcmdecslot() + { + CHECKENGINE + iTmsEngine->SetDownlinkFormat(TMS_FORMAT_PCM); + } + +void TmsTestApp::amrdecslot() + { + CHECKENGINE + iTmsEngine->SetDownlinkFormat(TMS_FORMAT_AMR); + } +void TmsTestApp::g711decslot() + { + CHECKENGINE + iTmsEngine->SetDownlinkFormat(TMS_FORMAT_G711); + } +void TmsTestApp::g729decslot() + { + CHECKENGINE + iTmsEngine->SetDownlinkFormat(TMS_FORMAT_G729); + } +void TmsTestApp::ilbcdecslot() + { + CHECKENGINE + iTmsEngine->SetDownlinkFormat(TMS_FORMAT_ILBC); + } +void TmsTestApp::pcmencslot() + { + CHECKENGINE + iTmsEngine->SetUplinkFormat(TMS_FORMAT_PCM); + } +void TmsTestApp::amrencslot() + { + CHECKENGINE + iTmsEngine->SetUplinkFormat(TMS_FORMAT_AMR); + } +void TmsTestApp::g711encslot() + { + CHECKENGINE + iTmsEngine->SetUplinkFormat(TMS_FORMAT_G711); + } +void TmsTestApp::g729encslot() + { + CHECKENGINE + iTmsEngine->SetUplinkFormat(TMS_FORMAT_G729); + } +void TmsTestApp::ilbcencslot() + { + CHECKENGINE + iTmsEngine->SetUplinkFormat(TMS_FORMAT_ILBC); + } +void TmsTestApp::togglecngslot() + { + CHECKENGINE + iTmsEngine->ToggleCng(); + } +void TmsTestApp::getcngslot() + { + CHECKENGINE + iTmsEngine->GetCng(); + } +void TmsTestApp::toggleplcslot() + { + CHECKENGINE + iTmsEngine->TogglePlc(); + } +void TmsTestApp::getplcslot() + { + CHECKENGINE + iTmsEngine->GetPlc(); + } +void TmsTestApp::setalawdecg711slot() + { + CHECKENGINE + iTmsEngine->SetDnLinkG711ALAW(); + } +void TmsTestApp::setulawdecg711slot() + { + CHECKENGINE + iTmsEngine->SetDnLinkG711uLAW(); + } +void TmsTestApp::getmodegdec711slot() + { + CHECKENGINE + iTmsEngine->GetDnLinkG711Mode(); + } +void TmsTestApp::set20msdecilbcslot() + { + CHECKENGINE + iTmsEngine->SetDnLinkILBC20MS(); + } +void TmsTestApp::set30msdecilbcslot() + { + CHECKENGINE + iTmsEngine->SetDnLinkILBC30MS(); + } +void TmsTestApp::getmodedecilbcslot() + { + CHECKENGINE + iTmsEngine->GetDnLinkILBCMode(); + } +void TmsTestApp::getsupportedbrslot() + { + CHECKENGINE + iTmsEngine->GetSupportedBitrates(); + } +void TmsTestApp::setminbrslot() + { + CHECKENGINE + iTmsEngine->SelectMinBitrate(); + } +void TmsTestApp::setmaxbrslot() + { + CHECKENGINE + iTmsEngine->SelectMaxBitrate(); + } +void TmsTestApp::getbrslot() + { + CHECKENGINE + iTmsEngine->GetBitrate(); + } +void TmsTestApp::togglevadslot() + { + CHECKENGINE + iTmsEngine->ToggleVad(); + } +void TmsTestApp::getvadslot() + { + CHECKENGINE + iTmsEngine->GetVad(); + } +void TmsTestApp::setalawencg711slot() + { + CHECKENGINE + iTmsEngine->SetUpLinkG711ALAW(); + } +void TmsTestApp::setulawencg711slot() + { + CHECKENGINE + iTmsEngine->SetUpLinkG711uLAW(); + } +void TmsTestApp::getmodeencg711slot() + { + CHECKENGINE + iTmsEngine->GetUpLinkG711Mode(); + } +void TmsTestApp::set20msencilbcslot() + { + CHECKENGINE + iTmsEngine->SetUpLinkILBC20MS(); + } +void TmsTestApp::set30msencilbcslot() + { + CHECKENGINE + iTmsEngine->SetUpLinkILBC30MS(); + } +void TmsTestApp::getmodeencilbcslot() + { + CHECKENGINE + iTmsEngine->GetUpLinkILBCMode(); + } +void TmsTestApp::rtplayslot() + { + CHECKENGINE + iTmsEngine->PlayRingTone(); + } +void TmsTestApp::rtpauseslot() + { + CHECKENGINE + iTmsEngine->PauseVideoRingTone(); + } +void TmsTestApp::rtmuteslot() + { + CHECKENGINE + iTmsEngine->MuteRingTone(); + } +void TmsTestApp::rtstopslot() + { + CHECKENGINE + iTmsEngine->StopRingTone(); + } +void TmsTestApp::rtdeinitslot() + { + CHECKENGINE + iTmsEngine->DeinitRingTonePlayer(); + } +void TmsTestApp::rtprofileslot() + { + CHECKENGINE + iTmsEngine->InitRingTonePlayerFromProfiles(); + } +void TmsTestApp::rtfileslot() + { + CHECKENGINE + iTmsEngine->InitRingTonePlayerFromFile(); + } +void TmsTestApp::rtttsslot() + { + CHECKENGINE + iTmsEngine->InitRingToneWithTTS(); + } +void TmsTestApp::rtbeepslot() + { + CHECKENGINE + iTmsEngine->InitRingToneBeepOnce(); + } +void TmsTestApp::rtsequenceslot() + { + CHECKENGINE + iTmsEngine->InitRingToneSequencePlayer(); + } +void TmsTestApp::rtsilentslot() + { + CHECKENGINE + iTmsEngine->InitRingToneSilent(); + } +void TmsTestApp::onetouchslot() + { + CHECKENGINE + iTmsEngine->OneTouchLoopback(); + } + +#include "../tmp/moc_qttmstestapp.cpp" + +