2 * Copyright (c) 2019 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.
18 #include <cpp_audio_io.h>
24 #define LOG_TAG "TIZEN_N_AUDIO_IO"
27 AUDIO_IO_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed */
28 AUDIO_IO_INTERRUPTED_BY_MEDIA, /**< Interrupted by a media application */
29 AUDIO_IO_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call */
30 AUDIO_IO_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones */
31 AUDIO_IO_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */
32 AUDIO_IO_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm */
33 AUDIO_IO_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency */
34 AUDIO_IO_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification */
35 } audio_io_interrupted_code_e;
37 typedef void (*audio_io_interrupted_cb)(audio_io_interrupted_code_e code, void *user_data);
39 #define DEPRECATED_WARN() do { \
40 LOGW("DEPRECATION WARNING: %s() is deprecated", __func__); \
43 #define DEPRECATED_WARN_INSTEAD(msg) do { \
44 LOGW("DEPRECATION WARNING: %s() is deprecated. Use %s() instead.", __func__, msg); \
48 int audio_out_create(int sample_rate, audio_channel_e channel, audio_sample_type_e type, sound_type_e sound_type, audio_out_h* output)
50 DEPRECATED_WARN_INSTEAD("audio_out_create_new");
52 /* ignore sound_type, treat this stream as media type */
53 return cpp_audio_out_create_new(sample_rate, channel, type, output);
56 int audio_out_set_interrupted_cb(audio_out_h output, audio_io_interrupted_cb callback, void *user_data)
58 DEPRECATED_WARN_INSTEAD("sound_manager_create_stream_information");
60 /* dummy, do nothing */
61 return AUDIO_IO_ERROR_NONE;