Add get ns/agc function
[platform/core/api/audio-io.git] / include / CAudioInfo.h
index 1b1163b..3a86f07 100644 (file)
@@ -22,6 +22,9 @@
 
 #include <type_traits>
 #include <string>
+#include <optional>
+#include <tuple>
+
 #include <sound_manager.h>
 #include <sound_manager_internal.h>
 
@@ -129,28 +132,32 @@ namespace tizen_media_audio {
         static constexpr auto MAX_RECORD_VOLUME = 2.0;
         static constexpr auto DEFAULT_RECORD_VOLUME = 1.0;
 
-        /* Constructors */
-        CAudioInfo();
+        /* Constructor & Destructor */
         CAudioInfo(unsigned int sampleRate, EChannel channel, ESampleType sampleType, EAudioType audioType, int audioIndex);
         virtual ~CAudioInfo() = default;
 
-        /* Setter & Getter */
-        unsigned int getSampleRate() noexcept;
-        EChannel getChannel() noexcept;
-        ESampleType getSampleType() noexcept;
-        EAudioType getAudioType() noexcept;
-        int getAudioIndex() noexcept;
+        /* Audio Specification */
+        std::tuple<ESampleType, unsigned int, EChannel> getSpec() const noexcept;
+        int getSampleSize() const noexcept;
+
+        /* Stream Properties */
         void setAudioIndex(int audioIndex) noexcept;
-        int getSampleSize() noexcept;
-        void bindEchoCancelReferenceDeviceId(int id, sound_acoustic_echo_cancel_type_e type);
-        int getEchoCancelReferenceDeviceId() noexcept;
-        void setNoiseSuppression(bool enable, sound_noise_suppression_type_e type);
-        std::string& getProcessorProperty() noexcept;
-
-        /* Setter & Getter Utilities */
-        const char* getConvertedStreamType();
         void setAudioTypeByInputStreamType(const char* streamType);
         void setAudioTypeByOutputStreamType(const char* streamType);
+        EAudioType getAudioType() const noexcept;
+        std::pair<const char*, int> getStreamProperties() const;
+
+        /* Effect */
+        void setEffectMethod(int method) noexcept;
+        std::string getEffectNoiseSuppressionMethod() const noexcept;
+        std::string getEffectAutomaticGainControlMethod() const noexcept;
+
+        void setEffectMethodWithReference(sound_effect_method_with_reference_e method, int id) noexcept;
+        std::pair<std::string, int> getEffectMethodWithReference() const noexcept;
+
+        /* Utilities */
+        size_t msToBytes(size_t milliseconds) const noexcept;
+        size_t bytesToMs(size_t bytes) const noexcept;
 
     private:
         const char *__STREAM_TYPE_TABLE[(unsigned int)EAudioType::AUDIO_TYPE_MAX] = {
@@ -196,14 +203,16 @@ namespace tizen_media_audio {
         EAudioType convertInputStreamTypeToAudioType(const char *streamType);
         EAudioType convertOutputStreamTypeToAudioType(const char *streamType);
 
-        unsigned int __mSampleRate;
-        EChannel     __mChannel;
-        ESampleType  __mSampleType;
-        EAudioType   __mAudioType;
-        int          __mAudioIndex;
-        int          __mReferenceDeviceId;
-        bool         __mNoiseSuppression;
-        std::string  __mProcessorProperty;
+        unsigned int __mSampleRate { MAX_SYSTEM_SAMPLERATE };
+        EChannel     __mChannel { EChannel::CHANNEL_MAX };
+        ESampleType  __mSampleType { ESampleType::SAMPLE_TYPE_MAX };
+        EAudioType   __mAudioType { EAudioType::AUDIO_TYPE_MAX };
+        int          __mAudioIndex { -1 };
+
+        std::optional<sound_effect_method_with_reference_e>
+                     __mEffectMethodWithReference;
+        int          __mEffectMethodReferenceDeviceId { 0 };
+        int          __mEffectMethod { 0 };
     };