gmerlin
|
00001 /***************************************************************** 00002 * gmerlin - a general purpose multimedia framework and applications 00003 * 00004 * Copyright (c) 2001 - 2011 Members of the Gmerlin project 00005 * gmerlin-general@lists.sourceforge.net 00006 * http://gmerlin.sourceforge.net 00007 * 00008 * This program is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU General Public License as published by 00010 * the Free Software Foundation, either version 2 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * This program is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU General Public License 00019 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00020 * *****************************************************************/ 00021 00022 #ifndef __BG_PLAYERMSG_H_ 00023 #define __BG_PLAYERMSG_H_ 00024 00032 #define BG_PLAYER_STATE_INIT -1 //!< Initializing 00033 #define BG_PLAYER_STATE_STOPPED 0 //!< Stopped, waiting for play command 00034 #define BG_PLAYER_STATE_PLAYING 1 //!< Playing 00035 #define BG_PLAYER_STATE_SEEKING 2 //!< Seeking 00036 #define BG_PLAYER_STATE_CHANGING 3 //!< Changing the track 00037 #define BG_PLAYER_STATE_BUFFERING 4 //!< Buffering data 00038 #define BG_PLAYER_STATE_PAUSED 5 //!< Paused 00039 #define BG_PLAYER_STATE_EOF 6 //!< Finished playback 00040 #define BG_PLAYER_STATE_STARTING 8 //!< Starting playback 00041 #define BG_PLAYER_STATE_ERROR 9 //!< Error 00042 00047 /* Message definition for the player */ 00048 00049 /**************************** 00050 * Commands for the player 00051 ****************************/ 00052 00053 /* Start playing */ 00054 /* arg1: Input plugin handle */ 00055 /* arg2: Track index for plugins with multiple tracks */ 00056 /* arg3: Play flags, see defines below */ 00057 00058 #define BG_PLAYER_CMD_PLAY 0 00059 00060 /* Stop playing */ 00061 00062 #define BG_PLAYER_CMD_STOP 1 00063 00064 /* Seek to a specific point */ 00065 /* arg1: seek Perfenctage */ 00066 /* (between 0.0 and 1.0, float) */ 00067 00068 #define BG_PLAYER_CMD_SEEK 2 00069 00070 /* Set the state of the player */ 00071 /* arg1: New state */ 00072 00073 /* 00074 * if(state == BG_PLAYER_STATE_BUFFERING) 00075 * arg2: Buffering percentage (float) 00076 * else if(state == BG_PLAYER_STATE_ERROR) 00077 * arg2: String describing the error 00078 * else if(state == BG_PLAYER_STATE_PLAYING) 00079 * arg2: Integer (1 if player can pause playback without messing up the data source) 00080 */ 00081 00082 #define BG_PLAYER_CMD_SETSTATE 3 00083 00084 /* Quit playback thread (used by bg_player_quit()) */ 00085 00086 #define BG_PLAYER_CMD_QUIT 4 00087 00088 /* Change output plugins, arg1 is plugin handle of the opened plugin */ 00089 00090 #define BG_PLAYER_CMD_SET_OV_PLUGIN 5 00091 00092 #define BG_PLAYER_CMD_SET_OA_PLUGIN 6 00093 00094 /* Set track name */ 00095 00096 #define BG_PLAYER_CMD_SET_NAME 7 00097 00098 /* Act like a pause button */ 00099 00100 #define BG_PLAYER_CMD_PAUSE 8 00101 00102 /* 00103 * Seek relative (gavl_time_t) 00104 */ 00105 00106 #define BG_PLAYER_CMD_SEEK_REL 10 00107 00108 /* Set volume (float dB value) */ 00109 00110 #define BG_PLAYER_CMD_SET_VOLUME 11 00111 00112 /* Set volume (float dB value) */ 00113 00114 #define BG_PLAYER_CMD_SET_VOLUME_REL 12 00115 00116 /* Like BG_PLAYER_CMD_PLAY but go into the pause state right after the 00117 playback is set up */ 00118 00119 #define BG_PLAYER_CMD_PLAY_PAUSE 13 00120 00121 #define BG_PLAYER_CMD_SET_AUDIO_STREAM 14 00122 #define BG_PLAYER_CMD_SET_VIDEO_STREAM 15 00123 #define BG_PLAYER_CMD_SET_SUBTITLE_STREAM 16 00124 00125 /* Argument 1: keycode (see keycodes.h) 00126 Argument 2: mask (see keycodes.h) 00127 */ 00128 00129 #define BG_PLAYER_CMD_KEY 17 /* A key was pressed */ 00130 00131 #define BG_PLAYER_CMD_CHANGE 18 /* Player should prepare for changing the 00132 track */ 00133 00134 #define BG_PLAYER_CMD_TOGGLE_MUTE 19 /* Toggle mute state */ 00135 00136 #define BG_PLAYER_CMD_SET_CHAPTER 20 /* Goto chapter */ 00137 00138 #define BG_PLAYER_CMD_NEXT_CHAPTER 21 /* Next chapter */ 00139 00140 #define BG_PLAYER_CMD_PREV_CHAPTER 22 /* Previous chapter */ 00141 00142 #define BG_PLAYER_CMD_INTERRUPT 23 /* Interrupt playback */ 00143 #define BG_PLAYER_CMD_INTERRUPT_RESUME 24 /* Resume interrupted playback */ 00144 00145 /******************************** 00146 * Messages from the player 00147 ********************************/ 00148 00162 #define BG_PLAYER_MSG_TIME_CHANGED 0 00163 00172 #define BG_PLAYER_MSG_TRACK_CHANGED 1 00173 00186 #define BG_PLAYER_MSG_STATE_CHANGED 2 00187 00196 #define BG_PLAYER_MSG_TRACK_NAME 3 00197 00203 #define BG_PLAYER_MSG_TRACK_DURATION 5 00204 00214 #define BG_PLAYER_MSG_TRACK_NUM_STREAMS 4 00215 00225 #define BG_PLAYER_MSG_AUDIO_STREAM 6 00226 00236 #define BG_PLAYER_MSG_VIDEO_STREAM 7 00237 00238 00248 #define BG_PLAYER_MSG_SUBTITLE_STREAM 9 00249 00250 /* Metadata (is only sent, if information is available) */ 00251 00257 #define BG_PLAYER_MSG_METADATA 10 00258 00263 #define BG_PLAYER_MSG_VOLUME_CHANGED 16 00264 00277 #define BG_PLAYER_MSG_AUDIO_STREAM_INFO 17 00278 00291 #define BG_PLAYER_MSG_VIDEO_STREAM_INFO 18 00292 00304 #define BG_PLAYER_MSG_SUBTITLE_STREAM_INFO 19 00305 00316 #define BG_PLAYER_MSG_ACCEL 20 /* A key shortcut 00317 was pressed */ 00318 00324 #define BG_PLAYER_MSG_CLEANUP 21 00325 00332 #define BG_PLAYER_MSG_MUTE 22 00333 00339 #define BG_PLAYER_MSG_NUM_CHAPTERS 23 00340 00348 #define BG_PLAYER_MSG_CHAPTER_INFO 24 00349 00355 #define BG_PLAYER_MSG_CHAPTER_CHANGED 25 00356 00360 #define BG_PLAYER_MSG_INTERRUPT 26 00361 00365 #define BG_PLAYER_MSG_INTERRUPT_RESUME 27 00366 00373 #define BG_PLAYER_MSG_INPUT 28 00374 00381 #define BG_PLAYER_MSG_AUDIO_PEAK 29 00382 00386 #endif // __BG_PLAYERMSG_H_