sound: Support multi-theme sound conf usage 29/296729/6
authorYunhee Seo <yuni.seo@samsung.com>
Tue, 1 Aug 2023 06:23:52 +0000 (15:23 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Tue, 8 Aug 2023 06:22:22 +0000 (15:22 +0900)
commit63298e548189446ee6e0d857d5d45cbd338ef4ad
tree55033ef01243e5a6814d79d211e1f04652fe1d33
parent67274c71b2496685a05ed840b0787ca7ecdafe82
sound: Support multi-theme sound conf usage

Allows users to select one of several theme files.
Conf file detailed usage is explained in the common/data/sound.conf file.

Example of conf file usage
[SoundMultiTheme] -> It means support multi theme
number_of_theme=2 -> It means how many confs are supported
name_of_default_theme=SoundTheme2 -> It means SoundTheme2 section file is set to default conf
[SoundTheme1] -> Match the conf file number and file path
file_path_of_theme=/usr/share/feedback/sound-theme1.conf
[SoundTheme2]
file_path_of_theme=/usr/share/feedback/sound-theme2.conf

To support this, below functions are newly added to feedback-internal.h.
- int feedback_get_count_of_theme_internal(feedback_type_e feedback_type, unsigned int *count_of_theme);
    - This function gets the number of theme described in the config file.
- int feedback_get_theme_index_internal(feedback_type_e feedback_type, unsigned int *index_of_theme);
    - This function gets the current index of theme selected.
- int feedback_set_theme_index_internal(feedback_type_e feedback_type, unsigned int index_of_theme);
    - This function sets the index of theme will be used.
      After that, It is possible to use the feedback files defined in the theme(index_of_theme) conf file.

In deed, this patch only supports sound theme.

Change-Id: Idd25bed7b091fffe6d9c7a5729a670f0f27469c4
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
common/data/sound.conf
include/feedback-internal.h
src/devices.h
src/feedback-config.c
src/feedback.c
src/sound.c
src/vibrator.c