Mercurial > mplayer.hg
annotate gui/interface.h @ 35389:a54338c73df8
Simplify playlist handling by defining a symbolic constant.
This should make the code also easier to read.
author | ib |
---|---|
date | Mon, 26 Nov 2012 10:48:26 +0000 |
parents | 02006c5b3b30 |
children | d076af01765d |
rev | line source |
---|---|
26458 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
18 | |
26029 | 19 #ifndef MPLAYER_GUI_INTERFACE_H |
20 #define MPLAYER_GUI_INTERFACE_H | |
23077 | 21 |
26382
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26029
diff
changeset
|
22 #include "config.h" |
33774
474ffcdcc6e7
Change guiInterface_t void pointer member declarations.
ib
parents:
33773
diff
changeset
|
23 #include "libaf/af.h" |
474ffcdcc6e7
Change guiInterface_t void pointer member declarations.
ib
parents:
33773
diff
changeset
|
24 #include "libmpdemux/stheader.h" |
30533
e3e329bc727a
Avoid forward declarations for import_initial_playtree_into_gui() and
diego
parents:
29263
diff
changeset
|
25 #include "m_config.h" |
33774
474ffcdcc6e7
Change guiInterface_t void pointer member declarations.
ib
parents:
33773
diff
changeset
|
26 #include "mp_core.h" |
30533
e3e329bc727a
Avoid forward declarations for import_initial_playtree_into_gui() and
diego
parents:
29263
diff
changeset
|
27 #include "playtree.h" |
29149 | 28 #include "stream/stream.h" |
23077 | 29 |
33021 | 30 // These are in support of the non-GUI files that interact with |
31 // the GUI and that only need to include interface.h for this. | |
32 // ------------------------------------------------------------ | |
32984 | 33 #include "cfg.h" |
23077 | 34 |
33021 | 35 extern int use_gui; // this is defined in mplayer.c |
36 // ------------------------------------------------------------ | |
37 | |
33466 | 38 #define GMPlayer "gmplayer" |
39 | |
33980 | 40 /// gui() instructions |
33767 | 41 enum { |
42 GUI_END_FILE, | |
43 GUI_HANDLE_EVENTS, | |
44 GUI_HANDLE_X_EVENT, | |
45 GUI_PREPARE, | |
46 GUI_REDRAW, | |
47 GUI_RUN_COMMAND, | |
34339 | 48 GUI_RUN_MESSAGE, |
33767 | 49 GUI_SETUP_VIDEO_WINDOW, |
50 GUI_SET_AFILTER, | |
51 GUI_SET_AUDIO, | |
52 GUI_SET_CONTEXT, | |
53 GUI_SET_MIXER, | |
54 GUI_SET_STATE, | |
55 GUI_SET_STREAM, | |
56 GUI_SET_VIDEO | |
57 }; | |
23077 | 58 |
33980 | 59 //@{ |
60 /// Playing state | |
33614 | 61 #define GUI_STOP 0 |
62 #define GUI_PLAY 1 | |
63 #define GUI_PAUSE 2 | |
33980 | 64 //@} |
23077 | 65 |
33980 | 66 //@{ |
67 /// NewPlay reason | |
33890 | 68 #define GUI_FILE_SAME 1 |
69 #define GUI_FILE_NEW 2 | |
33980 | 70 //@} |
33890 | 71 |
35389
a54338c73df8
Simplify playlist handling by defining a symbolic constant.
ib
parents:
35376
diff
changeset
|
72 /// StreamTypes that are permitted in a playlist |
a54338c73df8
Simplify playlist handling by defining a symbolic constant.
ib
parents:
35376
diff
changeset
|
73 #define isPlaylistStreamtype (guiInfo.StreamType == STREAMTYPE_FILE || guiInfo.StreamType == STREAMTYPE_STREAM) |
a54338c73df8
Simplify playlist handling by defining a symbolic constant.
ib
parents:
35376
diff
changeset
|
74 |
33980 | 75 /// mplayer() instructions |
33767 | 76 enum { |
33768 | 77 MPLAYER_EXIT_GUI, |
33767 | 78 MPLAYER_SET_AUTO_QUALITY, |
79 MPLAYER_SET_BRIGHTNESS, | |
80 MPLAYER_SET_CONTRAST, | |
81 MPLAYER_SET_EQUALIZER, | |
82 MPLAYER_SET_EXTRA_STEREO, | |
83 MPLAYER_SET_FONT_AUTOSCALE, | |
84 MPLAYER_SET_FONT_BLUR, | |
85 MPLAYER_SET_FONT_ENCODING, | |
86 MPLAYER_SET_FONT_FACTOR, | |
87 MPLAYER_SET_FONT_OSDSCALE, | |
88 MPLAYER_SET_FONT_OUTLINE, | |
89 MPLAYER_SET_FONT_TEXTSCALE, | |
90 MPLAYER_SET_HUE, | |
91 MPLAYER_SET_PANSCAN, | |
92 MPLAYER_SET_SATURATION, | |
93 MPLAYER_SET_SUB_ENCODING | |
94 }; | |
23077 | 95 |
32984 | 96 typedef struct { |
33774
474ffcdcc6e7
Change guiInterface_t void pointer member declarations.
ib
parents:
33773
diff
changeset
|
97 MPContext *mpcontext; |
474ffcdcc6e7
Change guiInterface_t void pointer member declarations.
ib
parents:
33773
diff
changeset
|
98 sh_video_t *sh_video; |
474ffcdcc6e7
Change guiInterface_t void pointer member declarations.
ib
parents:
33773
diff
changeset
|
99 af_stream_t *afilter; |
32984 | 100 |
33944 | 101 int VideoWindow; |
33901 | 102 int VideoWidth; |
103 int VideoHeight; | |
32984 | 104 |
34076 | 105 int StreamType; |
33900 | 106 int AudioChannels; |
107 | |
33902 | 108 int AudioStreams; |
109 stream_language_t AudioStream[32]; | |
110 | |
111 int Subtitles; | |
112 stream_language_t Subtitle[32]; | |
113 | |
33900 | 114 char *Filename; // public, read access by MPlayer |
115 char *AudioFilename; | |
116 char *SubtitleFilename; | |
32984 | 117 |
33876
4789b8eed97e
Get rid of a bunch of needless or redundant guiInfo members.
ib
parents:
33791
diff
changeset
|
118 int Tracks; |
33900 | 119 int Track; // public, read access by MPlayer |
120 int Chapters; | |
121 int Chapter; // public, write access by MPlayer | |
122 int Angles; | |
123 int Angle; | |
124 | |
125 int Playing; // public, read access by MPlayer | |
126 | |
127 int RunningTime; // public, write access by MPlayer | |
128 int ElapsedTime; // public, write access by MPlayer | |
129 float Position; // public, write access by MPlayer | |
32984 | 130 |
131 float Volume; | |
132 float Balance; | |
133 | |
33900 | 134 int NewPlay; // public, read access by MPlayer |
32984 | 135 } guiInterface_t; |
136 | |
33555 | 137 extern guiInterface_t guiInfo; |
32984 | 138 |
33980 | 139 /// @name MPlayer -> GUI |
140 //@{ | |
33791
8b0c78a85a8c
Cosmetic: Change parameter names of gui() and mplayer().
ib
parents:
33790
diff
changeset
|
141 int gui(int what, void *data); |
32984 | 142 void guiDone(void); |
143 void guiInit(void); | |
33764 | 144 int guiPlaylistAdd(play_tree_t *my_playtree, m_config_t *config); |
33752 | 145 int guiPlaylistInitialize(play_tree_t *my_playtree, m_config_t *config, int enqueue); |
33980 | 146 //@} |
23077 | 147 |
33980 | 148 /// @name GUI -> MPlayer |
149 //@{ | |
33791
8b0c78a85a8c
Cosmetic: Change parameter names of gui() and mplayer().
ib
parents:
33790
diff
changeset
|
150 void mplayer(int what, float value, void *data); |
33763 | 151 void mplayerLoadFont(void); |
33790
ab6d06f5b98b
Add const to some string pointer arguments that will not be modified.
ib
parents:
33776
diff
changeset
|
152 void mplayerLoadSubtitle(const char *name); |
33764 | 153 void gmp_msg(int mod, int lev, const char *format, ...); |
33980 | 154 //@} |
33745 | 155 |
26029 | 156 #endif /* MPLAYER_GUI_INTERFACE_H */ |