RDK Documentation (Open Sourced RDK Components)
acm_iarm_interface.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 #include "music_id.h"
20 
21 /**
22  * @addtogroup AUDIO_CAPTURE_MANAGER_API
23  * @{
24  */
25 
27 {
28  private:
29  bool m_is_active;
30  bool m_enable_audio_input;
31  music_id_client * m_client;
32 
33  public:
36  static acm_iarm_interface * get_instance();
37 
38  /**
39  * @brief This API initialize the message bus, registers event, RPC methods that can be used
40  * by other applications.
41  *
42  * @param[in] client Indicates the id ofthe client device.
43  *
44  * @return Returns 0 on success, appropriate error code otherwise.
45  */
46  int activate(music_id_client * client);
47 
48  /**
49  * @brief This API disconnects application from the message bus, releases memory.
50  *
51  * Also, unregisters the client from the application.
52  *
53  * @return Returns 0 on success, appropriate error code otherwise.
54  */
55  int deactivate();
56 
57  /**
58  * @brief This API starts the audio capture.
59  *
60  * If incoming duration is 0, turn off precapturing otherwise turn it back on and set duration.
61  *
62  * @param[in] arg Payload data
63  *
64  * @return Returns ACM_RESULT_SUCCESS on success, appropiate error code otherwise.
65  */
66  int enable_capture_handler(void * arg);
67 
68  /**
69  * @brief This API grabs the precaptured sample, if the requested data has precapture flag true.
70  * Otherwise, capture fresh sample.
71  *
72  * @param[in] arg Payload data
73  *
74  * @return Returns ACM_RESULT_GENERAL_FAILURE on failure, 0 on success.
75  *
76  */
77  int get_sample_handler(void * arg);
78 
79  /**
80  * @brief Function to add prefix to the audio filename.
81  *
82  * @param[in] prefix Prefix to be added.
83  */
84  void set_filename_prefix(std::string &prefix);
85 };
86 
87 /**
88  * @}
89  */
90 
91 
music_id_client
Definition: music_id.h:37
acm_iarm_interface::deactivate
int deactivate()
This API disconnects application from the message bus, releases memory.
Definition: acm_iarm_interface.cpp:126
acm_iarm_interface::activate
int activate(music_id_client *client)
This API initialize the message bus, registers event, RPC methods that can be used by other applicati...
Definition: acm_iarm_interface.cpp:94
acm_iarm_interface::set_filename_prefix
void set_filename_prefix(std::string &prefix)
Function to add prefix to the audio filename.
Definition: acm_iarm_interface.cpp:223
acm_iarm_interface
Definition: acm_iarm_interface.h:26
acm_iarm_interface::enable_capture_handler
int enable_capture_handler(void *arg)
This API starts the audio capture.
Definition: acm_iarm_interface.cpp:143
acm_iarm_interface::get_sample_handler
int get_sample_handler(void *arg)
This API grabs the precaptured sample, if the requested data has precapture flag true....
Definition: acm_iarm_interface.cpp:179