*.mid in *.bar | developer.brewmp.com *.mid in *.bar | developer.brewmp.com

Developer

*.mid in *.bar

Forums:

Does somebody know how to include *.mid file in *.bar file??

.bri files can't be used to store anything but strings, images, and dialogs.
other resources like midi files are stored on the phones file system. you can store whatever you like in your application's directory. some phones also have a shared directory for general use.
phones also have a directory specificly for ringer files to be stored. if you are saving a midi file from your application, IRINGERMGR_Create decides where the phone wants the midi files stored and puts them there automaticly.

.bri files can't be used to store anything but strings, images, and dialogs.
other resources like midi files are stored on the phones file system. you can store whatever you like in your application's directory. some phones also have a shared directory for general use.
phones also have a directory specificly for ringer files to be stored. if you are saving a midi file from your application, IRINGERMGR_Create decides where the phone wants the midi files stored and puts them there automaticly.

nonsense, you can store anything you like in a BAR file, use the BINARY resource type and RESTYPE_BINARY in ISHELL_LoadResData.

nonsense, you can store anything you like in a BAR file, use the BINARY resource type and RESTYPE_BINARY in ISHELL_LoadResData.

what version of the brew resource editor are you using charliex?

what version of the brew resource editor are you using charliex?

i don't use the resource editor

i don't use the resource editor

The technique Charlie mentioned works with the BREW 3.0 resource editor. While BREW 3.0 resources do work with other BREW versions, there's a way to do it without having to use the 3.0 resource editor:
- Add the .midi (or any other file type for that matter) as an Image. This is the only section of the resource file that will let you put in files of any type.
Use ISHELL_LoadResData(Ex) to get the data. Afterwards, you'll have to bypass the IIMAGE header built-in by the resource file:
void *raw_data_ptr;
void *actual_data_ptr;
raw_data_ptr = ISHELL_LoadResData( ... );
//Now you can bypass the IIMAGE header in one of two ways...
actual_data_ptr = (byte *)raw_data_ptr + *((byte *)raw_data_ptr); //the FLARB method
//OR...
actual_data_ptr = RESBLOB_DATA(raw_data_ptr) //the little-known, poorly-documented BREW helper function
And then you should be able to plug the data pointed to by actual_data_ptr to do just about anything. Remember to use SDT_BUFFER for ISOUNDPLAYER (or the equivalent for IMEDIA, whatever that is - anyone?)
Last but not least: Remember when freeing the resource to FREE at raw_data_ptr, NOT actual_data_ptr!

The technique Charlie mentioned works with the BREW 3.0 resource editor. While BREW 3.0 resources do work with other BREW versions, there's a way to do it without having to use the 3.0 resource editor:
- Add the .midi (or any other file type for that matter) as an Image. This is the only section of the resource file that will let you put in files of any type.
Use ISHELL_LoadResData(Ex) to get the data. Afterwards, you'll have to bypass the IIMAGE header built-in by the resource file:
void *raw_data_ptr;
void *actual_data_ptr;
raw_data_ptr = ISHELL_LoadResData( ... );
//Now you can bypass the IIMAGE header in one of two ways...
actual_data_ptr = (byte *)raw_data_ptr + *((byte *)raw_data_ptr); //the FLARB method
//OR...
actual_data_ptr = RESBLOB_DATA(raw_data_ptr) //the little-known, poorly-documented BREW helper function
And then you should be able to plug the data pointed to by actual_data_ptr to do just about anything. Remember to use SDT_BUFFER for ISOUNDPLAYER (or the equivalent for IMEDIA, whatever that is - anyone?)
Last but not least: Remember when freeing the resource to FREE at raw_data_ptr, NOT actual_data_ptr!

thanks goldendevil that cleared it up for me :o

thanks goldendevil that cleared it up for me :o

it works pre 3.0 too, you don't need all that extra stuff.
just use the resource compiler instead.

it works pre 3.0 too, you don't need all that extra stuff.
just use the resource compiler instead.