2 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
4 * Contact: Seungbae Shin <seungbae.shin@samsung.com>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
25 class CDeviceMapParser
29 CDeviceMapParser(const char* map_file);
30 virtual ~CDeviceMapParser();
34 void get_playback(string& card, string& device_num, int& rate, int& channels);
35 void get_capture(string& card, string& device_num, int& rate, int& channels);
38 void open_json(const char* json_file);
40 void parse_device_string_object(json_object *device_string_o, string& device_string);
41 void parse_device_role_object(json_object *device_role_o, string& device_params);
42 void parse_device_file_object(json_object *device_file_o, pair<string, string>& device);
43 void parse_device_file_array_object(json_object *device_file_array_o, pair<string, string>& device);
45 void parse_playback();
47 void get_device(string& s, string& card, string& device_num);
48 void get_params(string& s, int& rate, int& channels);
49 void get_single_param(string& s, int& rate, int& channels);
51 // FixMe, pair doens't define what is paired clearly....
52 pair<string, string> m_playback; // device_string, device_params
53 pair<string, string> m_capture; // device_string, device_params
55 json_object *m_json_obj;
56 json_object *m_json_device_files_obj;