gmerlin
playermsg.h
1 /*****************************************************************
2  * gmerlin - a general purpose multimedia framework and applications
3  *
4  * Copyright (c) 2001 - 2011 Members of the Gmerlin project
5  * gmerlin-general@lists.sourceforge.net
6  * http://gmerlin.sourceforge.net
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  * *****************************************************************/
21 
22 #ifndef __BG_PLAYERMSG_H_
23 #define __BG_PLAYERMSG_H_
24 
32 #define BG_PLAYER_STATE_INIT -1
33 #define BG_PLAYER_STATE_STOPPED 0
34 #define BG_PLAYER_STATE_PLAYING 1
35 #define BG_PLAYER_STATE_SEEKING 2
36 #define BG_PLAYER_STATE_CHANGING 3
37 #define BG_PLAYER_STATE_BUFFERING 4
38 #define BG_PLAYER_STATE_PAUSED 5
39 #define BG_PLAYER_STATE_EOF 6
40 #define BG_PLAYER_STATE_STARTING 8
41 #define BG_PLAYER_STATE_ERROR 9
42 
43 
47 /* Message definition for the player */
48 
49 /****************************
50  * Commands for the player
51  ****************************/
52 
53 /* Start playing */
54 /* arg1: Input plugin handle */
55 /* arg2: Track index for plugins with multiple tracks */
56 /* arg3: Play flags, see defines below */
57 
58 #define BG_PLAYER_CMD_PLAY 0
59 
60 /* Stop playing */
61 
62 #define BG_PLAYER_CMD_STOP 1
63 
64 /* Seek to a specific point */
65 /* arg1: seek Perfenctage */
66 /* (between 0.0 and 1.0, float) */
67 
68 #define BG_PLAYER_CMD_SEEK 2
69 
70 /* Set the state of the player */
71 /* arg1: New state */
72 
73 /*
74  * if(state == BG_PLAYER_STATE_BUFFERING)
75  * arg2: Buffering percentage (float)
76  * else if(state == BG_PLAYER_STATE_ERROR)
77  * arg2: String describing the error
78  * else if(state == BG_PLAYER_STATE_PLAYING)
79  * arg2: Integer (1 if player can pause playback without messing up the data source)
80  */
81 
82 #define BG_PLAYER_CMD_SETSTATE 3
83 
84 /* Quit playback thread (used by bg_player_quit()) */
85 
86 #define BG_PLAYER_CMD_QUIT 4
87 
88 /* Change output plugins, arg1 is plugin handle of the opened plugin */
89 
90 #define BG_PLAYER_CMD_SET_OV_PLUGIN 5
91 
92 #define BG_PLAYER_CMD_SET_OA_PLUGIN 6
93 
94 /* Set track name */
95 
96 #define BG_PLAYER_CMD_SET_NAME 7
97 
98 /* Act like a pause button */
99 
100 #define BG_PLAYER_CMD_PAUSE 8
101 
102 /*
103  * Seek relative (gavl_time_t)
104  */
105 
106 #define BG_PLAYER_CMD_SEEK_REL 10
107 
108 /* Set volume (float dB value) */
109 
110 #define BG_PLAYER_CMD_SET_VOLUME 11
111 
112 /* Set volume (float dB value) */
113 
114 #define BG_PLAYER_CMD_SET_VOLUME_REL 12
115 
116 /* Like BG_PLAYER_CMD_PLAY but go into the pause state right after the
117  playback is set up */
118 
119 #define BG_PLAYER_CMD_PLAY_PAUSE 13
120 
121 #define BG_PLAYER_CMD_SET_AUDIO_STREAM 14
122 #define BG_PLAYER_CMD_SET_VIDEO_STREAM 15
123 #define BG_PLAYER_CMD_SET_SUBTITLE_STREAM 16
124 
125 /* Argument 1: keycode (see keycodes.h)
126  Argument 2: mask (see keycodes.h)
127 */
128 
129 #define BG_PLAYER_CMD_KEY 17 /* A key was pressed */
130 
131 #define BG_PLAYER_CMD_CHANGE 18 /* Player should prepare for changing the
132  track */
133 
134 #define BG_PLAYER_CMD_TOGGLE_MUTE 19 /* Toggle mute state */
135 
136 #define BG_PLAYER_CMD_SET_CHAPTER 20 /* Goto chapter */
137 
138 #define BG_PLAYER_CMD_NEXT_CHAPTER 21 /* Next chapter */
139 
140 #define BG_PLAYER_CMD_PREV_CHAPTER 22 /* Previous chapter */
141 
142 #define BG_PLAYER_CMD_INTERRUPT 23 /* Interrupt playback */
143 #define BG_PLAYER_CMD_INTERRUPT_RESUME 24 /* Resume interrupted playback */
144 
145 /********************************
146  * Messages from the player
147 ********************************/
148 
162 #define BG_PLAYER_MSG_TIME_CHANGED 0
163 
172 #define BG_PLAYER_MSG_TRACK_CHANGED 1
173 
186 #define BG_PLAYER_MSG_STATE_CHANGED 2
187 
196 #define BG_PLAYER_MSG_TRACK_NAME 3
197 
203 #define BG_PLAYER_MSG_TRACK_DURATION 5
204 
214 #define BG_PLAYER_MSG_TRACK_NUM_STREAMS 4
215 
225 #define BG_PLAYER_MSG_AUDIO_STREAM 6
226 
236 #define BG_PLAYER_MSG_VIDEO_STREAM 7
237 
238 
248 #define BG_PLAYER_MSG_SUBTITLE_STREAM 9
249 
250 /* Metadata (is only sent, if information is available) */
251 
257 #define BG_PLAYER_MSG_METADATA 10
258 
263 #define BG_PLAYER_MSG_VOLUME_CHANGED 16
264 
277 #define BG_PLAYER_MSG_AUDIO_STREAM_INFO 17
278 
291 #define BG_PLAYER_MSG_VIDEO_STREAM_INFO 18
292 
304 #define BG_PLAYER_MSG_SUBTITLE_STREAM_INFO 19
305 
316 #define BG_PLAYER_MSG_ACCEL 20 /* A key shortcut
317  was pressed */
318 
324 #define BG_PLAYER_MSG_CLEANUP 21
325 
332 #define BG_PLAYER_MSG_MUTE 22
333 
339 #define BG_PLAYER_MSG_NUM_CHAPTERS 23
340 
348 #define BG_PLAYER_MSG_CHAPTER_INFO 24
349 
355 #define BG_PLAYER_MSG_CHAPTER_CHANGED 25
356 
360 #define BG_PLAYER_MSG_INTERRUPT 26
361 
365 #define BG_PLAYER_MSG_INTERRUPT_RESUME 27
366 
373 #define BG_PLAYER_MSG_INPUT 28
374 
381 #define BG_PLAYER_MSG_AUDIO_PEAK 29
382 
386 #endif // __BG_PLAYERMSG_H_