comparison gui/ui/actions.c @ 33694:45553d0f65c6

Don't let MPlayer directly call user interface functions. Provide uiEnd() as the new guiGetEvent type guiEndFile. That way, access is possible through the official interface function.
author ib
date Wed, 29 Jun 2011 14:24:39 +0000
parents cbb7cfeb8c71
children 24d919fb6778
comparison
equal deleted inserted replaced
33693:006a2db8bd55 33694:45553d0f65c6
89 wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0); 89 wsSetBackgroundRGB(&guiApp.subWindow, 0, 0, 0);
90 else 90 else
91 wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B); 91 wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
92 } 92 }
93 93
94 void uiEnd(void)
95 {
96 plItem *next;
97
98 if (!uiGotoTheNext && guiInfo.Playing) {
99 uiGotoTheNext = 1;
100 return;
101 }
102
103 if (guiInfo.Playing && (next = gtkSet(gtkGetNextPlItem, 0, NULL)) && (plLastPlayed != next)) {
104 plLastPlayed = next;
105 guiSetDF(guiInfo.Filename, next->path, next->name);
106 guiInfo.StreamType = STREAMTYPE_FILE;
107 guiInfo.FilenameChanged = guiInfo.NewPlay = 1;
108 gfree((void **)&guiInfo.AudioFile);
109 gfree((void **)&guiInfo.Subtitlename);
110 } else {
111 if (guiInfo.FilenameChanged || guiInfo.NewPlay)
112 return;
113
114 guiInfo.TimeSec = 0;
115 guiInfo.Position = 0;
116 guiInfo.AudioChannels = 0;
117 guiInfo.MovieWindow = True;
118
119 #ifdef CONFIG_DVDREAD
120 guiInfo.DVD.current_title = 1;
121 guiInfo.DVD.current_chapter = 1;
122 guiInfo.DVD.current_angle = 1;
123 #endif
124
125 if (!guiApp.subWindow.isFullScreen && gtkShowVideoWindow) {
126 wsResizeWindow(&guiApp.subWindow, guiApp.sub.width, guiApp.sub.height);
127 wsMoveWindow(&guiApp.subWindow, True, guiApp.sub.x, guiApp.sub.y);
128 } else
129 wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
130
131 guiGetEvent(guiSetState, (void *)GUI_STOP);
132 uiSubRender = 1;
133 wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
134 wsClearWindow(guiApp.subWindow);
135 wsPostRedisplay(&guiApp.subWindow);
136 }
137 }
138
139 void uiPlay(void) 94 void uiPlay(void)
140 { 95 {
141 if (!guiInfo.Filename || 96 if (!guiInfo.Filename ||
142 (guiInfo.Filename[0] == 0) || 97 (guiInfo.Filename[0] == 0) ||
143 (guiInfo.Playing == GUI_PLAY)) 98 (guiInfo.Playing == GUI_PLAY))