Tizen Native API
5.0
|
The FEEDBACK API provides functions to play sound or vibration associated with properties.
#include <feedback.h>
The FEEDBACK API is responsible for playing simple sound and vibration. It plays sound using mm-sound library and vibration with system framework.
This API is related with the following features:
It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature List.
Functions | |
int | feedback_initialize (void) |
Initializes feedback API. | |
int | feedback_deinitialize (void) |
Deinitializes feedback API. | |
int | feedback_play (feedback_pattern_e pattern) |
Plays various types of reactions that are pre-defined. | |
int | feedback_play_type (feedback_type_e type, feedback_pattern_e pattern) |
Plays specific type of reactions that are pre-defined. | |
int | feedback_stop (void) |
Stops various types of reactions. | |
int | feedback_is_supported_pattern (feedback_type_e type, feedback_pattern_e pattern, bool *status) |
Checks if the pattern is supported. |
enum feedback_error_e |
Enumeration for the Feedback API error codes.
enum feedback_pattern_e |
Enumeration for feedback interface of the system pre-defined patterns.
Each feedback pattern can have separate media files of each types. But depending on vendor design, pattern may not have any type of file.
enum feedback_type_e |
int feedback_deinitialize | ( | void | ) |
Deinitializes feedback API.
This function must be called when feedback functions are no longer needed.
0
on success, otherwise a negative error value FEEDBACK_ERROR_NONE | Successful |
FEEDBACK_ERROR_NOT_INITIALIZED | Not initialized |
FEEDBACK_ERROR_NOT_SUPPORTED | Not supported device |
int feedback_initialize | ( | void | ) |
Initializes feedback API.
0
on success, otherwise a negative error value FEEDBACK_ERROR_NONE | Successful |
FEEDBACK_ERROR_NOT_SUPPORTED | Not supported device |
int feedback_is_supported_pattern | ( | feedback_type_e | type, |
feedback_pattern_e | pattern, | ||
bool * | status | ||
) |
Checks if the pattern is supported.
This function can be used to check if a specific pattern is supported.
[in] | type | The pattern type |
[in] | pattern | The pre-defined pattern |
[out] | status | True means the pattern is supported, otherwise not supported |
0
on success, otherwise a negative error value FEEDBACK_ERROR_NONE | Successful |
FEEDBACK_ERROR_OPERATION_FAILED | Operation not permitted |
FEEDBACK_ERROR_INVALID_PARAMETER | Invalid parameter |
FEEDBACK_ERROR_NOT_SUPPORTED | Not supported device |
FEEDBACK_ERROR_NOT_INITIALIZED | Not initialized |
int feedback_play | ( | feedback_pattern_e | pattern | ) |
Plays various types of reactions that are pre-defined.
This function can be used to react to pre-defined actions.
It play various types of system pre-defined media or vibration patterns.
[in] | pattern | The pre-defined pattern |
0
on success, otherwise a negative error value FEEDBACK_ERROR_NONE | Successful |
FEEDBACK_ERROR_OPERATION_FAILED | Operation not permitted |
FEEDBACK_ERROR_INVALID_PARAMETER | Invalid parameter |
FEEDBACK_ERROR_NOT_SUPPORTED | Not supported device |
FEEDBACK_ERROR_NOT_INITIALIZED | Not initialized |
int feedback_play_type | ( | feedback_type_e | type, |
feedback_pattern_e | pattern | ||
) |
Plays specific type of reactions that are pre-defined.
This function can be used to react to pre-defined actions.
It play specific type of system pre-defined pattern.
[in] | type | The pattern type |
[in] | pattern | The pre-defined pattern |
0
on success, otherwise a negative error value FEEDBACK_ERROR_NONE | Successful |
FEEDBACK_ERROR_OPERATION_FAILED | Operation not permitted |
FEEDBACK_ERROR_INVALID_PARAMETER | Invalid parameter |
FEEDBACK_ERROR_NOT_SUPPORTED | Not supported device |
FEEDBACK_ERROR_PERMISSION_DENIED | Permission denied |
FEEDBACK_ERROR_NOT_INITIALIZED | Not initialized |
int feedback_stop | ( | void | ) |
Stops various types of reactions.
This function can be used to stop reaction to pre-defined actions.
It stops system pre-defined vibration patterns.
0
on success, otherwise a negative error value FEEDBACK_ERROR_NONE | Successful |
FEEDBACK_ERROR_OPERATION_FAILED | Operation not permitted |
FEEDBACK_ERROR_NOT_SUPPORTED | Not supported device |
FEEDBACK_ERROR_PERMISSION_DENIED | Permission denied |
FEEDBACK_ERROR_NOT_INITIALIZED | Not initialized |