Move volume vconf set to pulseaudio
[platform/core/multimedia/libmm-sound.git] / include / mm_sound.h
index 94a9015..8caa3e0 100644 (file)
        </table></div>
 
  */
-#define MM_SOUND_STREAM_TYPE_LEN 64
 
 /*
  * MMSound Volume APIs
@@ -502,6 +501,53 @@ int mm_sound_volume_primary_type_set(volume_type_t type);
 int mm_sound_volume_primary_type_get(volume_type_t *type);
 
 /**
+ * This function is to set sound filter and apply to selected stream type.
+ *
+ * @param      stream_type                     [in]    stream type to apply
+ * @param      filter_name                     [in]    name of filter module to apply
+ * @param      filter_parameters       [in]    extra filter parameters(optional)
+ * @param      filter_group            [in]    extra filter group(optional)
+ *
+ * @return     This function returns MM_ERROR_NONE on success, or negative value
+ *                     with error code.
+ * @remark     None
+ * @pre                None
+ * @post       None
+ * @see                None
+ */
+int mm_sound_set_filter(const char *stream_type, const char *filter_name, const char *filter_parameters, const char *filter_group);
+
+/**
+ * This function is to unset sound filter and remove from selected stream type.
+ *
+ * @param      stream_type                     [in]    stream type to remove
+ *
+ * @return     This function returns MM_ERROR_NONE on success, or negative value
+ *                     with error code.
+ * @remark     None
+ * @pre                None
+ * @post       None
+ * @see                None
+ */
+int mm_sound_unset_filter(const char *stream_type);
+
+/**
+ * This function is to control filter configurations to selected stream type.
+ *
+ * @param      stream_type                     [in]    stream type to apply
+ * @param      filter_name                     [in]    specify filter module to apply
+ * @param      filter_controls         [in]    filter control parameters(e.g, "0.0, 0.1, 3.0")
+ *
+ * @return     This function returns MM_ERROR_NONE on success, or negative value
+ *                     with error code.
+ * @remark     None
+ * @pre                None
+ * @post       None
+ * @see                None
+ */
+int mm_sound_control_filter(const char *stream_type, const char *filter_name, const char *filter_controls);
+
+/**
  * Terminate callback function type.
  *
  * @param      data            [in]    Argument passed when callback was set
@@ -872,11 +918,6 @@ int mm_sound_play_tone (MMSoundTone_t num, int volume_config, const double volum
 int mm_sound_play_tone_with_stream_info(MMSoundTone_t tone, char *stream_type, int stream_id, const double volume, const int duration, int *handle);
 
 /*
- * Enumerations of System audio route policy
- */
-
-
-/*
  * Enumerations of device & route
  */
 
@@ -923,26 +964,6 @@ typedef enum {
 #define MM_SOUND_ROUTE_NUM 16
 #define MM_SOUND_NAME_NUM 32
 
-typedef enum{
-       MM_SOUND_ROUTE_OUT_SPEAKER = MM_SOUND_DEVICE_OUT_SPEAKER, /**< Routing audio output to builtin device such as internal speaker. */
-       MM_SOUND_ROUTE_OUT_RECEIVER = MM_SOUND_DEVICE_OUT_RECEIVER, /**< Routing audio output to builtin device such as internal receiver. */
-       MM_SOUND_ROUTE_OUT_WIRED_ACCESSORY = MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY,/**< Routing audio output to wired accessory such as headphone, headset, and so on. */
-       MM_SOUND_ROUTE_OUT_BLUETOOTH_SCO = MM_SOUND_DEVICE_OUT_BT_SCO, /**< Routing audio output to bluetooth SCO. */
-       MM_SOUND_ROUTE_OUT_BLUETOOTH_A2DP = MM_SOUND_DEVICE_OUT_BT_A2DP, /**< Routing audio output to bluetooth A2DP. */
-       MM_SOUND_ROUTE_OUT_DOCK = MM_SOUND_DEVICE_OUT_DOCK, /**< Routing audio output to DOCK */
-       MM_SOUND_ROUTE_OUT_HDMI = MM_SOUND_DEVICE_OUT_HDMI, /**< Routing audio output to HDMI */
-       MM_SOUND_ROUTE_OUT_MIRRORING = MM_SOUND_DEVICE_OUT_MIRRORING, /**< Routing audio output to MIRRORING */
-       MM_SOUND_ROUTE_OUT_USB_AUDIO = MM_SOUND_DEVICE_OUT_USB_AUDIO, /**< Routing audio output to USB Audio */
-       MM_SOUND_ROUTE_OUT_MULTIMEDIA_DOCK = MM_SOUND_DEVICE_OUT_MULTIMEDIA_DOCK, /**< Routing audio output to Multimedia DOCK */
-       MM_SOUND_ROUTE_IN_MIC = MM_SOUND_DEVICE_IN_MIC, /**< Routing audio input to device builtin mic. */
-       MM_SOUND_ROUTE_IN_WIRED_ACCESSORY = MM_SOUND_DEVICE_IN_WIRED_ACCESSORY, /**< Routing audio input to wired accessory. */
-       MM_SOUND_ROUTE_IN_MIC_OUT_RECEIVER = MM_SOUND_DEVICE_IN_MIC | MM_SOUND_DEVICE_OUT_RECEIVER, /**< Routing audio input to device builtin mic and routing audio output to builtin receiver*/
-       MM_SOUND_ROUTE_IN_MIC_OUT_SPEAKER = MM_SOUND_DEVICE_IN_MIC | MM_SOUND_DEVICE_OUT_SPEAKER , /**< Routing audio input to device builtin mic and routing audio output to builtin speaker */
-       MM_SOUND_ROUTE_IN_MIC_OUT_HEADPHONE = MM_SOUND_DEVICE_IN_MIC | MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY,/**< Routing audio input to device builtin mic and routing audio output to headphone */
-       MM_SOUND_ROUTE_INOUT_HEADSET = MM_SOUND_DEVICE_IN_WIRED_ACCESSORY | MM_SOUND_DEVICE_OUT_WIRED_ACCESSORY,        /**< Routing audio input and output to headset*/
-       MM_SOUND_ROUTE_INOUT_BLUETOOTH = MM_SOUND_DEVICE_IN_BT_SCO | MM_SOUND_DEVICE_OUT_BT_SCO /**< Routing audio input and output to bluetooth SCO */
-} mm_sound_route;
-
 /*
  * MMSound Device APIs
  */
@@ -976,11 +997,11 @@ typedef enum
        MM_SOUND_DEVICE_TYPE_BUILTIN_MIC,       /**< Built-in mic. */
        MM_SOUND_DEVICE_TYPE_AUDIOJACK,         /**< Audio jack such as headphone, headset, and so on. */
        MM_SOUND_DEVICE_TYPE_BLUETOOTH,         /**< Bluetooth */
-       MM_SOUND_DEVICE_TYPE_BLUETOOTH_A2DP = MM_SOUND_DEVICE_TYPE_BLUETOOTH,    /**< Bluetooth */
-       MM_SOUND_DEVICE_TYPE_BLUETOOTH_SCO,     /**< Bluetooth */
+       MM_SOUND_DEVICE_TYPE_BLUETOOTH_A2DP = MM_SOUND_DEVICE_TYPE_BLUETOOTH,    /**< Bluetooth A2DP */
        MM_SOUND_DEVICE_TYPE_HDMI,              /**< HDMI. */
        MM_SOUND_DEVICE_TYPE_MIRRORING,         /**< MIRRORING. */
        MM_SOUND_DEVICE_TYPE_USB_AUDIO,         /**< USB Audio. */
+       MM_SOUND_DEVICE_TYPE_BLUETOOTH_SCO,     /**< Bluetooth SCO */
 } mm_sound_device_type_e;
 
 typedef void *MMSoundDevice_t;          /**< MMsound Device handle */
@@ -998,7 +1019,11 @@ int mm_sound_remove_device_state_changed_callback(unsigned int id);
 
 int mm_sound_get_current_device_list(mm_sound_device_flags_e device_mask, MMSoundDeviceList_t *device_list);
 int mm_sound_get_device_list(int device_mask, MMSoundDeviceList_t *device_list);
+/* Free this device handle with mm_sound_free_device */
+int mm_sound_get_device_by_id(int device_id, MMSoundDevice_t *device);
 int mm_sound_free_device_list(MMSoundDeviceList_t device_list);
+/* Use this only for the device handle which got from mm_sound_get_device_by_id */
+int mm_sound_free_device(MMSoundDevice_t device_h);
 int mm_sound_get_next_device (MMSoundDeviceList_t device_list, MMSoundDevice_t *device);
 int mm_sound_get_prev_device (MMSoundDeviceList_t device_list, MMSoundDevice_t *device);
 int mm_sound_get_device_type(MMSoundDevice_t device_h, mm_sound_device_type_e *type);
@@ -1006,6 +1031,8 @@ int mm_sound_get_device_io_direction(MMSoundDevice_t device_h, mm_sound_device_i
 int mm_sound_get_device_id(MMSoundDevice_t device_h, int *id);
 int mm_sound_get_device_state(MMSoundDevice_t device_h, mm_sound_device_state_e *state);
 int mm_sound_get_device_name(MMSoundDevice_t device_h, char **name);
+int mm_sound_get_device_vendor_id(MMSoundDevice_t device_h, int *vendor_id);
+int mm_sound_get_device_product_id(MMSoundDevice_t device_h, int *product_id);
 
 /**
  * Active device changed callback function type.
@@ -1030,12 +1057,12 @@ typedef enum {
        MM_SOUND_SIGNAL_MAX,
 } mm_sound_signal_name_t;
 
-typedef void (*mm_sound_signal_callback) (mm_sound_signal_name_t signal, int value, void *user_data);
-int mm_sound_subscribe_signal(mm_sound_signal_name_t signal, unsigned int *subscribe_id, mm_sound_signal_callback callback, void *user_data);
-int mm_sound_subscribe_signal_for_daemon(mm_sound_signal_name_t signal, int client_pid, unsigned int *subscribe_id, mm_sound_signal_callback callback, void *user_data);
+typedef void (*mm_sound_signal_callback) (mm_sound_signal_name_t signal_type, int value, void *user_data);
+int mm_sound_subscribe_signal(mm_sound_signal_name_t signal_type, unsigned int *subscribe_id, mm_sound_signal_callback callback, void *user_data);
+int mm_sound_subscribe_signal_for_daemon(mm_sound_signal_name_t signal_type, int client_pid, unsigned int *subscribe_id, mm_sound_signal_callback callback, void *user_data);
 void mm_sound_unsubscribe_signal(unsigned int subscribe_id);
-int mm_sound_send_signal(mm_sound_signal_name_t signal, int value);
-int mm_sound_get_signal_value(mm_sound_signal_name_t signal, int *value);
+int mm_sound_send_signal(mm_sound_signal_name_t signal_type, int value);
+int mm_sound_get_signal_value(mm_sound_signal_name_t signal_type, int *value);
 int mm_sound_is_stream_on_device(int stream_id, MMSoundDevice_t device_h, bool *is_on);
 
 /**