annotate gui/win32/interface.c @ 35452:f42cc2361ee4

Cosmetic: Rename uiSetFileName().
author ib
date Sat, 01 Dec 2012 19:05:24 +0000
parents 20c90da2ba0d
children 7bb176fac55c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
1 /*
23079
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
2 * MPlayer GUI for Win32
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
3 * Copyright (C) 2003 Sascha Sommer <saschasommer@freenet.de>
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
4 * Copyright (C) 2006 Erik Augustson <erik_27can@yahoo.com>
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
5 * Copyright (C) 2006 Gianluigi Tiesi <sherpya@netfarm.it>
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
6 *
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
7 * This file is part of MPlayer.
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
8 *
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
9 * MPlayer is free software; you can redistribute it and/or modify
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
10 * it under the terms of the GNU General Public License as published by
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
12 * (at your option) any later version.
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
13 *
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
14 * MPlayer is distributed in the hope that it will be useful,
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
17 * GNU General Public License for more details.
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
18 *
26457
9ba6d4487292 Use standard GPL header.
diego
parents: 26372
diff changeset
19 * You should have received a copy of the GNU General Public License along
9ba6d4487292 Use standard GPL header.
diego
parents: 26372
diff changeset
20 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
9ba6d4487292 Use standard GPL header.
diego
parents: 26372
diff changeset
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23079
8e9b11648f40 Use proper GPL header.
diego
parents: 23078
diff changeset
22 */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
23
34405
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
24 #include "config.h"
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
25
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
26 #if defined(CONFIG_LIBCDIO)
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
27 #include <cdio/cdda.h>
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
28 #elif defined(CONFIG_CDDA)
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
29 #include <cdda_interface.h>
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
30 #endif
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
31
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
32 #include <windows.h>
33358
c9c9f015619b Don't use CreateThread() unconditionally.
ib
parents: 33303
diff changeset
33
34115
3d7ee643b110 Port to Wine.
ib
parents: 34084
diff changeset
34 #if defined(__CYGWIN__) || defined(__WINE__)
33358
c9c9f015619b Don't use CreateThread() unconditionally.
ib
parents: 33303
diff changeset
35 #define _beginthreadex CreateThread
34392
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
36 #ifdef __WINE__
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
37 #include <winioctl.h>
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
38 #define WINE_MOUNTMGR_EXTENSIONS
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
39 #include <ddk/mountmgr.h>
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
40 #endif
33358
c9c9f015619b Don't use CreateThread() unconditionally.
ib
parents: 33303
diff changeset
41 #else
c9c9f015619b Don't use CreateThread() unconditionally.
ib
parents: 33303
diff changeset
42 #include <process.h>
c9c9f015619b Don't use CreateThread() unconditionally.
ib
parents: 33303
diff changeset
43 #endif
c9c9f015619b Don't use CreateThread() unconditionally.
ib
parents: 33303
diff changeset
44
30901
76a13038105e Rename get_path.[ch] --> path.[ch].
diego
parents: 30722
diff changeset
45 #include "path.h"
26372
76413880bfad Update include paths to account for build system changes.
diego
parents: 26193
diff changeset
46 #include "gui/interface.h"
23091
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
47 #include "m_option.h"
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
48 #include "mixer.h"
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
49 #include "mp_msg.h"
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
50 #include "help_mp.h"
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
51 #include "codec-cfg.h"
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
52 #include "stream/stream.h"
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
53 #include "libmpdemux/demuxer.h"
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
54 #include "libmpdemux/stheader.h"
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26457
diff changeset
55 #ifdef CONFIG_DVDREAD
23091
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
56 #include "stream/stream_dvd.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
57 #endif
23091
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
58 #include "input/input.h"
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
59 #include "libvo/video_out.h"
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
60 #include "libao2/audio_out.h"
52488bb09d90 Consistently use quotes instead of angled brackets in #include
diego
parents: 23079
diff changeset
61 #include "access_mpcontext.h"
30558
71acebef19ec Fix win32 gui compilation.
reimar
parents: 27391
diff changeset
62 #include "libmpcodecs/vd.h"
31425
2392ad3cec9c Move af_cfg extern variable declaration to dec_audio.h.
diego
parents: 31312
diff changeset
63 #include "libmpcodecs/dec_audio.h"
33761
16286ee1fc71 Fix Win32 GUI compilation problems.
ib
parents: 33752
diff changeset
64 #include "gui/ui/actions.h"
33557
71ec25d1da10 Fix compilation after r33644.
ib
parents: 33555
diff changeset
65 #include "gui/ui/gmplayer.h"
33770
6134493605c6 Use macro nfree() in Win32 GUI code.
ib
parents: 33761
diff changeset
66 #include "gui/util/mem.h"
33761
16286ee1fc71 Fix Win32 GUI compilation problems.
ib
parents: 33752
diff changeset
67 #include "gui/util/list.h"
16286ee1fc71 Fix Win32 GUI compilation problems.
ib
parents: 33752
diff changeset
68 #include "gui/util/string.h"
30558
71acebef19ec Fix win32 gui compilation.
reimar
parents: 27391
diff changeset
69 #include "mp_core.h"
32093
e34226e0a890 Fix win32 gui compilation
reimar
parents: 31426
diff changeset
70 #include "mpcommon.h"
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
71 #include "gui.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
72 #include "dialogs.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
73
34399
f2c03009068d Don't explicitly set stream type if the type doesn't change.
ib
parents: 34393
diff changeset
74 #define SAME_STREAMTYPE (STREAMTYPE_DUMMY - 1)
f2c03009068d Don't explicitly set stream type if the type doesn't change.
ib
parents: 34393
diff changeset
75
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
76 int guiWinID = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
77
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
78 char *skinName = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79 char *codecname = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
80 static gui_t *mygui = NULL;
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
81 static int update_videowindow(void);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
82 static RECT old_rect;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
83 static DWORD style;
24992
5701e23ebcb4 Better handling of win32 GUI thread:
zuxy
parents: 23148
diff changeset
84 static HANDLE hThread;
5701e23ebcb4 Better handling of win32 GUI thread:
zuxy
parents: 23148
diff changeset
85 static unsigned threadId;
25765
304fc0bbefe1 audio_out / video_out structs should be treated as const
reimar
parents: 24992
diff changeset
86 const ao_functions_t *audio_out = NULL;
304fc0bbefe1 audio_out / video_out structs should be treated as const
reimar
parents: 24992
diff changeset
87 const vo_functions_t *video_out = NULL;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
88 mixer_t *mixer = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
89
34392
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
90 #ifdef __WINE__
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
91 /**
34393
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
92 * @brief Convert a Windows style path to a file name into an Unix style one.
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
93 *
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
94 * @param filename pointer to the file path to be converted
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
95 *
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
96 * @return pointer to the converted file path
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
97 */
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
98 static char *unix_name (char *filename)
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
99 {
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
100 static char *unix_filename;
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
101 LPSTR (*CDECL wine_get_unix_file_name_ptr)(LPCWSTR);
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
102 int wchar_conv;
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
103
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
104 if (*filename && (filename[1] == ':'))
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
105 {
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
106 wine_get_unix_file_name_ptr = (void *) GetProcAddress(GetModuleHandleA("KERNEL32"), "wine_get_unix_file_name");
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
107 wchar_conv = MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, NULL, 0);
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
108
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
109 if (wine_get_unix_file_name_ptr && wchar_conv)
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
110 {
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
111 WCHAR *ntpath;
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
112 char *unix_name;
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
113
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
114 ntpath = HeapAlloc(GetProcessHeap(), 0, sizeof(*ntpath) * (wchar_conv + 1));
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
115 MultiByteToWideChar(CP_UNIXCP, 0, filename, -1, ntpath, wchar_conv);
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
116 unix_name = wine_get_unix_file_name_ptr(ntpath);
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
117 setdup(&unix_filename, unix_name);
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
118 filename = unix_filename;
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
119 HeapFree(GetProcessHeap(), 0, unix_name);
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
120 HeapFree(GetProcessHeap(), 0, ntpath);
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
121 }
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
122 }
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
123
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
124 return filename;
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
125 }
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
126
4c8bdc633648 Cosmetic: Collect together Wine port related functions.
ib
parents: 34392
diff changeset
127 /**
34392
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
128 * @brief Convert a Windows style device name into an Unix style one.
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
129 *
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
130 * @param device pointer to the device name to be converted
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
131 *
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
132 * @return pointer to the converted device name
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
133 */
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
134 static char *unix_device (char *device)
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
135 {
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
136 static char *unix_devname;
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
137 HANDLE mgr;
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
138 DWORD size = 1024;
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
139
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
140 mgr = CreateFileW(MOUNTMGR_DOS_DEVICE_NAME, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
141
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
142 if (mgr != INVALID_HANDLE_VALUE)
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
143 {
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
144 struct mountmgr_unix_drive input;
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
145 struct mountmgr_unix_drive *data;
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
146
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
147 data = HeapAlloc(GetProcessHeap(), 0, size);
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
148
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
149 if (data)
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
150 {
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
151 memset(&input, 0, sizeof(input));
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
152 input.letter = *device;
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
153
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
154 if (DeviceIoControl(mgr, IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE, &input, sizeof(input), data, size, NULL, NULL))
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
155 {
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
156 if (data->device_offset)
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
157 {
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
158 setdup(&unix_devname, (char *) data + data->device_offset);
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
159 device = unix_devname;
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
160 }
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
161 }
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
162
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
163 HeapFree(GetProcessHeap(), 0, data);
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
164 }
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
165
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
166 CloseHandle(mgr);
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
167 }
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
168
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
169 return device;
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
170 }
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
171 #endif
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
172
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
173 /* test for playlist files, no need to specify -playlist on the commandline.
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
174 * add any conceivable playlist extensions here.
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
175 * - Erik
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
176 */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
177 int parse_filename(char *file, play_tree_t *playtree, m_config_t *mconfig, int clear)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
178 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
179 if(clear)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
180 mygui->playlist->clear_playlist(mygui->playlist);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
181
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
182 if(strstr(file, ".m3u") || strstr(file, ".pls"))
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
183 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
184 playtree = parse_playlist_file(file);
33752
6cea6d268f97 Cosmetic: Rename the GUI playlist functions.
ib
parents: 33740
diff changeset
185 guiPlaylistAdd(playtree, mconfig);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
186 return 1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
187 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
188 return 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
189 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
190
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
191 /* this function gets called by the gui to update mplayer */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
192 static void guiSetEvent(int event)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
193 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
194 if(guiInfo.mpcontext)
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
195 mixer = mpctx_get_mixer(guiInfo.mpcontext);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
196
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
197 switch(event)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
198 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
199 case evPlay:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
200 case evPlaySwitchToPause:
23148
71efd1fc20c8 add missing case value, fixes functionality when using some skins.
vayne
parents: 23147
diff changeset
201 case evPauseSwitchToPlay:
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
202 uiPlay();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
203 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
204 case evPause:
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
205 uiPause();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
206 break;
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26457
diff changeset
207 #ifdef CONFIG_DVDREAD
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
208 case evPlayDVD:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
209 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
210 static char dvdname[MAX_PATH];
34391
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
211 guiInfo.Track = 1;
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
212 guiInfo.Chapter = 1;
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
213 guiInfo.Angle = 1;
33890
c51e44dd38e2 Remove needless guiInfo member DiskChanged.
ib
parents: 33876
diff changeset
214 guiInfo.NewPlay = GUI_FILE_SAME;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
215
34392
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
216 #ifdef __WINE__
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
217 // dvd_device is in the Windows style (D:\), which needs to be
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
218 // converted for MPlayer, so that it will find the device in the
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
219 // Linux filesystem.
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
220 dvd_device = unix_device(dvd_device);
e195ad9bdc59 Allow Windows style devices for Wine port.
ib
parents: 34391
diff changeset
221 #endif
35452
f42cc2361ee4 Cosmetic: Rename uiSetFileName().
ib
parents: 35431
diff changeset
222 uiSetFile(NULL, dvd_device, STREAMTYPE_DVD);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
223 dvdname[0] = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
224 strcat(dvdname, "DVD Movie");
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
225 GetVolumeInformation(dvd_device, dvdname, MAX_PATH, NULL, NULL, NULL, NULL, 0);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
226 capitalize(dvdname);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
227 mp_msg(MSGT_GPLAYER, MSGL_V, "Opening DVD %s -> %s\n", dvd_device, dvdname);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
228 mygui->playlist->clear_playlist(mygui->playlist);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
229 mygui->playlist->add_track(mygui->playlist, filename, NULL, dvdname, 0);
34391
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
230 uiPlay();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
231 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
232 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
233 #endif
34405
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
234 #ifdef CONFIG_CDDA
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
235 case evPlayCD:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
236 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
237 int i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
238 char track[10];
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
239 char trackname[10];
34405
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
240 #ifdef CONFIG_LIBCDIO
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
241 cdrom_drive_t *cd;
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
242 #else
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
243 cdrom_drive *cd;
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
244 #endif
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
245 int i_tracks;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
246
34406
2364585f3f1e Allow Windows style CDROM device names for Wine port.
ib
parents: 34405
diff changeset
247 #ifdef __WINE__
2364585f3f1e Allow Windows style CDROM device names for Wine port.
ib
parents: 34405
diff changeset
248 // cdrom_device is in the Windows style (D:\), which needs to be
2364585f3f1e Allow Windows style CDROM device names for Wine port.
ib
parents: 34405
diff changeset
249 // converted for MPlayer, so that it will find the device in the
2364585f3f1e Allow Windows style CDROM device names for Wine port.
ib
parents: 34405
diff changeset
250 // Linux filesystem.
2364585f3f1e Allow Windows style CDROM device names for Wine port.
ib
parents: 34405
diff changeset
251 cdrom_device = unix_device(cdrom_device);
2364585f3f1e Allow Windows style CDROM device names for Wine port.
ib
parents: 34405
diff changeset
252 #endif
34405
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
253 cd = cdda_identify(cdrom_device, 0, NULL);
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
254 if (cd)
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
255 {
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
256 if (cdda_open(cd) != 0)
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
257 {
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
258 cdda_close(cd);
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
259 cd = NULL;
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
260 }
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
261 }
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
262 if(!cd)
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
263 {
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
264 printf("Couldn't find a driver.\n");
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
265 break;
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
266 }
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
267 i_tracks = cdda_tracks(cd);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
268
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
269 mygui->playlist->clear_playlist(mygui->playlist);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
270 for(i=0;i<i_tracks;i++)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
271 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
272 sprintf(track, "cdda://%d", i+1);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
273 sprintf(trackname, "Track %d", i+1);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
274 mygui->playlist->add_track(mygui->playlist, track, NULL, trackname, 0);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
275 }
34405
35fd66684548 Use cdparanoia compatibility names for CD function calls.
ib
parents: 34400
diff changeset
276 cdda_close(cd);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
277 mygui->startplay(mygui);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
278 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
279 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
280 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
281 case evFullScreen:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
282 mp_input_queue_cmd(mp_input_parse_cmd("vo_fullscreen"));
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
283 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
284 case evExit:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
285 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
286 /* We are asking mplayer to exit, later it will ask us after uninit is made
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
287 this should be the only safe way to quit */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
288 mygui->activewidget = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
289 mp_input_queue_cmd(mp_input_parse_cmd("quit"));
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
290 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
291 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
292 case evStop:
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
293 if(guiInfo.Playing)
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
294 gui(GUI_SET_STATE, (void *) GUI_STOP);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
295 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
296 case evSetMoviePosition:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
297 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
298 rel_seek_secs = guiInfo.Position / 100.0f;
35431
20c90da2ba0d Use symbolic constants to set abs_seek_pos.
ib
parents: 35430
diff changeset
299 abs_seek_pos = SEEK_ABSOLUTE | SEEK_FACTOR;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
300 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
301 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
302 case evForward10sec:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
303 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
304 rel_seek_secs = 10.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
305 abs_seek_pos = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
306 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
307 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
308 case evBackward10sec:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
309 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
310 rel_seek_secs = -10.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
311 abs_seek_pos = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
312 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
313 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
314 case evSetBalance:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
315 case evSetVolume:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
316 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
317 float l,r;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
318
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
319 if (guiInfo.Playing == GUI_STOP)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
320 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
321
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
322 if (guiInfo.Balance == 50.0f)
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
323 mixer_setvolume(mixer, guiInfo.Volume, guiInfo.Volume);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
324
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
325 l = guiInfo.Volume * ((100.0f - guiInfo.Balance) / 50.0f);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
326 r = guiInfo.Volume * ((guiInfo.Balance) / 50.0f);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
327
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
328 if (l > guiInfo.Volume) l=guiInfo.Volume;
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
329 if (r > guiInfo.Volume) r=guiInfo.Volume;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
330 mixer_setvolume(mixer, l, r);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
331 /* Check for balance support on mixer - there is a better way ?? */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
332 if (r != l)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
333 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
334 mixer_getvolume(mixer, &l, &r);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
335 if (r == l)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
336 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
337 mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] Mixer doesn't support balanced audio\n");
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
338 mixer_setvolume(mixer, guiInfo.Volume, guiInfo.Volume);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
339 guiInfo.Balance = 50.0f;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
340 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
341 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
342 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
343 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
344 case evMute:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
345 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
346 mp_cmd_t * cmd = calloc(1, sizeof(*cmd));
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
347 cmd->id=MP_CMD_MUTE;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
348 cmd->name=strdup("mute");
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
349 mp_input_queue_cmd(cmd);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
350 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
351 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
352 case evLoadPlay:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
353 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
354 switch(guiInfo.StreamType)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
355 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
356 case STREAMTYPE_DVD:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
357 {
33890
c51e44dd38e2 Remove needless guiInfo member DiskChanged.
ib
parents: 33876
diff changeset
358 guiInfo.NewPlay = GUI_FILE_SAME;
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
359 gui(GUI_SET_STATE, (void *) GUI_PLAY);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
360 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
361 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
362 default:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
363 {
33890
c51e44dd38e2 Remove needless guiInfo member DiskChanged.
ib
parents: 33876
diff changeset
364 guiInfo.NewPlay = GUI_FILE_NEW;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
365 update_playlistwindow();
35430
2d55540614a9 Move uiProcessNextInPlaylist to the guiInfo structure.
ib
parents: 35376
diff changeset
366 guiInfo.PlaylistNext = guiInfo.Playing? 0 : 1;
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
367 gui(GUI_SET_STATE, (void *) GUI_STOP);
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
368 gui(GUI_SET_STATE, (void *) GUI_PLAY);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
369 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
370 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
371 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
372 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
373 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
374 case evNext:
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
375 uiNext();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
376 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
377 case evPrev:
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
378 uiPrev();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
379 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
380 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
381 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
382
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
383 void uiPlay( void )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
384 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
385 if((!guiInfo.Filename ) || (guiInfo.Filename[0] == 0))
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
386 return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
387
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
388 if(guiInfo.Playing > GUI_STOP)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
389 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
390 uiPause();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
391 return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
392 }
33890
c51e44dd38e2 Remove needless guiInfo member DiskChanged.
ib
parents: 33876
diff changeset
393 guiInfo.NewPlay = GUI_FILE_NEW;
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
394 gui(GUI_SET_STATE, (void *) GUI_PLAY);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
395 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
396
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
397 void uiPause( void )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
398 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
399 if(!guiInfo.Playing) return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
400
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
401 if(guiInfo.Playing == GUI_PLAY)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
402 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
403 mp_cmd_t * cmd = calloc(1, sizeof(*cmd));
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
404 cmd->id=MP_CMD_PAUSE;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
405 cmd->name=strdup("pause");
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
406 mp_input_queue_cmd(cmd);
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
407 } else guiInfo.Playing = GUI_PLAY;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
408 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
409
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
410 void uiNext(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
411 {
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
412 if(guiInfo.Playing == GUI_PAUSE) return;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
413 switch(guiInfo.StreamType)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
414 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
415 case STREAMTYPE_DVD:
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33791
diff changeset
416 if(guiInfo.Chapter == (guiInfo.Chapters - 1))
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
417 return;
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33791
diff changeset
418 guiInfo.Chapter++;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
419 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
420 default:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
421 if(mygui->playlist->current == (mygui->playlist->trackcount - 1))
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
422 return;
35452
f42cc2361ee4 Cosmetic: Rename uiSetFileName().
ib
parents: 35431
diff changeset
423 uiSetFile(NULL, mygui->playlist->tracks[(mygui->playlist->current)++]->filename,
34075
b9cab6c0992c Restrict use of STREAMTYPE_STREAM in Win32 GUI.
ib
parents: 34073
diff changeset
424 STREAMTYPE_FILE);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
425 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
426 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
427 mygui->startplay(mygui);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
428 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
429
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
430 void uiPrev(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
431 {
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
432 if(guiInfo.Playing == GUI_PAUSE) return;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
433 switch(guiInfo.StreamType)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
434 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
435 case STREAMTYPE_DVD:
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33791
diff changeset
436 if(guiInfo.Chapter == 1)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
437 return;
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33791
diff changeset
438 guiInfo.Chapter--;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
439 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
440 default:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
441 if(mygui->playlist->current == 0)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
442 return;
35452
f42cc2361ee4 Cosmetic: Rename uiSetFileName().
ib
parents: 35431
diff changeset
443 uiSetFile(NULL, mygui->playlist->tracks[(mygui->playlist->current)--]->filename,
34075
b9cab6c0992c Restrict use of STREAMTYPE_STREAM in Win32 GUI.
ib
parents: 34073
diff changeset
444 STREAMTYPE_FILE);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
445 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
446 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
447 mygui->startplay(mygui);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
448 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
449
35452
f42cc2361ee4 Cosmetic: Rename uiSetFileName().
ib
parents: 35431
diff changeset
450 void uiSetFile(char *dir, char *name, int type)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
451 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
452 if(!name) return;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
453 if(!dir)
33740
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
454 setdup(&guiInfo.Filename, name);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
455 else
33740
2c02269701bd Remove macros guiSetFilename() and guiSetDF() from interface.h.
ib
parents: 33737
diff changeset
456 setddup(&guiInfo.Filename, dir, name);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
457
34064
54becc464788 Set MPlayer filename in uiSetFileName().
ib
parents: 34058
diff changeset
458 filename = guiInfo.Filename;
34115
3d7ee643b110 Port to Wine.
ib
parents: 34084
diff changeset
459 #ifdef __WINE__
34127
98f6d11e2ff3 Revise comment on filename conversion in the Wine port.
ib
parents: 34126
diff changeset
460 // When the GUI receives the files to be played in guiPlaylistInitialize()
35376
02006c5b3b30 Move add_to_gui_playlist() to util/list.c.
ib
parents: 35374
diff changeset
461 // and guiPlaylistAdd(), it calls import_file_into_gui() where the call of
34127
98f6d11e2ff3 Revise comment on filename conversion in the Wine port.
ib
parents: 34126
diff changeset
462 // Wine's GetFullPathName() converts each file name into the Windows style
98f6d11e2ff3 Revise comment on filename conversion in the Wine port.
ib
parents: 34126
diff changeset
463 // (C:\path\to\file), which needs to be reconverted for MPlayer, so that
98f6d11e2ff3 Revise comment on filename conversion in the Wine port.
ib
parents: 34126
diff changeset
464 // it will find the filename in the Linux filesystem.
34123
178c5660c090 Cosmetic: Change comment.
ib
parents: 34117
diff changeset
465 filename = unix_name(filename);
34115
3d7ee643b110 Port to Wine.
ib
parents: 34084
diff changeset
466 #endif
34399
f2c03009068d Don't explicitly set stream type if the type doesn't change.
ib
parents: 34393
diff changeset
467
f2c03009068d Don't explicitly set stream type if the type doesn't change.
ib
parents: 34393
diff changeset
468 if (type != SAME_STREAMTYPE)
34400
19b68f388735 Cosmetic: Adjust indent.
ib
parents: 34399
diff changeset
469 guiInfo.StreamType = type;
34064
54becc464788 Set MPlayer filename in uiSetFileName().
ib
parents: 34058
diff changeset
470
33897
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33894
diff changeset
471 nfree(guiInfo.AudioFilename);
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33894
diff changeset
472 nfree(guiInfo.SubtitleFilename);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
473 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
474
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
475 void uiFullScreen( void )
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
476 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
477 if(!guiInfo.sh_video) return;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
478
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
479 if(video_window)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
480 {
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
481 if(!fullscreen && IsWindowVisible(mygui->videowindow) && !IsIconic(mygui->videowindow))
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
482 GetWindowRect(mygui->videowindow, &old_rect);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
483
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
484 if(fullscreen)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
485 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
486 fullscreen = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
487 style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
488 } else {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
489 fullscreen = 1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
490 style = WS_VISIBLE | WS_POPUP;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
491 }
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
492 SetWindowLong(mygui->videowindow, GWL_STYLE, style);
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
493 update_videowindow();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
494 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
495 video_out->control(VOCTRL_FULLSCREEN, 0);
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
496 if(video_window) ShowWindow(mygui->videowindow, SW_SHOW);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
497 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
498
24992
5701e23ebcb4 Better handling of win32 GUI thread:
zuxy
parents: 23148
diff changeset
499 static unsigned __stdcall GuiThread(void* param)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
500 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
501 MSG msg;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
502
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
503 if(!skinName) skinName = strdup("Blue");
33781
cdd4fc0616b6 Fix memory leak in the Win32 GUI.
ib
parents: 33780
diff changeset
504 if(!mygui) mygui = create_gui(get_path("skins"), guiSetEvent);
30558
71acebef19ec Fix win32 gui compilation.
reimar
parents: 27391
diff changeset
505 if(!mygui) exit_player(EXIT_ERROR);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
506
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
507 if(autosync && autosync != gtkAutoSync)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
508 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
509 gtkAutoSyncOn = 1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
510 gtkAutoSync = autosync;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
511 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
512
24992
5701e23ebcb4 Better handling of win32 GUI thread:
zuxy
parents: 23148
diff changeset
513 while(GetMessage(&msg, NULL, 0, 0))
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
514 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
515 TranslateMessage(&msg);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
516 DispatchMessage(&msg);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
517 }
23078
f81cd5be161b spelling cosmetics
diego
parents: 23077
diff changeset
518 fprintf(stderr, "[GUI] GUI thread terminated.\n");
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
519 fflush(stderr);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
520 return 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
521 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
522
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
523 void guiInit(void)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
524 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
525 memset(&guiInfo, 0, sizeof(guiInfo));
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
526 /* Create The gui thread */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
527 if (!mygui)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
528 {
33358
c9c9f015619b Don't use CreateThread() unconditionally.
ib
parents: 33303
diff changeset
529 hThread = _beginthreadex(NULL, 0, GuiThread, NULL, 0, &threadId);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
530 mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] Creating GUI Thread 0x%04x\n", threadId);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
531 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
532
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
533 /* Wait until the gui is created */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
534 while(!mygui) Sleep(100);
23078
f81cd5be161b spelling cosmetics
diego
parents: 23077
diff changeset
535 mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] GUI thread started.\n");
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
536 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
537
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
538 void guiDone(void)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
539 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
540 if(mygui)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
541 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
542 fprintf(stderr, "[GUI] Closed by main mplayer window\n");
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
543 fflush(stderr);
24992
5701e23ebcb4 Better handling of win32 GUI thread:
zuxy
parents: 23148
diff changeset
544 PostThreadMessage(threadId, WM_QUIT, 0, 0);
5701e23ebcb4 Better handling of win32 GUI thread:
zuxy
parents: 23148
diff changeset
545 WaitForSingleObject(hThread, INFINITE);
5701e23ebcb4 Better handling of win32 GUI thread:
zuxy
parents: 23148
diff changeset
546 CloseHandle(hThread);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
547 mygui->uninit(mygui);
33770
6134493605c6 Use macro nfree() in Win32 GUI code.
ib
parents: 33761
diff changeset
548 nfree(mygui);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
549 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
550 /* Remove tray icon */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
551 Shell_NotifyIcon(NIM_DELETE, &nid);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
552 cfg_write();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
553 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
554
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
555 /* this function gets called by mplayer to update the gui */
33791
8b0c78a85a8c Cosmetic: Change parameter names of gui() and mplayer().
ib
parents: 33781
diff changeset
556 int gui(int what, void *data)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
557 {
33791
8b0c78a85a8c Cosmetic: Change parameter names of gui() and mplayer().
ib
parents: 33781
diff changeset
558 stream_t *stream = data;
27341
e7c989f7a7c9 Start unifying names of internal preprocessor directives.
diego
parents: 26457
diff changeset
559 #ifdef CONFIG_DVDREAD
33730
b4c64f168b29 Remove gui() GMP_SET_DVD.
ib
parents: 33726
diff changeset
560 dvd_priv_t *dvdp;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
561 #endif
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
562 if(!mygui || !mygui->skin) return 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
563
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
564 if(guiInfo.mpcontext)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
565 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
566 audio_out = mpctx_get_audio_out(guiInfo.mpcontext);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
567 video_out = mpctx_get_video_out(guiInfo.mpcontext);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
568 mixer = mpctx_get_mixer(guiInfo.mpcontext);
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
569 playtree = mpctx_get_playtree_iter(guiInfo.mpcontext);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
570 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
571
33726
a800f30c40d1 Cosmetic: Rename gui() parameter.
ib
parents: 33725
diff changeset
572 switch (what)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
573 {
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
574 case GUI_PREPARE:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
575 {
34052
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
576 audio_id = -1;
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
577 video_id = -1;
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
578 dvdsub_id = -1;
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
579 vobsub_id = -1;
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
580 stream_cache_size = -1;
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
581 autosync = 0;
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
582 force_fps = 0;
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
583 if(!mygui->playlist->tracks) return 0;
34391
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
584 switch(guiInfo.StreamType)
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
585 {
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
586 case STREAMTYPE_FILE:
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
587 case STREAMTYPE_STREAM:
35452
f42cc2361ee4 Cosmetic: Rename uiSetFileName().
ib
parents: 35431
diff changeset
588 uiSetFile(NULL, mygui->playlist->tracks[mygui->playlist->current]->filename, SAME_STREAMTYPE);
34391
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
589 guiInfo.Track = mygui->playlist->current + 1;
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
590 break;
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
591 case STREAMTYPE_DVD:
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
592 {
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
593 char tmp[512];
35168
627bdd8915ca Fix building GUI without DVD support.
ib
parents: 35159
diff changeset
594 #ifdef CONFIG_DVDREAD
34391
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
595 dvd_chapter = guiInfo.Chapter;
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
596 dvd_angle = guiInfo.Angle;
35168
627bdd8915ca Fix building GUI without DVD support.
ib
parents: 35159
diff changeset
597 #endif
34391
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
598 sprintf(tmp,"dvd://%d", guiInfo.Track);
35452
f42cc2361ee4 Cosmetic: Rename uiSetFileName().
ib
parents: 35431
diff changeset
599 uiSetFile(NULL, tmp, SAME_STREAMTYPE);
34391
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
600 break;
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
601 }
6b558b00939a Fix Win32 GUI DVD playback.
ib
parents: 34339
diff changeset
602 }
34126
72624e80fbce Fix bug with option sub_window in the Win32 GUI.
ib
parents: 34123
diff changeset
603 guiInfo.VideoWindow = 1;
34610
4ff933a89818 Cosmetic: Rename functions in list.c.
ib
parents: 34454
diff changeset
604 if(gtkAONorm) listRepl(&af_cfg.list, "volnorm", "volnorm");
34052
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
605 if(gtkAOExtraStereo)
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
606 {
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
607 char *name = malloc(12 + 20 + 1);
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
608 snprintf(name, 12 + 20, "extrastereo=%f", gtkAOExtraStereoMul);
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
609 name[12 + 20] = 0;
34610
4ff933a89818 Cosmetic: Rename functions in list.c.
ib
parents: 34454
diff changeset
610 listRepl(&af_cfg.list, "extrastereo", name);
34052
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
611 free(name);
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
612 }
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
613 if(gtkCacheOn) stream_cache_size = gtkCacheSize;
9f19a87d2062 Remove gui() instruction GUI_SET_FILE.
ib
parents: 33902
diff changeset
614 if(gtkAutoSyncOn) autosync = gtkAutoSync;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
615 guiInfo.NewPlay = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
616 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
617 }
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
618 case GUI_SET_AUDIO:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
619 {
34126
72624e80fbce Fix bug with option sub_window in the Win32 GUI.
ib
parents: 34123
diff changeset
620 if (data && !guiInfo.sh_video) guiInfo.VideoWindow = 0;
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
621 if(IsWindowVisible(mygui->videowindow) && !guiInfo.VideoWindow)
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
622 ShowWindow(mygui->videowindow, SW_HIDE);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
623 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
624 }
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
625 case GUI_SET_CONTEXT:
33791
8b0c78a85a8c Cosmetic: Change parameter names of gui() and mplayer().
ib
parents: 33781
diff changeset
626 guiInfo.mpcontext = data;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
627 break;
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
628 case GUI_SET_VIDEO:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
629 {
33791
8b0c78a85a8c Cosmetic: Change parameter names of gui() and mplayer().
ib
parents: 33781
diff changeset
630 guiInfo.sh_video = data;
8b0c78a85a8c Cosmetic: Change parameter names of gui() and mplayer().
ib
parents: 33781
diff changeset
631 if (data)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
632 {
33791
8b0c78a85a8c Cosmetic: Change parameter names of gui() and mplayer().
ib
parents: 33781
diff changeset
633 sh_video_t *sh = data;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
634 codecname = sh->codec->name;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
635
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
636 /* we have video, show the video window */
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
637 if(!IsWindowVisible(mygui->videowindow) || IsIconic(mygui->videowindow))
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
638 ShowWindow(mygui->videowindow, SW_SHOWNORMAL);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
639 if(WinID == -1)
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
640 update_videowindow();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
641
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
642 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
643 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
644 }
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
645 case GUI_SETUP_VIDEO_WINDOW:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
646 {
33901
d4f80f889106 Cosmetic: Rename guiInfo members.
ib
parents: 33897
diff changeset
647 guiInfo.VideoWidth = vo_dwidth;
d4f80f889106 Cosmetic: Rename guiInfo members.
ib
parents: 33897
diff changeset
648 guiInfo.VideoHeight = vo_dheight;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
649
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
650 video_aspect = (float)guiInfo.VideoWidth/guiInfo.VideoHeight;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
651 if(WinID != -1)
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
652 update_videowindow();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
653 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
654 }
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
655 case GUI_SET_STREAM:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
656 {
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
657 guiInfo.StreamType = stream->type;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
658 switch(stream->type)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
659 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
660 case STREAMTYPE_DVD:
34451
19277315b8c6 Retrieve DVD's titles, chapters and angles by stream control commands.
ib
parents: 34406
diff changeset
661 guiInfo.Tracks = 0;
19277315b8c6 Retrieve DVD's titles, chapters and angles by stream control commands.
ib
parents: 34406
diff changeset
662 stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks);
19277315b8c6 Retrieve DVD's titles, chapters and angles by stream control commands.
ib
parents: 34406
diff changeset
663 guiInfo.Chapters = 0;
19277315b8c6 Retrieve DVD's titles, chapters and angles by stream control commands.
ib
parents: 34406
diff changeset
664 stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Chapters);
19277315b8c6 Retrieve DVD's titles, chapters and angles by stream control commands.
ib
parents: 34406
diff changeset
665 guiInfo.Angles = 0;
19277315b8c6 Retrieve DVD's titles, chapters and angles by stream control commands.
ib
parents: 34406
diff changeset
666 stream_control(stream, STREAM_CTRL_GET_NUM_ANGLES, &guiInfo.Angles);
35170
6f214e8ae780 Set guiInfo.Track after the stream is open.
ib
parents: 35168
diff changeset
667 guiInfo.Track = 0;
6f214e8ae780 Set guiInfo.Track after the stream is open.
ib
parents: 35168
diff changeset
668 stream_control(stream, STREAM_CTRL_GET_CURRENT_TITLE, &guiInfo.Track);
6f214e8ae780 Set guiInfo.Track after the stream is open.
ib
parents: 35168
diff changeset
669 guiInfo.Track++;
35168
627bdd8915ca Fix building GUI without DVD support.
ib
parents: 35159
diff changeset
670 // guiInfo.Chapter will be set by mplayer
627bdd8915ca Fix building GUI without DVD support.
ib
parents: 35159
diff changeset
671 guiInfo.Angle = 1;
627bdd8915ca Fix building GUI without DVD support.
ib
parents: 35159
diff changeset
672 stream_control(stream, STREAM_CTRL_GET_ANGLE, &guiInfo.Angle);
34454
5a45efc630b8 Remove all unnecessary #ifdefs from GUI code.
ib
parents: 34451
diff changeset
673 #ifdef CONFIG_DVDREAD
33730
b4c64f168b29 Remove gui() GMP_SET_DVD.
ib
parents: 33726
diff changeset
674 dvdp = stream->priv;
33902
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
675 guiInfo.AudioStreams = dvdp->nr_of_channels;
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
676 memcpy(guiInfo.AudioStream, dvdp->audio_streams, sizeof(dvdp->audio_streams));
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
677 guiInfo.Subtitles = dvdp->nr_of_subtitles;
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
678 memcpy(guiInfo.Subtitle, dvdp->subtitles, sizeof(dvdp->subtitles));
34454
5a45efc630b8 Remove all unnecessary #ifdefs from GUI code.
ib
parents: 34451
diff changeset
679 #endif
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
680 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
681 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
682 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
683 }
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
684 case GUI_REDRAW:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
685 mygui->updatedisplay(mygui, mygui->mainwindow);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
686 break;
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
687 case GUI_SET_AFILTER:
33791
8b0c78a85a8c Cosmetic: Change parameter names of gui() and mplayer().
ib
parents: 33781
diff changeset
688 guiInfo.afilter = data;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
689 break;
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
690 case GUI_SET_STATE:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
691 {
33791
8b0c78a85a8c Cosmetic: Change parameter names of gui() and mplayer().
ib
parents: 33781
diff changeset
692 guiInfo.Playing = (int) data;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
693 switch (guiInfo.Playing)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
694 {
33614
79743a5cf4f0 Rename the symbolic playback state constants.
ib
parents: 33611
diff changeset
695 case GUI_PLAY:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
696 {
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
697 guiInfo.Playing = GUI_PLAY;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
698 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
699 }
33614
79743a5cf4f0 Rename the symbolic playback state constants.
ib
parents: 33611
diff changeset
700 case GUI_STOP:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
701 {
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
702 guiInfo.Playing = GUI_STOP;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
703 if(movie_aspect >= 0)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
704 movie_aspect = -1;
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
705 update_videowindow();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
706 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
707 }
33614
79743a5cf4f0 Rename the symbolic playback state constants.
ib
parents: 33611
diff changeset
708 case GUI_PAUSE:
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
709 guiInfo.Playing = GUI_PAUSE;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
710 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
711 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
712 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
713 }
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
714 case GUI_RUN_COMMAND:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
715 {
33791
8b0c78a85a8c Cosmetic: Change parameter names of gui() and mplayer().
ib
parents: 33781
diff changeset
716 mp_msg(MSGT_GPLAYER,MSGL_V, "cmd: %d\n", (int) data);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
717 /* MPlayer asks us to quit */
33791
8b0c78a85a8c Cosmetic: Change parameter names of gui() and mplayer().
ib
parents: 33781
diff changeset
718 switch((int) data)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
719 {
31312
0b7792622c88 Remove Gui-specific slave commands and associated key-bindings and other code.
reimar
parents: 30901
diff changeset
720 case MP_CMD_VO_FULLSCREEN:
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
721 uiFullScreen();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
722 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
723 case MP_CMD_QUIT:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
724 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
725 mygui->uninit(mygui);
33770
6134493605c6 Use macro nfree() in Win32 GUI code.
ib
parents: 33761
diff changeset
726 nfree(mygui);
30558
71acebef19ec Fix win32 gui compilation.
reimar
parents: 27391
diff changeset
727 exit_player(EXIT_QUIT);
33666
0f592e8530f1 Change return code of guiGetEvent() to indicate success.
ib
parents: 33661
diff changeset
728 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
729 }
33696
24d919fb6778 Don't let MPlayer directly call user interface functions.
ib
parents: 33695
diff changeset
730 case MP_CMD_PLAY_TREE_STEP:
24d919fb6778 Don't let MPlayer directly call user interface functions.
ib
parents: 33695
diff changeset
731 guiSetEvent(evNext);
24d919fb6778 Don't let MPlayer directly call user interface functions.
ib
parents: 33695
diff changeset
732 break;
24d919fb6778 Don't let MPlayer directly call user interface functions.
ib
parents: 33695
diff changeset
733 case -MP_CMD_PLAY_TREE_STEP:
24d919fb6778 Don't let MPlayer directly call user interface functions.
ib
parents: 33695
diff changeset
734 guiSetEvent(evPrev);
24d919fb6778 Don't let MPlayer directly call user interface functions.
ib
parents: 33695
diff changeset
735 break;
24d919fb6778 Don't let MPlayer directly call user interface functions.
ib
parents: 33695
diff changeset
736 case MP_CMD_STOP:
24d919fb6778 Don't let MPlayer directly call user interface functions.
ib
parents: 33695
diff changeset
737 guiSetEvent(evStop);
24d919fb6778 Don't let MPlayer directly call user interface functions.
ib
parents: 33695
diff changeset
738 break;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
739 default:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
740 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
741 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
742 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
743 }
34339
f05c75392897 Enable gui slave commands.
ib
parents: 34315
diff changeset
744 case GUI_RUN_MESSAGE:
f05c75392897 Enable gui slave commands.
ib
parents: 34315
diff changeset
745 break;
33732
90c992ac5011 Make guiEventHandling() a gui() call.
ib
parents: 33731
diff changeset
746 case GUI_HANDLE_EVENTS:
90c992ac5011 Make guiEventHandling() a gui() call.
ib
parents: 33731
diff changeset
747 break;
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
748 case GUI_SET_MIXER:
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
749 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
750 if(audio_out)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
751 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
752 /* Some audio_out drivers do not support balance e.g. dsound */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
753 /* FIXME this algo is not correct */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
754 float l, r;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
755 mixer_getvolume(mixer, &l, &r);
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
756 guiInfo.Volume = (r > l ? r : l); /* max(r,l) */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
757 if (r != l)
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
758 guiInfo.Balance = ((r-l) + 100.0f) * 0.5f;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
759 else
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
760 guiInfo.Balance = 50.0f;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
761 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
762 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
763 }
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
764 case GUI_END_FILE:
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
765 {
35330
5fbd422b355e Fix segmentation fault after end of file playback.
ib
parents: 35170
diff changeset
766 guiInfo.sh_video = NULL;
5fbd422b355e Fix segmentation fault after end of file playback.
ib
parents: 35170
diff changeset
767
35430
2d55540614a9 Move uiProcessNextInPlaylist to the guiInfo structure.
ib
parents: 35376
diff changeset
768 if(!guiInfo.PlaylistNext && guiInfo.Playing)
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
769 {
35430
2d55540614a9 Move uiProcessNextInPlaylist to the guiInfo structure.
ib
parents: 35376
diff changeset
770 guiInfo.PlaylistNext = 1;
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
771 break;
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
772 }
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
773
35430
2d55540614a9 Move uiProcessNextInPlaylist to the guiInfo structure.
ib
parents: 35376
diff changeset
774 if(guiInfo.PlaylistNext && guiInfo.Playing &&
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
775 (mygui->playlist->current < (mygui->playlist->trackcount - 1)) &&
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
776 guiInfo.StreamType != STREAMTYPE_DVD &&
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
777 guiInfo.StreamType != STREAMTYPE_DVDNAV)
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
778 {
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
779 /* we've finished this file, reset the aspect */
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
780 if(movie_aspect >= 0)
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
781 movie_aspect = -1;
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
782
35430
2d55540614a9 Move uiProcessNextInPlaylist to the guiInfo structure.
ib
parents: 35376
diff changeset
783 guiInfo.PlaylistNext = 1;
33890
c51e44dd38e2 Remove needless guiInfo member DiskChanged.
ib
parents: 33876
diff changeset
784 guiInfo.NewPlay = GUI_FILE_NEW;
35452
f42cc2361ee4 Cosmetic: Rename uiSetFileName().
ib
parents: 35431
diff changeset
785 uiSetFile(NULL, mygui->playlist->tracks[(mygui->playlist->current)++]->filename, STREAMTYPE_FILE);
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
786 //sprintf(guiInfo.Filename, mygui->playlist->tracks[(mygui->playlist->current)++]->filename);
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
787 }
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
788
33894
b2e63fe7fe17 Remove needless guiInfo member FilenameChanged.
ib
parents: 33890
diff changeset
789 if(guiInfo.NewPlay == GUI_FILE_NEW)
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
790 break;
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
791
33897
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33894
diff changeset
792 guiInfo.ElapsedTime = 0;
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
793 guiInfo.Position = 0;
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
794 guiInfo.AudioChannels = 0;
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
795
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33791
diff changeset
796 guiInfo.Track = 1;
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33791
diff changeset
797 guiInfo.Chapter = 1;
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33791
diff changeset
798 guiInfo.Angle = 1;
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
799
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
800 if (mygui->playlist->current == (mygui->playlist->trackcount - 1))
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
801 mygui->playlist->current = 0;
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
802
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
803 fullscreen = 0;
34999
b0133d910683 Add parentheses to avoid compiler warning.
ib
parents: 34996
diff changeset
804 if(style == (WS_VISIBLE | WS_POPUP))
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
805 {
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
806 style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
807 SetWindowLong(mygui->videowindow, GWL_STYLE, style);
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
808 }
33731
81f71d910333 Cosmetic: Change prefix for symbolic constants from GMP to GUI.
ib
parents: 33730
diff changeset
809 gui(GUI_SET_STATE, (void *) GUI_STOP);
33694
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
810 break;
45553d0f65c6 Don't let MPlayer directly call user interface functions.
ib
parents: 33691
diff changeset
811 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
812 default:
33726
a800f30c40d1 Cosmetic: Rename gui() parameter.
ib
parents: 33725
diff changeset
813 mp_msg(MSGT_GPLAYER, MSGL_ERR, "[GUI] GOT UNHANDLED EVENT %i\n", what);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
814 }
33666
0f592e8530f1 Change return code of guiGetEvent() to indicate success.
ib
parents: 33661
diff changeset
815 return 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
816 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
817
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
818 /* This function adds/inserts one file into the gui playlist */
35376
02006c5b3b30 Move add_to_gui_playlist() to util/list.c.
ib
parents: 35374
diff changeset
819 static int import_file_into_gui(char *pathname, int insert)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
820 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
821 char filename[MAX_PATH];
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
822 char *filepart = filename;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
823
35376
02006c5b3b30 Move add_to_gui_playlist() to util/list.c.
ib
parents: 35374
diff changeset
824 if (strstr(pathname, "://"))
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
825 {
35376
02006c5b3b30 Move add_to_gui_playlist() to util/list.c.
ib
parents: 35374
diff changeset
826 mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] Adding special %s\n", pathname);
02006c5b3b30 Move add_to_gui_playlist() to util/list.c.
ib
parents: 35374
diff changeset
827 mygui->playlist->add_track(mygui->playlist, pathname, NULL, NULL, 0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
828 return 1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
829 }
35376
02006c5b3b30 Move add_to_gui_playlist() to util/list.c.
ib
parents: 35374
diff changeset
830 if (GetFullPathName(pathname, MAX_PATH, filename, &filepart))
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
831 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
832 if (!(GetFileAttributes(filename) & FILE_ATTRIBUTE_DIRECTORY))
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
833 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
834 mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] Adding filename: %s - fullpath: %s\n", filepart, filename);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
835 mygui->playlist->add_track(mygui->playlist, filename, NULL, filepart, 0);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
836 return 1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
837 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
838 else
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
839 mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] Cannot add %s\n", filename);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
840 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
841
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
842 return 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
843 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
844
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
845 /* This function imports the initial playtree (based on cmd-line files) into the gui playlist
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
846 by either:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
847 - overwriting gui pl (enqueue=0) */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
848
33752
6cea6d268f97 Cosmetic: Rename the GUI playlist functions.
ib
parents: 33740
diff changeset
849 int guiPlaylistInitialize(play_tree_t *my_playtree, m_config_t *config, int enqueue)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
850 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
851 play_tree_iter_t *my_pt_iter = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
852 int result = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
853
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
854 if(!mygui) guiInit();
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
855
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
856 if((my_pt_iter = pt_iter_create(&my_playtree, config)))
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
857 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
858 while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
859 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
860 if (parse_filename(filename, my_playtree, config, 0))
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
861 result = 1;
35376
02006c5b3b30 Move add_to_gui_playlist() to util/list.c.
ib
parents: 35374
diff changeset
862 else if (import_file_into_gui(filename, 0)) /* Add it to end of list */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
863 result = 1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
864 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
865 }
35430
2d55540614a9 Move uiProcessNextInPlaylist to the guiInfo structure.
ib
parents: 35376
diff changeset
866 guiInfo.PlaylistNext = 1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
867
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
868 if (result)
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
869 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
870 mygui->playlist->current = 0;
35452
f42cc2361ee4 Cosmetic: Rename uiSetFileName().
ib
parents: 35431
diff changeset
871 uiSetFile(NULL, mygui->playlist->tracks[0]->filename, STREAMTYPE_FILE);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
872 }
34084
b77b5e7bee72 Enable option "enqueue" for Win32 GUI.
ib
parents: 34075
diff changeset
873
b77b5e7bee72 Enable option "enqueue" for Win32 GUI.
ib
parents: 34075
diff changeset
874 if (enqueue) filename = NULL;
b77b5e7bee72 Enable option "enqueue" for Win32 GUI.
ib
parents: 34075
diff changeset
875
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
876 return result;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
877 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
878
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
879 /* This function imports and inserts an playtree, that is created "on the fly", for example by
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
880 parsing some MOV-Reference-File; or by loading an playlist with "File Open"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
881 The file which contained the playlist is thereby replaced with it's contents. */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
882
33752
6cea6d268f97 Cosmetic: Rename the GUI playlist functions.
ib
parents: 33740
diff changeset
883 int guiPlaylistAdd(play_tree_t *my_playtree, m_config_t *config)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
884 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
885 play_tree_iter_t *my_pt_iter = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
886 int result = 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
887
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
888 if((my_pt_iter = pt_iter_create(&my_playtree, config)))
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
889 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
890 while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL)
35376
02006c5b3b30 Move add_to_gui_playlist() to util/list.c.
ib
parents: 35374
diff changeset
891 if (import_file_into_gui(filename, 1)) /* insert it into the list and set plCurrent = new item */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
892 result = 1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
893 pt_iter_destroy(&my_pt_iter);
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
894 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
895 return result;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
896 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
897
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
898 static int update_videowindow(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
899 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
900 int x,y;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
901 RECT rd;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
902 WINDOWPOS wp;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
903
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
904 if(!video_window)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
905 {
33567
251a48bca536 Implement uiStop and remove outdated comment.
reimar
parents: 33557
diff changeset
906 WinID = -1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
907
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
908 if(IsWindowVisible(mygui->videowindow) && guiInfo.sh_video && guiInfo.Playing)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
909 {
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
910 ShowWindow(mygui->videowindow, SW_HIDE);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
911 return 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
912 }
33901
d4f80f889106 Cosmetic: Rename guiInfo members.
ib
parents: 33897
diff changeset
913 else if(!guiInfo.VideoWindow)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
914 return 0;
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
915 else ShowWindow(mygui->videowindow, SW_SHOW);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
916 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
917
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
918 /* we've come out of fullscreen at the end of file */
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
919 if((!IsWindowVisible(mygui->videowindow) || IsIconic(mygui->videowindow)) && guiInfo.VideoWindow)
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
920 ShowWindow(mygui->videowindow, SW_SHOWNORMAL);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
921
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
922 /* get our current window coordinates */
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
923 GetWindowRect(mygui->videowindow, &rd);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
924
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
925 x = rd.left;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
926 y = rd.top;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
927
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
928 /* restore video window position when coming out of fullscreen */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
929 if(x <= 0) x = old_rect.left;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
930 if(y <= 0) y = old_rect.top;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
931
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33358
diff changeset
932 if(!guiInfo.Playing)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
933 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
934 window *desc = NULL;
34996
ebcc17a3c165 Fix compiler warnings (comparison between signed and unsigned).
ib
parents: 34697
diff changeset
935 unsigned int i;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
936
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
937 for (i=0; i<mygui->skin->windowcount; i++)
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
938 if(mygui->skin->windows[i]->type == wiVideo)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
939 desc = mygui->skin->windows[i];
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
940
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
941 rd.right = rd.left+desc->base->bitmap[0]->width;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
942 rd.bottom = rd.top+desc->base->bitmap[0]->height;
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
943 video_aspect = (float)(rd.right-rd.left)/(rd.bottom-rd.top);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
944 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
945 else
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
946 {
33901
d4f80f889106 Cosmetic: Rename guiInfo members.
ib
parents: 33897
diff changeset
947 rd.right = rd.left+guiInfo.VideoWidth;
d4f80f889106 Cosmetic: Rename guiInfo members.
ib
parents: 33897
diff changeset
948 rd.bottom = rd.top+guiInfo.VideoHeight;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
949
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
950 if (movie_aspect > 0.0) // forced aspect from the cmdline
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
951 video_aspect = movie_aspect;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
952 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
953
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
954
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
955 AdjustWindowRect(&rd, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, 0);
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
956 SetWindowPos(mygui->videowindow, 0, x, y, rd.right-rd.left, rd.bottom-rd.top, SWP_NOOWNERZORDER);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
957
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
958 wp.hwnd = mygui->videowindow;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
959 wp.x = rd.left;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
960 wp.y = rd.top;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
961 wp.cx = rd.right-rd.left;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
962 wp.cy = rd.bottom-rd.top;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
963 wp.flags = SWP_NOOWNERZORDER | SWP_SHOWWINDOW;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
964
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
965 /* erase the bitmap image if there's video */
33615
1f9a31d4f114 Replace all playback integer constants by their symbolic constants.
ib
parents: 33614
diff changeset
966 if(guiInfo.Playing != GUI_STOP && guiInfo.sh_video)
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
967 SendMessage(mygui->videowindow, WM_ERASEBKGND, (WPARAM)GetDC(mygui->videowindow), 0);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
968
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
969 /* reset the window aspect */
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34610
diff changeset
970 SendMessage(mygui->videowindow, WM_WINDOWPOSCHANGED, 0, (LPARAM)&wp);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
971 return 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
972 }