How to get the enumerated list of ringtones in simulator. | developer.brewmp.com How to get the enumerated list of ringtones in simulator. | developer.brewmp.com

Developer

How to get the enumerated list of ringtones in simulator.

Forums:

Hi

I want to set a rigtone to IM client application when user select any one ringtone available, for audio indication.

I want to enumerate the list of ringtones available in the simulator. Does ringtones have a dedicated path to enumerate the list.

I am using the following code:

iStatus = ISHELL_CreateInstance(m_piShell, AEECLSID_RINGERMGR, (void **)&m_pIRingerMgr);   

if (SUCCESS != (iStatus = IRINGERMGR_EnumRingerInit(m_pIRingerMgr)))

    while(IRINGERMGR_EnumNextRinger(m_pIRingerMgr, &ringerinfo))   {

}

when i use IRINGERMGR_EnumRingerInit(), where does it look in the simulator and as well as target?

please help me doing this.

It will enumerate ringer files available in AEEFS_RINGERS_DIR

It will enumerate ringer files available in AEEFS_RINGERS_DIR

I have created a dir in my simulator path'C:\Brew MP\Targets\Sapphire (1.0.2.549.1)(1)\fs\ringers".  I have also place few files .mp3 in this.
In the CIF file i have specified AEEPRIVID_PLRinger = 0x0100 -- Declare and
Applet {   appletid       =  AEECLSID_MUNDUIM,   resbaseid      =  20, -- Applet base resource id   applethostid   =  0,   type           =  0,   privs          = {AEEPRIVID_FileSystemRW, AEECLSID_FileSystem2, AEEPRIVID_PLFile,AEEPRIVID_PLNetwork,AEEPRIVID_PLWeb,AEEPRIVID_PLSharedWrite,AEEPRIVID_PLSystem,AEEPRIVID_PLRinger },}
Now when i am using the above code inculding this
while(IRINGERMGR_EnumNextRinger(m_pIRingerMgr, &ringerinfo))   ,  this function is always returning false. It is not able to enumerate the list of files.  To be more specific, i want to enumerate the list of files available in this and show to user so that he can select any of the ringer file to alert his IM client.
Please help me.

I have created a dir in my simulator path'C:\Brew MP\Targets\Sapphire (1.0.2.549.1)(1)\fs\ringers".  I have also place few files .mp3 in this.
In the CIF file i have specified AEEPRIVID_PLRinger = 0x0100 -- Declare and
Applet {   appletid       =  AEECLSID_MUNDUIM,   resbaseid      =  20, -- Applet base resource id   applethostid   =  0,   type           =  0,   privs          = {AEEPRIVID_FileSystemRW, AEECLSID_FileSystem2, AEEPRIVID_PLFile,AEEPRIVID_PLNetwork,AEEPRIVID_PLWeb,AEEPRIVID_PLSharedWrite,AEEPRIVID_PLSystem,AEEPRIVID_PLRinger },}
Now when i am using the above code inculding this
while(IRINGERMGR_EnumNextRinger(m_pIRingerMgr, &ringerinfo))   ,  this function is always returning false. It is not able to enumerate the list of files.  To be more specific, i want to enumerate the list of files available in this and show to user so that he can select any of the ringer file to alert his IM client.
Please help me.

I have created a dir in my simulator path'C:\Brew MP\Targets\Sapphire (1.0.2.549.1)(1)\fs\ringers".  I have also place few files .mp3 in this.
In the CIF file i have specified AEEPRIVID_PLRinger = 0x0100 -- Declare and
Applet {   appletid       =  AEECLSID_MUNDUIM,   resbaseid      =  20, -- Applet base resource id   applethostid   =  0,   type           =  0,   privs          = {AEEPRIVID_FileSystemRW, AEECLSID_FileSystem2, AEEPRIVID_PLFile,AEEPRIVID_PLNetwork,AEEPRIVID_PLWeb,AEEPRIVID_PLSharedWrite,AEEPRIVID_PLSystem,AEEPRIVID_PLRinger },}
Now when i am using the above code inculding this
while(IRINGERMGR_EnumNextRinger(m_pIRingerMgr, &ringerinfo))   ,  this function is always returning false. It is not able to enumerate the list of files.  To be more specific, i want to enumerate the list of files available in this and show to user so that he can select any of the ringer file to alert his IM client.
Please help me.

I have created a dir in my simulator path'C:\Brew MP\Targets\Sapphire (1.0.2.549.1)(1)\fs\ringers".  I have also place few files .mp3 in this.
In the CIF file i have specified AEEPRIVID_PLRinger = 0x0100 -- Declare and
Applet {   appletid       =  AEECLSID_MUNDUIM,   resbaseid      =  20, -- Applet base resource id   applethostid   =  0,   type           =  0,   privs          = {AEEPRIVID_FileSystemRW, AEECLSID_FileSystem2, AEEPRIVID_PLFile,AEEPRIVID_PLNetwork,AEEPRIVID_PLWeb,AEEPRIVID_PLSharedWrite,AEEPRIVID_PLSystem,AEEPRIVID_PLRinger },}
Now when i am using the above code inculding this
while(IRINGERMGR_EnumNextRinger(m_pIRingerMgr, &ringerinfo))   ,  this function is always returning false. It is not able to enumerate the list of files.  To be more specific, i want to enumerate the list of files available in this and show to user so that he can select any of the ringer file to alert his IM client.
Please help me.

Can you please try the same on handset?

Can you please try the same on handset?

Hi Anjani,
For the above mentioned simulator target, the enumeration is perfomed for the directory "C:\Brew MP\Targets\Sapphire (1.0.2.549.1)\fs\mod\ringers". If there are ringtones available in this folder, then the enumeration should work fine.
Below is the code snippet I had used for enumeration:
AEEResult App_IRingerMgr_EnumRingerInit(IRingerMgr *pIRingerMgr){   AEEResult nErr;   AEERingerInfo nRingerInfo;   int nCount = 0;   boolean nStatus;
   /* Enumerate the ringer list */   nErr = IRINGERMGR_EnumRingerInit(pIRingerMgr);   if(AEE_SUCCESS != nErr)   {      return nErr;   }
   /* Parse through the enumerated list */   do   {      nStatus = IRINGERMGR_EnumNextRinger(pIRingerMgr, &nRingerInfo);      if(FALSE == nStatus)      {         break;      }      nCount++;
   }while(TRUE == nStatus);
   DBGPRINTF("Enumerated [%d] ringtones", nCount);      return AEE_SUCCESS;
}
 
Regards,
Suresh Kumar S

Hi Anjani,
For the above mentioned simulator target, the enumeration is perfomed for the directory "C:\Brew MP\Targets\Sapphire (1.0.2.549.1)\fs\mod\ringers". If there are ringtones available in this folder, then the enumeration should work fine.
Below is the code snippet I had used for enumeration:
AEEResult App_IRingerMgr_EnumRingerInit(IRingerMgr *pIRingerMgr){   AEEResult nErr;   AEERingerInfo nRingerInfo;   int nCount = 0;   boolean nStatus;
   /* Enumerate the ringer list */   nErr = IRINGERMGR_EnumRingerInit(pIRingerMgr);   if(AEE_SUCCESS != nErr)   {      return nErr;   }
   /* Parse through the enumerated list */   do   {      nStatus = IRINGERMGR_EnumNextRinger(pIRingerMgr, &nRingerInfo);      if(FALSE == nStatus)      {         break;      }      nCount++;
   }while(TRUE == nStatus);
   DBGPRINTF("Enumerated [%d] ringtones", nCount);      return AEE_SUCCESS;
}
 
Regards,
Suresh Kumar S

Hi,
I am trying to create a ringer from an existing file to identify where that ringer will be created in both the simulator and target. But ringer could not be created. I hope there is no problem with  the below code. please help me tha reson it is failing. And also in the target what is the path ringermanager access?
if(m_pIRingerMgr == NULL){  ISHELL_CreateInstance(pMe->piShell, AEECLSID_RINGERMGR, (void **)&m_pIRingerMgr);    }
 if ((m_pIRingerMgr != NULL) && (ISHELL_CreateInstance(pMe->piShell, AEECLSID_FILEMGR, (void **)(&m_pIFileMgr)) == SUCCESS)) {    // Create an instance of IFileMgr so we can access the file  if ((m_pIFile = IFILEMGR_OpenFile(m_pIFileMgr, "fs:/shared/BEEP_ALERT.mp3"/*"fs:/shared/ringermgr/Alert.mp3"*/, _OFM_READ)) != NULL)  {       IFILE_GetInfo(m_pIFile, &fi);      if ((m_pBuff = (byte *) MALLOC(fi.dwSize)) != NULL)   {       if ((IFILE_Read(m_pIFile, (void *)m_pBuff, fi.dwSize) != 0 &&ISHELL_CreateInstance(pMe->piShell,AEECLSID_MEMASTREAM, (void **)(&m_pMemStream)) == SUCCESS))    {       IMEMASTREAM_Set(m_pMemStream, m_pBuff, fi.dwSize, 0, FALSE);         if (IRINGERMGR_Create(m_pIRingerMgr, (AECHAR*)"create",AEE_SOUNDPLAYER_FILE_MP3, (IAStream*)m_pMemStream) == SUCCESS)     {            result = TRUE;     }     else     {      DBGPRINTF("Ringer COULD NOT be created");     }    }    else    {          FREE(m_pBuff);     m_pBuff = NULL;    }   }  } }

Hi,
I am trying to create a ringer from an existing file to identify where that ringer will be created in both the simulator and target. But ringer could not be created. I hope there is no problem with  the below code. please help me tha reson it is failing. And also in the target what is the path ringermanager access?
if(m_pIRingerMgr == NULL){  ISHELL_CreateInstance(pMe->piShell, AEECLSID_RINGERMGR, (void **)&m_pIRingerMgr);    }
 if ((m_pIRingerMgr != NULL) && (ISHELL_CreateInstance(pMe->piShell, AEECLSID_FILEMGR, (void **)(&m_pIFileMgr)) == SUCCESS)) {    // Create an instance of IFileMgr so we can access the file  if ((m_pIFile = IFILEMGR_OpenFile(m_pIFileMgr, "fs:/shared/BEEP_ALERT.mp3"/*"fs:/shared/ringermgr/Alert.mp3"*/, _OFM_READ)) != NULL)  {       IFILE_GetInfo(m_pIFile, &fi);      if ((m_pBuff = (byte *) MALLOC(fi.dwSize)) != NULL)   {       if ((IFILE_Read(m_pIFile, (void *)m_pBuff, fi.dwSize) != 0 &&ISHELL_CreateInstance(pMe->piShell,AEECLSID_MEMASTREAM, (void **)(&m_pMemStream)) == SUCCESS))    {       IMEMASTREAM_Set(m_pMemStream, m_pBuff, fi.dwSize, 0, FALSE);         if (IRINGERMGR_Create(m_pIRingerMgr, (AECHAR*)"create",AEE_SOUNDPLAYER_FILE_MP3, (IAStream*)m_pMemStream) == SUCCESS)     {            result = TRUE;     }     else     {      DBGPRINTF("Ringer COULD NOT be created");     }    }    else    {          FREE(m_pBuff);     m_pBuff = NULL;    }   }  } }

Hi,
I am trying to create a ringer from an existing file to identify where that ringer will be created in both the simulator and target. But ringer could not be created. I hope there is no problem with  the below code. please help me tha reson it is failing. And also in the target what is the path ringermanager access?
if(m_pIRingerMgr == NULL){  ISHELL_CreateInstance(pMe->piShell, AEECLSID_RINGERMGR, (void **)&m_pIRingerMgr);    }
 if ((m_pIRingerMgr != NULL) && (ISHELL_CreateInstance(pMe->piShell, AEECLSID_FILEMGR, (void **)(&m_pIFileMgr)) == SUCCESS)) {    // Create an instance of IFileMgr so we can access the file  if ((m_pIFile = IFILEMGR_OpenFile(m_pIFileMgr, "fs:/shared/BEEP_ALERT.mp3"/*"fs:/shared/ringermgr/Alert.mp3"*/, _OFM_READ)) != NULL)  {       IFILE_GetInfo(m_pIFile, &fi);      if ((m_pBuff = (byte *) MALLOC(fi.dwSize)) != NULL)   {       if ((IFILE_Read(m_pIFile, (void *)m_pBuff, fi.dwSize) != 0 &&ISHELL_CreateInstance(pMe->piShell,AEECLSID_MEMASTREAM, (void **)(&m_pMemStream)) == SUCCESS))    {       IMEMASTREAM_Set(m_pMemStream, m_pBuff, fi.dwSize, 0, FALSE);         if (IRINGERMGR_Create(m_pIRingerMgr, (AECHAR*)"create",AEE_SOUNDPLAYER_FILE_MP3, (IAStream*)m_pMemStream) == SUCCESS)     {            result = TRUE;     }     else     {      DBGPRINTF("Ringer COULD NOT be created");     }    }    else    {          FREE(m_pBuff);     m_pBuff = NULL;    }   }  } }

Hi,
I am trying to create a ringer from an existing file to identify where that ringer will be created in both the simulator and target. But ringer could not be created. I hope there is no problem with  the below code. please help me tha reson it is failing. And also in the target what is the path ringermanager access?
if(m_pIRingerMgr == NULL){  ISHELL_CreateInstance(pMe->piShell, AEECLSID_RINGERMGR, (void **)&m_pIRingerMgr);    }
 if ((m_pIRingerMgr != NULL) && (ISHELL_CreateInstance(pMe->piShell, AEECLSID_FILEMGR, (void **)(&m_pIFileMgr)) == SUCCESS)) {    // Create an instance of IFileMgr so we can access the file  if ((m_pIFile = IFILEMGR_OpenFile(m_pIFileMgr, "fs:/shared/BEEP_ALERT.mp3"/*"fs:/shared/ringermgr/Alert.mp3"*/, _OFM_READ)) != NULL)  {       IFILE_GetInfo(m_pIFile, &fi);      if ((m_pBuff = (byte *) MALLOC(fi.dwSize)) != NULL)   {       if ((IFILE_Read(m_pIFile, (void *)m_pBuff, fi.dwSize) != 0 &&ISHELL_CreateInstance(pMe->piShell,AEECLSID_MEMASTREAM, (void **)(&m_pMemStream)) == SUCCESS))    {       IMEMASTREAM_Set(m_pMemStream, m_pBuff, fi.dwSize, 0, FALSE);         if (IRINGERMGR_Create(m_pIRingerMgr, (AECHAR*)"create",AEE_SOUNDPLAYER_FILE_MP3, (IAStream*)m_pMemStream) == SUCCESS)     {            result = TRUE;     }     else     {      DBGPRINTF("Ringer COULD NOT be created");     }    }    else    {          FREE(m_pBuff);     m_pBuff = NULL;    }   }  } }

Code looks good to me. Please check which API failed and what is the error code received. Please use "Insert code using syntax highlighter" tool (last button) to insert code in readable format.

Code looks good to me. Please check which API failed and what is the error code received. Please use "Insert code using syntax highlighter" tool (last button) to insert code in readable format.

Thank you for the reply. The problem is with the priviliges in the cif file. AEEPRIVID_PLRinger. With this previliges given i am able to create the ringer.
In Simulator: the ringer path is "fs:/mod/ringers/" as specified erlier.
For target : the path is "fs:/user/sounds/ringer/"
Thank you.

Thank you for the reply. The problem is with the priviliges in the cif file. AEEPRIVID_PLRinger. With this previliges given i am able to create the ringer.
In Simulator: the ringer path is "fs:/mod/ringers/" as specified erlier.
For target : the path is "fs:/user/sounds/ringer/"
Thank you.

Thank you for the reply. The problem is with the priviliges in the cif file. AEEPRIVID_PLRinger. With this previliges given i am able to create the ringer.
In Simulator: the ringer path is "fs:/mod/ringers/" as specified erlier.
For target : the path is "fs:/user/sounds/ringer/"
Thank you.

Thank you for the reply. The problem is with the priviliges in the cif file. AEEPRIVID_PLRinger. With this previliges given i am able to create the ringer.
In Simulator: the ringer path is "fs:/mod/ringers/" as specified erlier.
For target : the path is "fs:/user/sounds/ringer/"
Thank you.