Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

I am throwing the event “play” from my trig to “/actor/circleactor”

As shown below.

Now when I receive the event in the actor.

I receive the TrigmlValue structure values as follows.

uint16 type; à TRIGMLVALUETYPE_ARRAY (35)

uint16 flags; à 0

void * data; à 0x122334 --- Question is related to this line

uint32 arg; à 0

Question

What does this “data” pointer represent. How it can be comprehended to play the ringtone associated with the “ringer/american”

As per the documentation this “data” represents a null-terminated array of pointers to TrigmlValue. But actually not clear what it means and how to use this data

I'm pretty sure it is up to you to connect the dots here.
You know what you're passing in via TrigML (TRIGMLVALUETYPE_STRING or TRIGMLVALUETYPE_PATH -- I'm guessing it would be a string), so you'll get an array of one string in your example circleactor.
Another example could be:

In this case you'd have an array of 2 values. The first would be a string (TRIGMLVALUETYPE_STRING) and the second of type int (TRIGMLVALUETYPE_INTEGER)
hope that helps.

I'm pretty sure it is up to you to connect the dots here.
You know what you're passing in via TrigML (TRIGMLVALUETYPE_STRING or TRIGMLVALUETYPE_PATH -- I'm guessing it would be a string), so you'll get an array of one string in your example circleactor.
Another example could be:

In this case you'd have an array of 2 values. The first would be a string (TRIGMLVALUETYPE_STRING) and the second of type int (TRIGMLVALUETYPE_INTEGER)
hope that helps.

Hi sppedbacon,
Thanks for ur tip.
But my problem is still not resolved.
I want to play a ringtone present as a resource in the trigml resource.
The resource path for the ringtome is ringer/american
Here I am pasting my trigml code and the corresponding actor code.
TRIGML
ACTOR
TrigmlParam** trigParams = NULL;
trigParams = trigEvent->params;
// trigParams[0]
// trigParams[0]->paramName = res
// trigParams[0]->value->type = 35
// trigParams[0]->value->flags = 0
// trigParams[0]->value->data = 0x5353530
// trigParams[0]->value->arg = 0
TrigmlValue **abc = ( TrigmlValue **)trigParams[0]->value->data;
TrigmlValue * xyz = abc[0];
TrigmlValue * mno = abc[1];
TrigmlValue * m = abc[2];
// xyz[0]
// xyz->type = 33
// xyz->flags = 0
// xyz->data = 0x4567812 ("ringer")
// xyz->arg = 14 (strlen("ringer") + 1) * 2
// mno[0]
// mno->type = 33
// mno->flags = 0
// mno->data = 0x7567676 ("american")
// mno->arg = 18 (strlen("american") + 1) * 2
// m[0]
// m = NULL (null terminated TrigmlValue array)
Using this info how I am suppose to play the ringtone via Imedia ? or ISound ??
or I have to do something else ??
Thanx in advance .....
Gaurav -

Hi sppedbacon,
Thanks for ur tip.
But my problem is still not resolved.
I want to play a ringtone present as a resource in the trigml resource.
The resource path for the ringtome is ringer/american
Here I am pasting my trigml code and the corresponding actor code.
TRIGML
ACTOR
TrigmlParam** trigParams = NULL;
trigParams = trigEvent->params;
// trigParams[0]
// trigParams[0]->paramName = res
// trigParams[0]->value->type = 35
// trigParams[0]->value->flags = 0
// trigParams[0]->value->data = 0x5353530
// trigParams[0]->value->arg = 0
TrigmlValue **abc = ( TrigmlValue **)trigParams[0]->value->data;
TrigmlValue * xyz = abc[0];
TrigmlValue * mno = abc[1];
TrigmlValue * m = abc[2];
// xyz[0]
// xyz->type = 33
// xyz->flags = 0
// xyz->data = 0x4567812 ("ringer")
// xyz->arg = 14 (strlen("ringer") + 1) * 2
// mno[0]
// mno->type = 33
// mno->flags = 0
// mno->data = 0x7567676 ("american")
// mno->arg = 18 (strlen("american") + 1) * 2
// m[0]
// m = NULL (null terminated TrigmlValue array)
Using this info how I am suppose to play the ringtone via Imedia ? or ISound ??
or I have to do something else ??
Thanx in advance .....
Gaurav -

IRINGERMGR_PlayFile is probably the best thing to use, but you could use whatever you want depending on the type of file you have.
// pseudocode, may have errors :)
WSTRTOSTR((AECHAR*)mno->data, myRingerName, sizeof(myRingerName));
SPRINTF(myPlayPath, sizeof(myPlayPath), "%s%s%s", AEE_RINGER_DIR, DIRECTORY_STR, myRingerName);
brewResult = IRINGERMGR_PlayFile(myRingerMgr, myPlayPath, 0);
good luck

IRINGERMGR_PlayFile is probably the best thing to use, but you could use whatever you want depending on the type of file you have.
// pseudocode, may have errors :)
WSTRTOSTR((AECHAR*)mno->data, myRingerName, sizeof(myRingerName));
SPRINTF(myPlayPath, sizeof(myPlayPath), "%s%s%s", AEE_RINGER_DIR, DIRECTORY_STR, myRingerName);
brewResult = IRINGERMGR_PlayFile(myRingerMgr, myPlayPath, 0);
good luck

My ringtone is part of the trigml VFS resource.
The path of this resource in the VFS is "ringer/American".
The file to be played is not present on device file structure.
Any way to play the ringtone from the vfs resource ?

My ringtone is part of the trigml VFS resource.
The path of this resource in the VFS is "ringer/American".
The file to be played is not present on device file structure.
Any way to play the ringtone from the vfs resource ?