2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <AppCommon.h>
21 #include "SourceInfo.h"
26 #define ICON_PATH_USB IMAGEDIR"/ico_usb.png"
27 #define ICON_PATH_TV IMAGEDIR"/ico_antenna.png"
28 #define ICON_PATH_SVIDEO IMAGEDIR"/ico_svideo.png"
29 #define ICON_PATH_COMP IMAGEDIR"/ico_component.png"
30 #define ICON_PATH_HDMI IMAGEDIR"/ico_hdmi.png"
31 #define ICON_PATH_DVI IMAGEDIR"/ico_dsub.png"
32 #define ICON_PATH_NAS IMAGEDIR"/ico_nas.png"
33 #define ICON_PATH_MOBILE IMAGEDIR"/ico_mobile.png"
34 #define ICON_PATH_CONSOLE IMAGEDIR"/ico_console.png"
35 #define ICON_PATH_SETTOP IMAGEDIR"/ico_settop.png"
38 CSourceInfo::CSourceInfo()
41 m_nType = CONN_TYPE_TV;
47 void CSourceInfo::SetId(int nId)
52 int CSourceInfo::Id(void)
57 void CSourceInfo::SetType(int nType)
62 int CSourceInfo::Type(void)
67 void CSourceInfo::SetName(const char *pName)
70 m_pName = new char[strlen(pName) + 1];
73 strcpy(m_pName, pName);
76 const char *CSourceInfo::Name(void)
81 void CSourceInfo::SetTypeName(const char *pTypeName)
84 m_pTypeName = new char[strlen(pTypeName) + 1];
87 strcpy(m_pTypeName, pTypeName);
90 const char *CSourceInfo::TypeName(void)
95 void CSourceInfo::SetData(void *pData)
101 void* CSourceInfo::Data(void)
107 const char *CSourceInfo::IconPath(void)
111 return ICON_PATH_USB;
117 case CONN_TYPE_SVIDEO1:
118 case CONN_TYPE_SVIDEO2:
119 case CONN_TYPE_SVIDEO3:
120 return ICON_PATH_SVIDEO;
121 case CONN_TYPE_COMP1:
122 case CONN_TYPE_COMP2:
123 case CONN_TYPE_COMP3:
124 return ICON_PATH_COMP;
125 case CONN_TYPE_HDMI1:
126 case CONN_TYPE_HDMI2:
127 case CONN_TYPE_HDMI3:
128 case CONN_TYPE_HDMI4:
129 return ICON_PATH_HDMI;
133 return ICON_PATH_DVI;
135 case CONN_TYPE_WIFI_DIRECT:
137 return ICON_PATH_NAS;
145 bool CSourceInfo::SwitchTo(void)
149 return CUsb::SwitchTo();
151 return CExternal::SwitchTo(CONN_TYPE_TV);