How to get/set properties?

Started by Marsu42, March 18, 2013, 08:13:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Marsu42

Ok, simple /me is trying to add some saved/set properties to expo. presets (see http://www.magiclantern.fm/forum/index.php?topic=4861.0)... but in the meantime from when I last looked at the code I forgot again :-\ how the property thing works. Is there a tutorial somewhere on how to do it - via handlers or directly?

The three things I like to set are like this, but how do I get them in the first place - _get_prop(int prop) doesn't seem to be reliable?


prop_request_change(AF_MODE, &c_af, 4);
prop_request_change(PROP_DRIVE, &c_drive, 4);
prop_request_change(PROP_METERING_MODE, &c_meter, 4);




1%

Read them something like this:


PROP_HANDLER(PROP_AFPOINT)
{
    afp[0] = buf[0];
    afp[1] = buf[1];
    afp_len = len;
}



Set like this:


afp[0]=0xca00;
prop_request_change(PROP_AFPOINT, afp, afp_len);

Marsu42

Quote from: 1% on March 19, 2013, 05:33:49 AM
Read them something like this

Doh, that was different than I expected - is this only like that for af points or the same for 1) drive and 2) metering modes, too?

1%

Some props have more buf
  • maybe depending on size. These are only length of 4 so maybe prop ints.

    PROP_INT(PROP_AF_MODE, newaf);