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 bool mIsUsedSyncWrite;
38 void setInit(bool flag);
43 /* Constructor & Destructor */
44 CAudioOutput(CAudioInfo& info);
46 unsigned int smapleRate,
47 CAudioInfo::EChannel channel,
48 CAudioInfo::ESampleType sampleType,
49 CAudioInfo::EAudioType type);
52 /* Overridden Handler */
53 virtual void onStream(CPulseAudioClient* pClient, size_t length);
54 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);
55 virtual void onSignal(CAudioSessionHandler* pHandler, mm_sound_signal_name_t signal, int value);
57 /* Implemented Methods */
58 virtual void initialize() throw (CAudioError);
59 virtual void finalize();
61 virtual void prepare() throw (CAudioError);
62 virtual void unprepare() throw (CAudioError);
64 virtual void pause() throw (CAudioError);
65 virtual void resume() throw (CAudioError);
67 virtual void drain() throw (CAudioError);
68 virtual void flush() throw (CAudioError);
70 virtual int getBufferSize() throw (CAudioError);
73 size_t write(const void* buffer, size_t length) throw (CAudioError);
76 } /* namespace tizen_media_audio */
79 #endif /* __TIZEN_MEDIA_AUDIO_IO_CAUDIO_OUTPUT_H__ */