Remove 3.0 deprecated API implementation
[platform/core/api/audio-io.git] / include / CAudioIO.h
index ebfea6b..939236f 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef __TIZEN_MEDIA_AUDIO_IO_CAUDIO_IO_H__
 #define __TIZEN_MEDIA_AUDIO_IO_CAUDIO_IO_H__
 
+#include <sound_manager.h>
 
 #ifdef __cplusplus
 
@@ -29,8 +30,7 @@ namespace tizen_media_audio {
      *  You can't take this object directly.
      */
     class IPulseStreamListener;
-    class IAudioSessionEventListener;
-    class CAudioIO : public IPulseStreamListener, public IAudioSessionEventListener {
+    class CAudioIO : public IPulseStreamListener {
     public:
         struct SStreamCallback {
             void* mUserData;
@@ -48,58 +48,41 @@ namespace tizen_media_audio {
             { /* Empty Body */ }
         };
 
-        struct SInterruptCallback {
-            void* mUserData;
-            void (*onInterrupt)(IAudioSessionEventListener::EInterruptCode code, void* user_data);
-
-            SInterruptCallback() : mUserData(NULL), onInterrupt(NULL)
-            { /* Empty Body */ }
-        };
-
         /* Constructor & Destructor */
         CAudioIO();
         CAudioIO(CAudioInfo& audioInfo);
         virtual ~CAudioIO();
 
         /* Pure Virtual Methods */
-        virtual void initialize() throw(CAudioError) = 0;
+        virtual void initialize() = 0;
         virtual void finalize() = 0;
 
-        virtual void prepare() throw(CAudioError)   = 0;
-        virtual void unprepare() throw(CAudioError) = 0;
+        virtual void prepare() = 0;
+        virtual void unprepare() = 0;
 
-        virtual void pause() throw(CAudioError) = 0;
-        virtual void resume() throw(CAudioError) = 0;
+        virtual void pause() = 0;
+        virtual void resume() = 0;
 
-        virtual void drain() throw(CAudioError) = 0;
-        virtual void flush() throw(CAudioError) = 0;
+        virtual void drain() = 0;
+        virtual void flush() = 0;
 
-        virtual int  getBufferSize() throw(CAudioError) = 0;
+        virtual int  getBufferSize() = 0;
 
         /* Implemented Handlers */
         virtual void onStream(CPulseAudioClient* pClient, size_t length);
         virtual void onStateChanged(CAudioInfo::EAudioIOState state, bool byPolicy);
         virtual void onStateChanged(CAudioInfo::EAudioIOState state);
-        virtual void onInterrupt(CAudioSessionHandler* pHandler, int id, mm_sound_focus_type_e focus_type, mm_sound_focus_state_e state, const char *reason_for_change, const char *additional_info);
-        virtual void onSignal(CAudioSessionHandler* pHandler, mm_sound_signal_name_t signal, int value);
 
         /* Methods */
-        CAudioInfo& getAudioInfo() throw(CAudioError);
+        CAudioInfo& getAudioInfo();
 
-        virtual void setStreamCallback(SStreamCallback callback) throw(CAudioError);
-        SStreamCallback getStreamCallback() throw(CAudioError);
+        virtual void setStreamCallback(SStreamCallback callback);
+        SStreamCallback getStreamCallback();
 
-        virtual void setStateChangedCallback(SStateChangedCallback callback) throw(CAudioError);
-        SStateChangedCallback getStateChangedCallback() throw(CAudioError);
+        virtual void setStateChangedCallback(SStateChangedCallback callback);
+        SStateChangedCallback getStateChangedCallback();
 
-        void setInterruptCallback(SInterruptCallback callback) throw(CAudioError);
-        SInterruptCallback getInterruptCallback() throw(CAudioError);
-
-        void ignoreSession() throw(CAudioError);
-
-        void setStreamInfo(sound_stream_info_h stream_info) throw(CAudioError);
-
-        void setInternalStreamInfo() throw(CAudioError); /* this is for session backward compatibility and will be removed later */
+        void setStreamInfo(sound_stream_info_h stream_info);
 
         CAudioInfo::EAudioIOState getState();
 
@@ -109,20 +92,16 @@ namespace tizen_media_audio {
         virtual bool isInit();
         virtual bool IsReady();
 
-        void internalLock()   throw(CAudioError);
-        void internalUnlock() throw(CAudioError);
-        void internalWait()   throw(CAudioError);
-        void internalSignal() throw(CAudioError);
+        void internalLock();
+        void internalUnlock();
+        void internalWait();
+        void internalSignal();
 
-        bool isForceIgnore();
-
-        CAudioSessionHandler* mpAudioSessionHandler;
         CPulseAudioClient*    mpPulseAudioClient;
         CAudioInfo            mAudioInfo;
 
         SStreamCallback       mStreamCallback;
         SStateChangedCallback mStateChangedCallback;
-        SInterruptCallback    mInterruptCallback;
 
         CAudioInfo::EAudioDirection mDirection;
         CAudioInfo::EAudioIOState mState;
@@ -131,11 +110,9 @@ namespace tizen_media_audio {
 
     private:
         pthread_mutex_t       __mMutex;
+        pthread_mutex_t       __mCondMutex;
         pthread_cond_t        __mCond;
         bool                  __mIsInit;
-        bool                  __mForceIgnore;
-
-        void abandonInternalFocus() throw(CAudioError); /* this is for session backward compatibility and will be removed later */
     };