×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    Default video directory in Symbian^3

    Hi,
    I have developed an application for 5th edition that read all video files from the Galllery->Images & Videos folder of the device
    Code:
    RFs& rfs = iEikonEnv->FsSession();
    	    CDir* fileList = NULL;
    	    
    	    iFilesVideoAlarm.Reset();
    
    	    TFileName path = PathInfo::PhoneMemoryRootPath(); 
    	    path.Append(PathInfo::VideosPath());
    	    
    	    User::LeaveIfError(rfs.GetDir(path,KEntryAttNormal,ESortByName,fileList));
    	 ...
    But the same app is not able to read the video files in the Symbian^3 (N8) device.
    I want to read the videos that are in the Photos folder of N8
    What shoud I set here path.Append(PathInfo::VideosPath());

    I have checked that with this code I can read the videos that are in the Video folder of the phone memory, but I can't read the video files that are in the memory card.


    I want to access the videos that are in the Gallery (5th) and Photes (S^3) .
    Last edited by v-6; 2011-06-08 at 10:33. Reason: added

  2. #2
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    How to read video files from the device

    Hi,
    I want to read the video file path/name from the device, the video file may be in C:/, E:/, or in F:/ anywhere in the device.
    In another word I want to read the gallery->images & videos folder (5th edition) and photos (S^3)
    I have used the below code to read the all video files that are in the video folder in C:/ drive
    Code:
    TFileName path = PathInfo::PhoneMemoryRootPath(); 
    	    path.Append(PathInfo::VideosPath());

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: How to read video files from the device

    Starting from S60 3rd FP2, you can use DriveInfo API for getting information about additional drives (PahInfo is a really old API, it does not know about multiple mass storage drives for example).

  4. #4
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    Re: How to read video files from the device

    Quote Originally Posted by wizard_hu_ View Post
    Starting from S60 3rd FP2, you can use DriveInfo API for getting information about additional drives (PahInfo is a really old API, it does not know about multiple mass storage drives for example).
    Thank you wizard, could you please tell me what change do I need to make in my code to get the all video file in the the deivce
    if my code is
    Code:
     RFs& rfs = iEikonEnv->FsSession();
    	    CDir* fileList = NULL;
    	    
    	    iFilesVideoAlarm.Reset();
    
    	    TFileName path = PathInfo::PhoneMemoryRootPath(); 
    	    path.Append(PathInfo::VideosPath());
    	    
    	    User::LeaveIfError(rfs.GetDir(path,KEntryAttNormal,ESortByName,fileList));

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    Re: How to read video files from the device

    I got something like this from SDK
    Code:
      #include <DriveInfo.h>
    
      // Get the drive identifier of the default removable mass storage.
      TInt drive;
      User::LeaveIfError( DriveInfo::GetDefaultDrive(
          DriveInfo::EDefaultRemovableMassStorage, drive ) );
    
      // 'drive' contains now the drive identifier of the default removable mass storage.
    
      // Get the drive status of the default removable mass storage.
      TUint status;
      User::LeaveIfError( DriveInfo::GetDriveStatus( fs, drive, status ) );
    
      // 'status' contains now the drive status of the default removable mass storage.
    
      // Get all drives that are visible to the user in TDriveList.
      TDriveList driveList;
      TInt driveCount;
      User::LeaveIfError( DriveInfo::GetUserVisibleDrives( fs, driveList, driveCount ) );
    
      // 'driveList' contains now the user visible drives.
      // 'driveCount'contains now the drive count i.e. number of non zero items in driveList.
    
      // Access the drives stored in 'driveList'
      TInt driveListLen( driveList.Length() ); // The length of 'driveList'
      for( TInt i( 0 ); i < driveListLen; ++i )
          {
          if ( driveList[ i ] ) // Non zero items are valid drives
              {
              // 'i' contains drive identifier specified by TDriveNumber
              // ...
              }
          }
    
      // Get all drives that are visible to the user in DriveInfo::TDriveArray.
      DriveInfo::TDriveArray driveArray;
      User::LeaveIfError( DriveInfo::GetUserVisibleDrives( fs, driveArray ) );
    
      // 'driveArray' contains now the user visible drives.
    
      // Access the drives stored in 'driveArray'
      driveCount = driveArray.Count() ); // The number of drives stored in 'driveArray'
      for( TInt i( 0 ); i < driveCount; ++i )
          {
          TDriveNumber drive( driveArray[ i ] ); // The drive identifier at position 'i'
          TChar driveLetter( driveArray.LetterAt( i ) ); // The drive letter at position 'i'
          // ...
          }
    I think i am looking something like this.
    But how do I use it in my code, my existing code is
    Code:
     RFs& rfs = iEikonEnv->FsSession();
    	    CDir* fileList = NULL;
    	    
    	    iFilesVideoAlarm.Reset();
    
    	    TFileName path = PathInfo::PhoneMemoryRootPath();
    	   
    	   
    	   
    	    path.Append(PathInfo::VideosPath());
    	    
    	    User::LeaveIfError(rfs.GetDir(path,KEntryAttNormal,ESortByName,fileList));
    	    
    	    for( TInt i = 0; i < fileList->Count(); i++ )
    	        {
    	        // Read only files to array
    	        if (!fileList->operator[](i).IsDir())
    	            {
    	            TFileName filename;
    	            filename.Append(path);
    	            filename.Append(fileList->operator[](i).iName);
    	            filename.LowerCase();
    	            // We support only JPG, BMP,  GIF
    	            if ( filename.Find(_L(".jpg"))!=KErrNotFound || 
    	                 filename.Find(_L(".flv"))!=KErrNotFound || 
    	                 filename.Find(_L(".3gp"))!=KErrNotFound ||
    	                 filename.Find(_L(".mp4"))!=KErrNotFound ) 
    	                {
    	                iFilesVideo.Append(filename);
    	                }
    	            }
    	        }
    	    
    	    delete fileList;
    please help me by modifying my code, if possible

  6. #6
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    Re: Default video directory in Symbian^3

    any one please help me i am not that expart in this

  7. #7
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,349

    Re: Default video directory in Symbian^3

    Quote Originally Posted by v-6 View Post
    any one please help me i am not that expart in this
    you can use this part from the SDk code
    Code:
     // Get all drives that are visible to the user in DriveInfo::TDriveArray.
          DriveInfo::TDriveArray driveArray;
          User::LeaveIfError( DriveInfo::GetUserVisibleDrives(rfs, driveArray ) );
    
          // 'driveArray' contains now the user visible drives.
    
          // Access the drives stored in 'driveArray'
          TInt driveCount;
          driveCount = driveArray.Count() ; // The number of drives stored in 'driveArray'
          
               
          for( TInt i( 0 ); i < driveCount; ++i )
              {
              TDriveNumber drive( driveArray[ i ] ); // The drive identifier at position 'i'
              TChar driveLetter( driveArray.LetterAt( i ) ); // The drive letter at position 'i'
              //..
             
              if(drive == EDriveC)
            	  {
                      }
    else  if(drive == EDriveE)
            	  {
                      }
    else  if(drive == EDriveF)
            	  {
                      }
    }
    this will give you all the drives present in the device, and with that you need to set the path that you want to fetch.

  8. #8
    Registered User
    Join Date
    Oct 2010
    Posts
    136

    Re: Default video directory in Symbian^3

    Quote Originally Posted by somnathbanik View Post
    you can use this part from the SDk code
    Code:
     // Get all drives that are visible to the user in DriveInfo::TDriveArray.
          DriveInfo::TDriveArray driveArray;
          User::LeaveIfError( DriveInfo::GetUserVisibleDrives(rfs, driveArray ) );
    
          // 'driveArray' contains now the user visible drives.
    
          // Access the drives stored in 'driveArray'
          TInt driveCount;
          driveCount = driveArray.Count() ; // The number of drives stored in 'driveArray'
          
               
          for( TInt i( 0 ); i < driveCount; ++i )
              {
              TDriveNumber drive( driveArray[ i ] ); // The drive identifier at position 'i'
              TChar driveLetter( driveArray.LetterAt( i ) ); // The drive letter at position 'i'
              //..
             
              if(drive == EDriveC)
            	  {
                      }
    else  if(drive == EDriveE)
            	  {
                      }
    else  if(drive == EDriveF)
            	  {
                      }
    }
    this will give you all the drives present in the device, and with that you need to set the path that you want to fetch.
    You are GREAT. This code can get all the video files from a particular folder(video) in each drive, but if in case I want to get the video file list from other folder like sound, Images, then i guess i need to hard code the folder path, Is there any possibility I can get all the all the video file list in the device, like the Photos->All has in N8

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: Default video directory in Symbian^3

    There is no direct API for that. MGFetch (MG=Media Gallery) is a close one, but it displays its own list. You can try checking in the source code how it gets its content.
    However not even the gallery application knows about everything, see http://wiki.forum.nokia.com/index.ph...pdate_its_view

Similar Threads

  1. plzzz help to change the default directory
    By AshOoO in forum Symbian
    Replies: 3
    Last Post: 2010-11-19, 22:07
  2. Replies: 1
    Last Post: 2010-03-13, 17:23
  3. Replies: 0
    Last Post: 2008-01-30, 13:51
  4. Directory Structure in Symbian
    By tonmoy_symbian in forum Symbian
    Replies: 4
    Last Post: 2006-10-17, 06:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •