1 /* 2 * Copyright (C) 2014 Amlogic Corporation. 3 * 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 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 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. 15 */ 16 17 #ifndef PLAYER_MESSAGE_H 18 #define PLAYER_MESSAGE_H 19 20 #define MESSAGE_MAX 8 21 22 #define CTRL_CMD_RESPONSE (0xffff) 23 24 typedef enum { 25 CMD_EXIT = (1 << 0), 26 CMD_PLAY = (1 << 1), 27 CMD_PLAY_START = (1 << 2), 28 CMD_STOP = (1 << 3), 29 CMD_START = (1 << 4), 30 CMD_NEXT = (1 << 5), 31 CMD_PREV = (1 << 6), 32 CMD_PAUSE = (1 << 7), 33 CMD_RESUME = (1 << 8), 34 CMD_SEARCH = (1 << 9), 35 CMD_FF = (1 << 10), 36 CMD_FB = (1 << 11), 37 CMD_SWITCH_AID = (1 << 12), 38 CMD_SWITCH_SID = (1 << 13), 39 CMD_SWITCH_TSPROGRAM= (1 << 14), 40 CMD_CTRL_MAX = (1 << 31), 41 } ctrl_cmd_t; 42 43 typedef enum { 44 CMD_LOOP = (1 << 0), 45 CMD_NOLOOP = (1 << 1), 46 CMD_BLACKOUT = (1 << 2), 47 CMD_NOBLACK = (1 << 3), 48 CMD_NOAUDIO = (1 << 4), 49 CMD_NOVIDEO = (1 << 5), 50 CMD_MUTE = (1 << 6), 51 CMD_UNMUTE = (1 << 7), 52 CMD_SET_VOLUME = (1 << 8), 53 CMD_SPECTRUM_SWITCH = (1 << 9), 54 CMD_SET_BALANCE = (1 << 10), 55 CMD_SWAP_LR = (1 << 11), 56 CMD_LEFT_MONO = (1 << 12), 57 CMD_RIGHT_MONO = (1 << 13), 58 CMD_SET_STEREO = (1 << 14), 59 CMD_EN_AUTOBUF = (1 << 15), 60 CMD_SET_AUTOBUF_LEV = (1 << 16), 61 CMD_SET_FREERUN_MODE = (1 << 17), 62 CMD_MODE_MAX = (1 << 31), 63 } ctrl_mode_t; 64 65 typedef enum { 66 CMD_GET_VOLUME = (1 << 0), 67 CMD_GET_VOL_RANGE = (1 << 1), 68 CMD_GET_PLAY_STA = (1 << 2), 69 CMD_GET_CURTIME = (1 << 3), 70 CMD_GET_DURATION = (1 << 4), 71 CMD_GET_MEDIA_INFO = (1 << 5), 72 CMD_LIST_PID = (1 << 6), 73 CMD_GET_MAX = (1 << 31), 74 } get_info_t; 75 76 typedef struct { 77 float min; 78 float max; 79 } volume_range_t; 80 81 typedef struct { 82 ctrl_cmd_t ctrl_cmd; 83 get_info_t info_cmd; 84 ctrl_mode_t set_mode; 85 int pid; 86 int cid; 87 union { 88 char *filename; 89 char *file_list; 90 int param; 91 float f_param; 92 }; 93 union { 94 int param1; 95 float f_param1; 96 }; 97 union { 98 int param2; 99 float f_param2; 100 }; 101 } player_cmd_t; 102 103 int message_free(player_cmd_t * cmd); 104 player_cmd_t * message_alloc(void); 105 int cmd2str(player_cmd_t *cmd, char *buf); 106 #endif 107 108