3295d3d819f74c7533044de80fb0e197f1f04a05
[apps/agl-service-unicens.git] / ucs2-vol / inc / setup.h
1 /*
2  * libmostvolume example
3  *
4  * Copyright (C) 2017 Microchip Technology Germany II GmbH & Co. KG
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18  *
19  * You may also obtain this software under a propriety license from Microchip.
20  * Please contact Microchip for further information.
21  *
22  */
23
24 #ifndef SETUP_H
25 #define SETUP_H
26
27 #include "ucs_api.h"
28 #include "libmostvolume.h"
29 #include "device_value.h"
30 #include "device_container.h"
31
32 #define MAX_CHANNELS    (LIB_MOST_VOLUME_MASTER + 1u)
33 #define MAX_MASTERS     3u
34
35 class CSetup {
36
37 public:
38     void Configure(Ucs_Inst_t *UNICENS_inst, lib_most_volume_service_cb_t service_fptr);
39     Ucs_Inst_t *RetrieveUnicensInst(void);
40     void SetVolume(enum lib_most_volume_channel_t channel, uint8_t volume);
41     void Update();
42
43 private:
44     CDeviceValue _volume_amp_270_m;
45     CDeviceValue _volume_amp_270_l;
46     CDeviceValue _volume_amp_270_r;
47
48     CDeviceValue _volume_amp_271_m;
49     CDeviceValue _volume_amp_271_l;
50     CDeviceValue _volume_amp_271_r;
51
52     CDeviceValue _volume_amp_272_m;
53     CDeviceValue _volume_amp_272_l;
54     CDeviceValue _volume_amp_272_r;
55
56     CDeviceContainer _value_container;
57     Ucs_Inst_t *ucs_inst;
58
59 public:
60     static CSetup* GetInstance();   // singleton
61     static void Release();          // singleton
62
63 protected:
64     CSetup();                       // singleton
65     virtual ~CSetup();              // singleton
66
67 private:
68     static CSetup* _instance;       // singleton
69 };
70
71 #endif  /* SETUP_H */
72