| 1 | #pragma once |
| 2 | /* |
| 3 | * This file is part of the libCEC(R) library. |
| 4 | * |
| 5 | * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited. All rights reserved. |
| 6 | * libCEC(R) is an original work, containing original code. |
| 7 | * |
| 8 | * libCEC(R) is a trademark of Pulse-Eight Limited. |
| 9 | * |
| 10 | * This program is dual-licensed; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; either version 2 of the License, or |
| 13 | * (at your option) any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program; if not, write to the Free Software |
| 22 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 23 | * |
| 24 | * |
| 25 | * Alternatively, you can license this library under a commercial license, |
| 26 | * please contact Pulse-Eight Licensing for more information. |
| 27 | * |
| 28 | * For more information contact: |
| 29 | * Pulse-Eight Licensing <license@pulse-eight.com> |
| 30 | * http://www.pulse-eight.com/ |
| 31 | * http://www.pulse-eight.net/ |
| 32 | */ |
| 33 | |
| 34 | #ifndef CECEXPORTS_H_ |
| 35 | #define CECEXPORTS_H_ |
| 36 | |
| 37 | #include <string> |
| 38 | #include <stdint.h> |
| 39 | #include <vector> |
| 40 | |
| 41 | #if !defined(DECLSPEC) |
| 42 | #if defined(_WIN32) || defined(_WIN64) |
| 43 | #include <windows.h> |
| 44 | #if defined DLL_EXPORT |
| 45 | #define DECLSPEC __declspec(dllexport) |
| 46 | #else |
| 47 | #define DECLSPEC __declspec(dllimport) |
| 48 | #endif |
| 49 | #else |
| 50 | #define DECLSPEC |
| 51 | #endif |
| 52 | #endif |
| 53 | |
| 54 | #ifdef __cplusplus |
| 55 | extern "C" { |
| 56 | namespace CEC { |
| 57 | #endif |
| 58 | #define CEC_MIN_VERSION 1 |
| 59 | #define CEC_LIB_VERSION 1 |
| 60 | #define CEC_SETTLE_DOWN_TIME 1000 |
| 61 | |
| 62 | typedef std::vector<uint8_t> cec_frame; |
| 63 | |
| 64 | typedef enum cec_user_control_code |
| 65 | { |
| 66 | CEC_USER_CONTROL_CODE_SELECT = 0x00, |
| 67 | CEC_USER_CONTROL_CODE_UP = 0x01, |
| 68 | CEC_USER_CONTROL_CODE_DOWN = 0x02, |
| 69 | CEC_USER_CONTROL_CODE_LEFT = 0x03, |
| 70 | CEC_USER_CONTROL_CODE_RIGHT = 0x04, |
| 71 | CEC_USER_CONTROL_CODE_RIGHT_UP = 0x05, |
| 72 | CEC_USER_CONTROL_CODE_RIGHT_DOWN = 0x06, |
| 73 | CEC_USER_CONTROL_CODE_LEFT_UP = 0x07, |
| 74 | CEC_USER_CONTROL_CODE_LEFT_DOWN = 0x08, |
| 75 | CEC_USER_CONTROL_CODE_ROOT_MENU = 0x09, |
| 76 | CEC_USER_CONTROL_CODE_SETUP_MENU = 0x0A, |
| 77 | CEC_USER_CONTROL_CODE_CONTENTS_MENU = 0x0B, |
| 78 | CEC_USER_CONTROL_CODE_FAVORITE_MENU = 0x0C, |
| 79 | CEC_USER_CONTROL_CODE_EXIT = 0x0D, |
| 80 | CEC_USER_CONTROL_CODE_NUMBER0 = 0x20, |
| 81 | CEC_USER_CONTROL_CODE_NUMBER1 = 0x21, |
| 82 | CEC_USER_CONTROL_CODE_NUMBER2 = 0x22, |
| 83 | CEC_USER_CONTROL_CODE_NUMBER3 = 0x23, |
| 84 | CEC_USER_CONTROL_CODE_NUMBER4 = 0x24, |
| 85 | CEC_USER_CONTROL_CODE_NUMBER5 = 0x25, |
| 86 | CEC_USER_CONTROL_CODE_NUMBER6 = 0x26, |
| 87 | CEC_USER_CONTROL_CODE_NUMBER7 = 0x27, |
| 88 | CEC_USER_CONTROL_CODE_NUMBER8 = 0x28, |
| 89 | CEC_USER_CONTROL_CODE_NUMBER9 = 0x29, |
| 90 | CEC_USER_CONTROL_CODE_DOT = 0x2A, |
| 91 | CEC_USER_CONTROL_CODE_ENTER = 0x2B, |
| 92 | CEC_USER_CONTROL_CODE_CLEAR = 0x2C, |
| 93 | CEC_USER_CONTROL_CODE_NEXT_FAVORITE = 0x2F, |
| 94 | CEC_USER_CONTROL_CODE_CHANNEL_UP = 0x30, |
| 95 | CEC_USER_CONTROL_CODE_CHANNEL_DOWN = 0x31, |
| 96 | CEC_USER_CONTROL_CODE_PREVIOUS_CHANNEL = 0x32, |
| 97 | CEC_USER_CONTROL_CODE_SOUND_SELECT = 0x33, |
| 98 | CEC_USER_CONTROL_CODE_INPUT_SELECT = 0x34, |
| 99 | CEC_USER_CONTROL_CODE_DISPLAY_INFORMATION = 0x35, |
| 100 | CEC_USER_CONTROL_CODE_HELP = 0x36, |
| 101 | CEC_USER_CONTROL_CODE_PAGE_UP = 0x37, |
| 102 | CEC_USER_CONTROL_CODE_PAGE_DOWN = 0x38, |
| 103 | CEC_USER_CONTROL_CODE_POWER = 0x40, |
| 104 | CEC_USER_CONTROL_CODE_VOLUME_UP = 0x41, |
| 105 | CEC_USER_CONTROL_CODE_VOLUME_DOWN = 0x42, |
| 106 | CEC_USER_CONTROL_CODE_MUTE = 0x43, |
| 107 | CEC_USER_CONTROL_CODE_PLAY = 0x44, |
| 108 | CEC_USER_CONTROL_CODE_STOP = 0x45, |
| 109 | CEC_USER_CONTROL_CODE_PAUSE = 0x46, |
| 110 | CEC_USER_CONTROL_CODE_RECORD = 0x47, |
| 111 | CEC_USER_CONTROL_CODE_REWIND = 0x48, |
| 112 | CEC_USER_CONTROL_CODE_FAST_FORWARD = 0x49, |
| 113 | CEC_USER_CONTROL_CODE_EJECT = 0x4A, |
| 114 | CEC_USER_CONTROL_CODE_FORWARD = 0x4B, |
| 115 | CEC_USER_CONTROL_CODE_BACKWARD = 0x4C, |
| 116 | CEC_USER_CONTROL_CODE_STOP_RECORD = 0x4D, |
| 117 | CEC_USER_CONTROL_CODE_PAUSE_RECORD = 0x4E, |
| 118 | CEC_USER_CONTROL_CODE_ANGLE = 0x50, |
| 119 | CEC_USER_CONTROL_CODE_SUB_PICTURE = 0x51, |
| 120 | CEC_USER_CONTROL_CODE_VIDEO_ON_DEMAND = 0x52, |
| 121 | CEC_USER_CONTROL_CODE_ELECTRONIC_PROGRAM_GUIDE = 0x53, |
| 122 | CEC_USER_CONTROL_CODE_TIMER_PROGRAMMING = 0x54, |
| 123 | CEC_USER_CONTROL_CODE_INITIAL_CONFIGURATION = 0x55, |
| 124 | CEC_USER_CONTROL_CODE_PLAY_FUNCTION = 0x60, |
| 125 | CEC_USER_CONTROL_CODE_PAUSE_PLAY_FUNCTION = 0x61, |
| 126 | CEC_USER_CONTROL_CODE_RECORD_FUNCTION = 0x62, |
| 127 | CEC_USER_CONTROL_CODE_PAUSE_RECORD_FUNCTION = 0x63, |
| 128 | CEC_USER_CONTROL_CODE_STOP_FUNCTION = 0x64, |
| 129 | CEC_USER_CONTROL_CODE_MUTE_FUNCTION = 0x65, |
| 130 | CEC_USER_CONTROL_CODE_RESTORE_VOLUME_FUNCTION = 0x66, |
| 131 | CEC_USER_CONTROL_CODE_TUNE_FUNCTION = 0x67, |
| 132 | CEC_USER_CONTROL_CODE_SELECT_MEDIA_FUNCTION = 0x68, |
| 133 | CEC_USER_CONTROL_CODE_SELECT_AV_INPUT_FUNCTION = 0x69, |
| 134 | CEC_USER_CONTROL_CODE_SELECT_AUDIO_INPUT_FUNCTION = 0x6A, |
| 135 | CEC_USER_CONTROL_CODE_POWER_TOGGLE_FUNCTION = 0x6B, |
| 136 | CEC_USER_CONTROL_CODE_POWER_OFF_FUNCTION = 0x6C, |
| 137 | CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION = 0x6D, |
| 138 | CEC_USER_CONTROL_CODE_F1_BLUE = 0x71, |
| 139 | CEC_USER_CONTROL_CODE_F2_RED = 0X72, |
| 140 | CEC_USER_CONTROL_CODE_F3_GREEN = 0x73, |
| 141 | CEC_USER_CONTROL_CODE_F4_YELLOW = 0x74, |
| 142 | CEC_USER_CONTROL_CODE_F5 = 0x75, |
| 143 | CEC_USER_CONTROL_CODE_DATA = 0x76, |
| 144 | CEC_USER_CONTROL_CODE_MAX = 0x76, |
| 145 | CEC_USER_CONTROL_CODE_UNKNOWN |
| 146 | } cec_user_control_code; |
| 147 | |
| 148 | typedef enum cec_logical_address |
| 149 | { |
| 150 | CECDEVICE_UNKNOWN = -1, //not a valid logical address |
| 151 | CECDEVICE_TV, |
| 152 | CECDEVICE_RECORDINGDEVICE1, |
| 153 | CECDEVICE_RECORDINGDEVICE2, |
| 154 | CECDEVICE_TUNER1, |
| 155 | CECDEVICE_PLAYBACKDEVICE1, |
| 156 | CECDEVICE_AUDIOSYSTEM, |
| 157 | CECDEVICE_TUNER2, |
| 158 | CECDEVICE_TUNER3, |
| 159 | CECDEVICE_PLAYBACKDEVICE2, |
| 160 | CECDEVICE_RECORDINGDEVICE3, |
| 161 | CECDEVICE_TUNER4, |
| 162 | CECDEVICE_PLAYBACKDEVICE3, |
| 163 | CECDEVICE_RESERVED1, |
| 164 | CECDEVICE_RESERVED2, |
| 165 | CECDEVICE_FREEUSE, |
| 166 | CECDEVICE_UNREGISTERED = 15, |
| 167 | CECDEVICE_BROADCAST = 15 |
| 168 | } cec_logical_address; |
| 169 | |
| 170 | typedef enum cec_log_level |
| 171 | { |
| 172 | CEC_LOG_DEBUG = 0, |
| 173 | CEC_LOG_NOTICE, |
| 174 | CEC_LOG_WARNING, |
| 175 | CEC_LOG_ERROR |
| 176 | } cec_log_level; |
| 177 | |
| 178 | typedef struct cec_log_message |
| 179 | { |
| 180 | std::string message; |
| 181 | cec_log_level level; |
| 182 | } cec_log_message; |
| 183 | |
| 184 | typedef struct cec_keypress |
| 185 | { |
| 186 | cec_user_control_code keycode; |
| 187 | unsigned int duration; |
| 188 | } cec_keypress; |
| 189 | |
| 190 | typedef struct cec_device |
| 191 | { |
| 192 | std::string path; |
| 193 | std::string comm; |
| 194 | } cec_device; |
| 195 | }; |
| 196 | |
| 197 | #ifdef __cplusplus |
| 198 | #include "CECExportsCpp.h" |
| 199 | #include "CECExportsC.h" |
| 200 | }; |
| 201 | #else |
| 202 | #include "CECExportsC.h" |
| 203 | #endif |
| 204 | |
| 205 | #endif /* CECEXPORTS_H_ */ |