RDK Documentation (Open Sourced RDK Components)
host.hpp
Go to the documentation of this file.
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 
20 
21 
22 /**
23 * @defgroup devicesettings
24 * @{
25 * @defgroup ds
26 * @{
27 **/
28 
29 
30 #ifndef _DS_HOST_HPP_
31 #define _DS_HOST_HPP_
32 
33 #include <iostream>
34 #include "powerModeChangeListener.hpp"
35 #include "displayConnectionChangeListener.hpp"
36 #include "audioOutputPort.hpp"
37 #include "videoOutputPort.hpp"
38 #include "videoDevice.hpp"
39 #include "sleepMode.hpp"
40 #include "list.hpp"
41 
42 #include <list>
43 #include <string>
44 
45 
46 /**
47  * @file host.hpp
48  * @brief It contains class,structures referenced by host.cpp file.
49  */
50 using namespace std;
51 
52 namespace device {
53 
54 
55 /**
56  * @class Host
57  * @brief Class to implement the Host interface.
58  * @ingroup devicesettingsclass
59  */
60 class Host {
61 public:
62  static const int kPowerOn;
63  static const int kPowerOff;
64  static const int kPowerStandby;
65 
66  bool setPowerMode(int mode);
67  int getPowerMode();
68  SleepMode getPreferredSleepMode();
69  int setPreferredSleepMode(const SleepMode);
70  List <SleepMode> getAvailableSleepModes();
71  void addPowerModeListener(PowerModeChangeListener *l);
72  void removePowerModeChangeListener(PowerModeChangeListener *l);
73  void addDisplayConnectionListener(DisplayConnectionChangeListener *l);
74  void removeDisplayConnectionListener(DisplayConnectionChangeListener *l);
75 
76  static Host& getInstance(void);
77 
78  List<VideoOutputPort> getVideoOutputPorts();
79  List<AudioOutputPort> getAudioOutputPorts();
80  List<VideoDevice> getVideoDevices();
81  VideoOutputPort &getVideoOutputPort(const std::string &name);
82  VideoOutputPort &getVideoOutputPort(int id);
83  AudioOutputPort &getAudioOutputPort(const std::string &name);
84  AudioOutputPort &getAudioOutputPort(int id);
85  void notifyPowerChange(const int mode);
86  float getCPUTemperature();
87  uint32_t getVersion(void);
88  void setVersion(uint32_t versionNumber);
89  void getHostEDID(std::vector<uint8_t> &edid) const;
90  std::string getSocIDFromSDK();
91  void getSinkDeviceAtmosCapability(dsATMOSCapability_t & atmosCapability);
92  void setAudioAtmosOutputMode(bool enable);
93  void setAssociatedAudioMixing(const bool mixing);
94  void getAssociatedAudioMixing(bool *mixing);
95  void setFaderControl(const int mixerbalance);
96  void getFaderControl(int *mixerBalance);
97  void setPrimaryLanguage(const std::string pLang);
98  void getPrimaryLanguage(std::string &pLang);
99  void setSecondaryLanguage(const std::string sLang);
100  void getSecondaryLanguage(std::string &sLang);
101  bool isHDMIOutPortPresent();
102  std::string getDefaultVideoPortName();
103  std::string getDefaultAudioPortName();
104  void getCurrentAudioFormat(dsAudioFormat_t &audioFormat);
105 
106 private:
107  Host();
108  virtual ~Host();
109  //To Make the instance as thread-safe, using = delete, the result is, automatically generated methods (constructor, for example) from the compiler will not be created and, therefore, can not be called
110  Host (const Host&)= delete;
111  Host& operator=(const Host&)= delete;
112 
113  std::list < PowerModeChangeListener* > powerEvntListeners;
114  std::list < DisplayConnectionChangeListener* > dispEvntListeners;
115  void notifyDisplayConnectionChange(int portHandle, bool newConnectionStatus);
116 };
117 
118 }
119 
120 #endif /* _DS_HOST_HPP_ */
121 
122 
123 /** @} */
124 /** @} */
device::List
This class is implemented using templates and it is used to maintain a container with the list of sup...
Definition: list.hpp:51
device::VideoOutputPort
Class extending enumerable to implement the videoooutputport interface.
Definition: videoOutputPort.hpp:59
device::AudioOutputPort
Class extending Enumerable to implement the audiooutputport interface.
Definition: audioOutputPort.hpp:60
device::PowerModeChangeListener
Definition: powerModeChangeListener.hpp:36
videoDevice.hpp
It contains class referenced by videoDevice.cpp file.
device::DisplayConnectionChangeListener
Definition: displayConnectionChangeListener.hpp:38
device::SleepMode
This class extends DSConstant to implement SleepMode. It is used to manage the sleep modes for device...
Definition: sleepMode.hpp:51
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
device::Host
Class to implement the Host interface.
Definition: host.hpp:60
audioOutputPort.hpp
It contain variables,stuctures,class and functions referenced by audiooutputport code.
dsAudioFormat_t
enum _dsAudioFormat_t dsAudioFormat_t
sleepMode.hpp
This file defines SleepMode class for device settings.