RDK Documentation (Open Sourced RDK Components)
getAudioConfig.cpp
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 sample
26 * @{
27 **/
28 
29 
30 #include <iostream>
31 #include "videoOutputPort.hpp"
32 #include "host.hpp"
33 #include "videoResolution.hpp"
34 #include "audioOutputPort.hpp"
35 #include "audioEncoding.hpp"
36 #include "audioCompression.hpp"
37 #include "audioStereoMode.hpp"
38 #include "audioOutputPortType.hpp"
39 #include "manager.hpp"
40 
41 #include "dsUtl.h"
42 #include "dsError.h"
43 #include "list.hpp"
44 #include "libIBus.h"
45 
46 
47 int main(int argc, char *argv[])
48 {
49 
50  IARM_Bus_Init("SampleDSClient");
52 
53 
54 
57  for (size_t i = 0; i < vPorts.size(); i++) {
58  uint32_t audioDelayMs = 0;
59  device::AudioOutputPort &aPort = vPorts.at(i).getAudioOutputPort();
60 
61  aPort.getAudioDelay(audioDelayMs);
62  printf("AudioPort Name- [%s] =======================\r\n", aPort.getName().c_str());
63 
64  printf("\t Compression- [%d]\r\n", aPort.getCompression());
65  printf("\t MS12 MultiStreamDecode Status - [%s]\r\n",aPort.isAudioMS12Decode()? "On" : "Off");
66  printf("\t DialogEnhancement- [%d]\r\n", aPort.getDialogEnhancement());
67  printf("\t DolbyVolumeMode- [%d]\r\n", aPort.getDolbyVolumeMode());
68  printf("\t IntelligentEqualizerMode- [%d]\r\n", aPort.getIntelligentEqualizerMode());
69  printf("\t Volume Leveller - [%d]\r\n", aPort.getVolumeLeveller());
70  printf("\t Bass Enhancer Boost value - [%d]\r\n",aPort.getBassEnhancer());
71  printf("\t Surround Decoder Status - [%s]\r\n",aPort.isSurroundDecoderEnabled()? "Enabled" : "Disabled");
72  printf("\t Dynamic Range Control Mode - [%s]\r\n",aPort.getDRCMode()? "RF" : "Line");
73  printf("\t Surround Virtualizer boost - [%d]\r\n", aPort.getSurroundVirtualizer());
74  printf("\t Media Intelligent Steering - [%s]\r\n",aPort.getMISteering()? "On" : "Off");
75  printf("\t GraphicEqualizerMode- [%d]\r\n", aPort.getGraphicEqualizerMode());
76  printf("\t Encoding- [%s]\r\n", aPort.getEncoding().getName().c_str());
77  printf("\t Stereo Mode- [%s]\r\n", aPort.getStereoMode().getName().c_str());
78  printf("\t Gain - [%f]\r\n", aPort.getGain());
79  printf("\t DB- [%f]\r\n", aPort.getDB());
80  printf("\t LoopThru- [%s]\r\n", aPort.isLoopThru() ? "True" : "False");
81  printf("\t Mute Status - [%s]\r\n", aPort.isMuted()? "On" : "Off");
82  printf("\t MS11 MultiStreamDecode Status - [%s]\r\n",aPort.isAudioMSDecode()? "On" : "Off");
83  printf("\t Loudness Equivalence - [%s]\r\n",aPort.GetLEConfig()? "Enabled" : "Disabled");
84  printf("\t MaxDB - [%f]\r\n", aPort.getMaxDB());
85  printf("\t MinDB- [%f]\r\n", aPort.getMinDB());
86  printf("\t Optimal Level- [%f]\r\n", aPort.getOptimalLevel());
87  printf("\t Audio Level- [%f]\r\n", aPort.getLevel());
88  printf("\t Audio delay - [%lu] ms\r\n", audioDelayMs);
89  printf("\t Supported Compressions - [%d]\r\n", aPort.getSupportedCompressions().size());
90  for (size_t i = 0; i < aPort.getSupportedCompressions().size(); i++) {
91  printf("\t\t - [%s]\r\n", aPort.getSupportedCompressions().at(i).getName().c_str());
92  }
93  printf("\t Supported Encodings - [%d]\r\n", aPort.getSupportedEncodings().size());
94  for (size_t i = 0; i < aPort.getSupportedEncodings().size(); i++) {
95  printf("\t\t - [%s]\r\n", aPort.getSupportedEncodings().at(i).getName().c_str());
96  }
97  printf("\t Supported Stereo MOdes - [%d]\r\n", aPort.getSupportedStereoModes().size());
98  for (size_t i = 0; i < aPort.getSupportedStereoModes().size(); i++) {
99  printf("\t\t - [%s]\r\n", aPort.getSupportedStereoModes().at(i).getName().c_str());
100  }
101 
102  printf("==========================================\r\n\r\n");
103  }
104 
106 
108  IARM_Bus_Term();
109 
110 
111  return 0;
112 }
113 
114 
115 /** @} */
116 /** @} */
device::AudioOutputPort::getDialogEnhancement
int getDialogEnhancement() const
This API is used to get the current auto mode.
Definition: audioOutputPort.cpp:891
device::AudioOutputPort::getDB
float getDB() const
This API will get the current Decibel value for the given Audio port.
Definition: audioOutputPort.cpp:408
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
device::AudioOutputPort::getSurroundVirtualizer
dsSurroundVirtualizer_t getSurroundVirtualizer() const
This API is used to get the Surround Virtualizer Boost value.
Definition: audioOutputPort.cpp:1035
device::AudioOutputPort::getSupportedStereoModes
const List< AudioStereoMode > getSupportedStereoModes() const
Definition: audioOutputPort.cpp:248
device::AudioOutputPort::getSupportedCompressions
const List< AudioCompression > getSupportedCompressions() const
This API is used to get the list of audio compressions supported by the port.
Definition: audioOutputPort.cpp:236
device::AudioOutputPort::getDolbyVolumeMode
bool getDolbyVolumeMode() const
This API is used to get the current auto mode.
Definition: audioOutputPort.cpp:911
device::AudioOutputPort::getGain
float getGain() const
This API will get the current Gain for the given audio output port.
Definition: audioOutputPort.cpp:386
device::AudioOutputPort::getEncoding
const AudioEncoding & getEncoding() const
This API is used to get the current encoding of the output port.
Definition: audioOutputPort.cpp:260
device::AudioOutputPort::getVolumeLeveller
dsVolumeLeveller_t getVolumeLeveller() const
This API is used to get the current volume leveller value.
Definition: audioOutputPort.cpp:952
device::Host::getVideoOutputPorts
List< VideoOutputPort > getVideoOutputPorts()
This API is used to get the list of the video output ports supported on the device....
Definition: host.cpp:285
device::AudioOutputPort::GetLEConfig
bool GetLEConfig()
This API is used to check if Loudness Equivalence is enabled or not*.
Definition: audioOutputPort.cpp:1636
device::AudioOutputPort::getOptimalLevel
float getOptimalLevel() const
This API is used to get the current optimal level value for audio output port.
Definition: audioOutputPort.cpp:444
device::AudioOutputPort::getStereoMode
const AudioStereoMode & getStereoMode(bool usePersist=false)
This API is used to get the current stereo mode of the output port.
Definition: audioOutputPort.cpp:273
manager.hpp
It contains class referenced by manager.cpp file.
device::AudioOutputPort::getLevel
float getLevel() const
This API is used to get the current audio level for the given audio output port.
Definition: audioOutputPort.cpp:492
device::AudioOutputPort::isLoopThru
bool isLoopThru() const
This API is used to check whether the given audio port is configured for loop thro'.
Definition: audioOutputPort.cpp:514
device::AudioOutputPort::getMISteering
bool getMISteering() const
This API is used to get status of Media Intelligent Steering.
Definition: audioOutputPort.cpp:1057
device::AudioOutputPort::getName
const std::string & getName() const
This API gets the name of the AudioOutputPort. The AudioOutputPort names can be IDLR,...
Definition: audioOutputPort.hpp:105
dsError.h
Device Settings HAL error codes.
device::List::size
size_t size()
This function gets the size of the container.
Definition: list.hpp:118
dsUtl.h
Device Settings HAL utilities.
device::AudioOutputPort
Class extending Enumerable to implement the audiooutputport interface.
Definition: audioOutputPort.hpp:60
audioStereoMode.hpp
This file defines AudioStereoMode class for managing audio mode types.
IARM_Bus_Disconnect
IARM_Result_t IARM_Bus_Disconnect(void)
This API disconnect Application from IARM Bus so the application will not receive any IARM event or R...
device::AudioOutputPort::getMinDB
float getMinDB() const
This API is used to get the current minimum decibel that Audio output port can support.
Definition: audioOutputPort.cpp:432
device::Manager::Initialize
static void Initialize()
This API is used to initialize the Device Setting module. Each API should be called by any client of ...
Definition: manager.cpp:97
videoResolution.hpp
It contains class and structure refrenced by the videoResolution.cpp file.
libIBus.h
RDK IARM-Bus API Declarations.
device::AudioOutputPort::isAudioMSDecode
bool isAudioMSDecode() const
This API is used to check whether the audio port supports Dolby MS11 Multistream Decode.
Definition: audioOutputPort.cpp:1859
device::AudioOutputPort::isMuted
bool isMuted() const
This API is used to check whether the audio is muted or not.
Definition: audioOutputPort.cpp:530
device::AudioOutputPort::getBassEnhancer
int getBassEnhancer() const
This API is used to get the Bass Enhancer boost value.
Definition: audioOutputPort.cpp:975
device::AudioOutputPort::getDRCMode
int getDRCMode() const
This API is used to get the Dynamic Range Control mode.
Definition: audioOutputPort.cpp:1015
device::AudioOutputPort::getAudioDelay
bool getAudioDelay(uint32_t &audioDelayMs) const
This API is used to get the current audio delay in milliseconds for audio output port.
Definition: audioOutputPort.cpp:455
device::DSConstant::getName
virtual const std::string & getName() const
This function is used to the get the data member name.
Definition: dsConstant.hpp:141
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
device::VideoOutputPort::getAudioOutputPort
AudioOutputPort & getAudioOutputPort()
This API is used to get the audio output port connected to the video output port. This connection is ...
Definition: videoOutputPort.cpp:280
device::Manager::DeInitialize
static void DeInitialize()
This API is used to deinitialize the device settings module. DeInitialize() must be called to release...
Definition: manager.cpp:138
device::Host::getInstance
static Host & getInstance(void)
This API is used to get a reference to the single instance of the Host object.
Definition: host.cpp:88
device::AudioOutputPort::getGraphicEqualizerMode
int getGraphicEqualizerMode() const
This API is used to get the current Graphical EQ mode.
Definition: audioOutputPort.cpp:1078
device::AudioOutputPort::getSupportedEncodings
const List< AudioEncoding > getSupportedEncodings() const
This API is used to get the list of audio encodings supported by the port.
Definition: audioOutputPort.cpp:224
device::List< device::VideoOutputPort >
audioOutputPortType.hpp
It contain variables,stuctures,class and functions referenced by audiooutputportType code.
IARM_Bus_Connect
IARM_Result_t IARM_Bus_Connect(void)
This API is used to connect application to the IARM bus daemon. After connected, the application can ...
Definition: iarmMgrMocks.cpp:33
audioOutputPort.hpp
It contain variables,stuctures,class and functions referenced by audiooutputport code.
device::AudioOutputPort::isSurroundDecoderEnabled
bool isSurroundDecoderEnabled() const
This API is used to get status of surround decoder.
Definition: audioOutputPort.cpp:995
device::AudioOutputPort::getCompression
int getCompression() const
This API is used to get the current compression of the output port.
Definition: audioOutputPort.cpp:871
IARM_Bus_Init
IARM_Result_t IARM_Bus_Init(const char *name)
This API is used to initialize the IARM-Bus library.
Definition: iarmMgrMocks.cpp:38
audioCompression.hpp
This file defines AudioCompression class for managing audio compression levels.
device::AudioOutputPort::getMaxDB
float getMaxDB() const
This API is used to get the current Maximum decibel that Audio output port can support.
Definition: audioOutputPort.cpp:420
audioEncoding.hpp
This file defines AudioEncoding class for managing audio encoding types.