Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow ffmemless effects to be categorized as touch screen related #26

Merged
merged 3 commits into from
Oct 22, 2013

Conversation

kjokinie
Copy link
Contributor

If event is marked as a touch screen related, the touchscreen.vibrate.level is checked from current profile to see if we should play the effect or not. Makes it possible to make touchscreen effects also via ngfd (so that they are profile aware).

Kalle Jokiniemi added 3 commits October 22, 2013 13:22
To be able to follow touch vibration level setting in other
plugins, add it to the profile values that get tracked.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
Changed "not enabled" to "disabled" in debug print, looks much
more comprehensible.

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
Added new configuration option for effects that allow them to be
classified as touch screen related. For touch screen related effects
the touchscreen.vibrate.level is followed to determine if the effect
should be played or not.

The option can be enabled in ffmemless configuration file by adding
a "_TOUCH" postfixed configuration line. E.g. one could define NGF_SHORT
to be a touch screen related effect by adding to the .ini file:

NGF_SHORT_TOUCH = 1

Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
}

data = g_hash_table_lookup(ffm.effects, key);
if (data->touch_effect && n_value_get_int(touch_level) == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can n_value_get_int handle NULL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not 100% sure, the code is:

return (value && value->type == N_VALUE_TYPE_INT) ? value->value.i : 0;

I guess the first if(value && ...) fails, that should stop there and skip the pointer access, so it should work (and return 0) :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That being said, I actually bumped into this, as the profile plugin was not tracking the vibrate.level thing. So then it will not vibrate as the value goes to 0.. not sure should we actually then allow the playback. That actually might be better that way.

@rburchell
Copy link
Contributor

LGTM

kjokinie pushed a commit that referenced this pull request Oct 22, 2013
Allow ffmemless effects to be categorized as touch screen related
@kjokinie kjokinie merged commit b4b0e4d into nemomobile:master Oct 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants