2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __TIZEN_MEDIA_AUDIO_IO_CAUDIO_OUTPUT_H__
18 #define __TIZEN_MEDIA_AUDIO_IO_CAUDIO_OUTPUT_H__
23 #include "CAudioIODef.h"
26 namespace tizen_media_audio {
30 * A class CAudioOutput that inherited from CAudioIO
32 class CAudioOutput : public CAudioIO {
34 /* Constructor & Destructor */
35 CAudioOutput(CAudioInfo& info);
37 unsigned int smapleRate,
38 CAudioInfo::EChannel channel,
39 CAudioInfo::ESampleType sampleType,
40 CAudioInfo::EAudioType type);
43 /* Overridden Handler */
44 virtual void onStream(CPulseAudioClient* pClient, size_t length);
45 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);
46 virtual void onSignal(CAudioSessionHandler* pHandler, mm_sound_signal_name_t signal, int value);
48 /* Implemented Methods */
49 virtual void initialize();
50 virtual void finalize();
52 virtual void prepare();
53 virtual void unprepare();
56 virtual void resume();
61 virtual int getBufferSize();
64 size_t write(const void* buffer, size_t length);
68 void __setInit(bool flag);
72 bool __mIsUsedSyncWrite;
77 } /* namespace tizen_media_audio */
80 #endif /* __TIZEN_MEDIA_AUDIO_IO_CAUDIO_OUTPUT_H__ */