Remove 3.0 deprecated API implementation
[platform/core/api/audio-io.git] / include / CAudioInput.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __TIZEN_MEDIA_AUDIO_IO_CAUDIO_INPUT_H__
18 #define __TIZEN_MEDIA_AUDIO_IO_CAUDIO_INPUT_H__
19
20
21 #ifdef __cplusplus
22
23
24 namespace tizen_media_audio {
25
26
27     /**
28      * A class CAudioInput that inherited from CAudioIO
29      */
30     class CAudioInput : public CAudioIO {
31     public:
32         /* Constructor & Destructor */
33         CAudioInput(CAudioInfo& info);
34         CAudioInput(
35                     unsigned int            sampleRate,
36                     CAudioInfo::EChannel    channel,
37                     CAudioInfo::ESampleType sampleType,
38                     CAudioInfo::EAudioType  audioType);
39         ~CAudioInput();
40
41         /* Overridden Handler */
42         virtual void onStream(CPulseAudioClient* pClient, size_t length);
43
44         /* Implemented Methods */
45         virtual void initialize();
46         virtual void finalize();
47
48         virtual void prepare();
49         virtual void unprepare();
50
51         virtual void pause();
52         virtual void resume();
53
54         virtual void drain();
55         virtual void flush();
56
57         virtual int  getBufferSize();
58
59         /* Overridden Methods */
60         virtual void setStreamCallback(SStreamCallback callback);
61
62         /* Methods */
63         size_t read(void* buffer, size_t length);
64         int peek(const void** buffer, size_t* length);
65         int drop();
66
67     private:
68         /* Private Methods */
69         void __setInit(bool flag);
70         bool __IsInit();
71         bool __IsReady();
72
73         bool __mIsUsedSyncRead;
74         bool __mIsInit;
75     };
76
77
78 } /* namespace tizen_media_audio */
79
80 #endif
81 #endif /* __TIZEN_MEDIA_AUDIO_IO_CAUDIO_INPUT_H__ */