"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/xitk/osd.c" between
xine-ui-0.99.13.tar.bz2 and xine-ui-0.99.14.tar.bz2

About: xine is a free video player which plays mpeg-2 and mpeg-1 video, DVDs (unlocked/unencrypted only), video CDs, SVCDs, and AVI files (using Win32 codecs) with synchronized audio and video, and optionally fullscreen using the Xv extensions in Xfree86 4.x (user interface).

osd.c  (xine-ui-0.99.13.tar.bz2):osd.c  (xine-ui-0.99.14.tar.bz2)
/* /*
* Copyright (C) 2000-2021 the xine project * Copyright (C) 2000-2022 the xine project
* *
* This file is part of xine, a unix video player. * This file is part of xine, a unix video player.
* *
* xine is free software; you can redistribute it and/or modify * xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* xine is distributed in the hope that it will be useful, * xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
skipping to change at line 95 skipping to change at line 95
typedef char _xitk_static_assertion_testpalettes_size[2*(!!(sizeof(textpalettes_ color) == sizeof(uint32_t)*OVL_PALETTE_SIZE))-1]; typedef char _xitk_static_assertion_testpalettes_size[2*(!!(sizeof(textpalettes_ color) == sizeof(uint32_t)*OVL_PALETTE_SIZE))-1];
#endif #endif
static const uint8_t textpalettes_trans[OVL_PALETTE_SIZE] = { static const uint8_t textpalettes_trans[OVL_PALETTE_SIZE] = {
/* white, no border, translucid */ /* white, no border, translucid */
0, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 0, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15,
/* yellow, black border, transparent */ /* yellow, black border, transparent */
0, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 0, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15,
}; };
static const struct {
char symbol[4];
int status;
} xine_status[] = {
{ "\xD8", XINE_STATUS_IDLE }, /* Ø */
{ "}", XINE_STATUS_STOP },
{ ">" , XINE_STATUS_PLAY },
{ "{" , XINE_STATUS_QUIT }
};
static const struct {
char symbol[4];
int speed;
} xine_speeds[] = {
{ "<" , XINE_SPEED_PAUSE },
{ "@@>", XINE_SPEED_SLOW_4 },
{ "@>" , XINE_SPEED_SLOW_2 },
{ ">" , XINE_SPEED_NORMAL },
{ ">$" , XINE_SPEED_FAST_2 },
{ ">$$", XINE_SPEED_FAST_4 }
};
#define BAR_WIDTH 336 #define BAR_WIDTH 336
#define BAR_HEIGHT 25 #define BAR_HEIGHT 25
#define MINIMUM_WIN_WIDTH 300 #define MINIMUM_WIN_WIDTH 300
#define FONT_SIZE 20 #define FONT_SIZE 20
#define UNSCALED_FONT_SIZE 24 #define UNSCALED_FONT_SIZE 24
static pthread_mutex_t osd_mutex;
static void _xine_osd_show (gGui_t *gui, xine_osd_t *osd, int64_t vpts) { static void _xine_osd_show (gGui_t *gui, xine_osd_t *osd, int64_t vpts) {
if (gui->osd.use_unscaled && gui->osd.unscaled_available) if (gui->osd.use_unscaled && gui->osd.unscaled_available)
xine_osd_show_unscaled(osd, vpts); xine_osd_show_unscaled(osd, vpts);
else else
xine_osd_show(osd, vpts); xine_osd_show(osd, vpts);
} }
static void _osd_obj_hide_all (gGui_t *gui) {
while (1) {
struct xui_osd_obj_s *obj = (struct xui_osd_obj_s *)gui->osd.pending.head.ne
xt;
if (!obj->node.next)
break;
xitk_dnode_remove (&obj->node);
xine_osd_hide (obj->obj.osd[0], 0);
if (obj->obj.osd[1] && obj->obj.have_text)
xine_osd_hide (obj->obj.osd[1], 0);
obj->obj.visible = 0;
}
}
/** chain objects pending for timeout hide by relative time,
* + 1 to make sure obj.visible is always > 0. */
static void _osd_obj_tick (gGui_t *gui) {
int tick = -1;
while (1) {
struct xui_osd_obj_s *obj = (struct xui_osd_obj_s *)gui->osd.pending.head.ne
xt;
if (!obj->node.next)
break;
if ((obj->obj.visible += tick) > 1)
break;
tick = 0;
xitk_dnode_remove (&obj->node);
xine_osd_hide (obj->obj.osd[0], 0);
if (obj->obj.osd[1] && obj->obj.have_text)
xine_osd_hide (obj->obj.osd[1], 0);
obj->obj.visible = 0;
}
}
static void _osd_obj_set (gGui_t *gui, struct xui_osd_obj_s *obj, int timeout) {
struct xui_osd_obj_s *o1;
if (obj->node.next) {
o1 = (struct xui_osd_obj_s *)obj->node.next;
if (o1->node.next)
o1->obj.visible += obj->obj.visible - 1;
xitk_dnode_remove (&obj->node);
xine_osd_hide (obj->obj.osd[0], 0);
if (obj->obj.osd[1] && obj->obj.have_text)
xine_osd_hide (obj->obj.osd[1], 0);
obj->obj.visible = 0;
}
if (timeout > 0) {
for (o1 = (struct xui_osd_obj_s *)gui->osd.pending.head.next; o1->node.next;
o1 = (struct xui_osd_obj_s *)o1->node.next) {
int tt = timeout;
timeout -= o1->obj.visible - 1;
if (timeout <= 0) {
o1->obj.visible -= tt;
timeout = tt;
break;
}
}
o1 = (struct xui_osd_obj_s *)o1->node.prev;
obj->obj.visible = timeout + 1;
xitk_dnode_insert_after (&o1->node, &obj->node);
_xine_osd_show (gui, obj->obj.osd[0], 0);
if (obj->obj.osd[1] && obj->obj.have_text)
_xine_osd_show (gui, obj->obj.osd[1], 0);
}
}
static void _osd_get_output_size (gGui_t *gui, int *w, int *h) { static void _osd_get_output_size (gGui_t *gui, int *w, int *h) {
if (gui->osd.use_unscaled && gui->osd.unscaled_available) if (gui->osd.use_unscaled && gui->osd.unscaled_available)
video_window_get_output_size (gui->vwin, w, h); video_window_get_output_size (gui->vwin, w, h);
else else
video_window_get_frame_size (gui->vwin, w, h); video_window_get_frame_size (gui->vwin, w, h);
} }
static const char *_osd_get_speed_sym (int speed) { static void _osd_get_speed_sym (char **q, int speed) {
size_t i; if (speed < XINE_FINE_SPEED_NORMAL * 71 / 100) {
if (speed <= 0) {
for(i = 0; i < sizeof(xine_speeds)/sizeof(xine_speeds[0]); i++) { memcpy (*q, "<", 2); *q += 1; /* XINE_SPEED_PAUSE */
if(speed == xine_speeds[i].speed) } else if (speed < XINE_FINE_SPEED_NORMAL * 35 / 100) {
return xine_speeds[i].symbol; memcpy (*q, "@@>", 4); *q += 3; /* XINE_SPEED_SLOW_4 */
} else {
memcpy (*q, "@>", 3); *q += 2; /* XINE_SPEED_SLOW_2 */
}
} else {
if (speed < XINE_FINE_SPEED_NORMAL * 141 / 100) {
memcpy (*q, ">", 2); *q += 1; /* XINE_SPEED_NORMAL */
} else if (speed < XINE_FINE_SPEED_NORMAL * 282 / 100) {
memcpy (*q, ">$", 3); *q += 2; /* XINE_SPEED_FAST_2 */
} else {
memcpy (*q, ">$$", 4), *q += 3; /* XINE_SPEED_FAST_4 */
}
} }
return NULL;
} }
static const char *_osd_get_status_sym(int status) {
size_t i;
for(i = 0; i < sizeof(xine_status)/sizeof(xine_status[0]); i++) { static void _osd_get_status_sym (char **q, int status) {
if(status == xine_status[i].status) if (status == XINE_STATUS_STOP) {
return xine_status[i].symbol; memcpy (*q, "}", 2); *q += 1;
} }
/*
return NULL; else if (status == XINE_STATUS_PLAY) {
} memcpy (*q, ">", 2); *q += 1;
}
*/
else if (status == XINE_STATUS_QUIT) {
memcpy (*q, "{", 2); *q += 1;
}
};
void osd_init (gGui_t *gui) { void osd_init (gGui_t *gui) {
int fonth = FONT_SIZE; int fonth = FONT_SIZE;
gui->osd.sinfo.osd[0] = xine_osd_new (gui->stream, 0, 0, 900, (fonth * 6) + (5 xitk_dlist_init (&gui->osd.pending);
* 3));
xine_osd_set_font (gui->osd.sinfo.osd[0], "sans", fonth);
xine_osd_set_text_palette (gui->osd.sinfo.osd[0],
XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT, XINE_OSD_TE
XT1);
gui->osd.bar.osd[0] = xine_osd_new (gui->stream, 0, 0, BAR_WIDTH + 1, BAR_HEIG
HT + 1);
xine_osd_set_palette (gui->osd.bar.osd[0], &textpalettes_color[0].u32, textpal
ettes_trans);
gui->osd.bar.osd[1] = xine_osd_new (gui->stream, 0, 0, BAR_WIDTH + 1, BAR_HEIG gui->osd.sinfo.node.next = gui->osd.sinfo.node.prev = NULL;
HT + 1); gui->osd.sinfo.obj.osd[0] = xine_osd_new (gui->stream, 0, 0, 900, (fonth * 6)
xine_osd_set_font (gui->osd.bar.osd[1], "sans", fonth); + (5 * 3));
xine_osd_set_text_palette (gui->osd.bar.osd[1], xine_osd_set_font (gui->osd.sinfo.obj.osd[0], "sans", fonth);
XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT, XINE_OSD_TE xine_osd_set_text_palette (gui->osd.sinfo.obj.osd[0], XINE_TEXTPALETTE_WHITE_B
XT1); LACK_TRANSPARENT, XINE_OSD_TEXT1);
gui->osd.sinfo.obj.osd[1] = NULL;
gui->osd.bar.node.next = gui->osd.bar.node.prev = NULL;
gui->osd.bar.obj.osd[0] = xine_osd_new (gui->stream, 0, 0, BAR_WIDTH + 1, BAR_
HEIGHT + 1);
xine_osd_set_palette (gui->osd.bar.obj.osd[0], &textpalettes_color[0].u32, tex
tpalettes_trans);
gui->osd.bar.obj.osd[1] = xine_osd_new (gui->stream, 0, 0, BAR_WIDTH + 1, BAR_
HEIGHT + 1);
xine_osd_set_font (gui->osd.bar.obj.osd[1], "sans", fonth);
xine_osd_set_text_palette (gui->osd.bar.obj.osd[1], XINE_TEXTPALETTE_WHITE_BLA
CK_TRANSPARENT, XINE_OSD_TEXT1);
gui->osd.status.node.next = gui->osd.status.node.prev = NULL;
gui->osd.status.obj.osd[0] = xine_osd_new (gui->stream, 0, 0, 300, 2 * fonth);
xine_osd_set_text_palette (gui->osd.status.obj.osd[0], XINE_TEXTPALETTE_WHITE_
BLACK_TRANSPARENT, XINE_OSD_TEXT1);
gui->osd.status.obj.osd[1] = NULL;
gui->osd.info.node.next = gui->osd.info.node.prev = NULL;
gui->osd.info.obj.osd[0] = xine_osd_new (gui->stream, 0, 0, 2048, fonth + (fon
th >> 1));
xine_osd_set_font (gui->osd.info.obj.osd[0], "sans", fonth);
xine_osd_set_text_palette (gui->osd.info.obj.osd[0], XINE_TEXTPALETTE_WHITE_BL
ACK_TRANSPARENT, XINE_OSD_TEXT1);
gui->osd.info.obj.osd[1] = NULL;
gui->osd.status.osd[0] = xine_osd_new (gui->stream, 0, 0, 300, 2 * fonth); gui->osd.unscaled_available = xine_osd_get_capabilities (gui->osd.status.obj.o
xine_osd_set_text_palette (gui->osd.status.osd[0], sd[0]) & XINE_OSD_CAP_UNSCALED;
XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT, XINE_OSD_TE
XT1);
gui->osd.info.osd[0] = xine_osd_new (gui->stream, 0, 0, 2048, fonth + (fonth > pthread_mutex_init (&gui->osd.mutex, NULL);
> 1));
xine_osd_set_font (gui->osd.info.osd[0], "sans", fonth);
xine_osd_set_text_palette (gui->osd.info.osd[0],
XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT, XINE_OSD_TE
XT1);
gui->osd.unscaled_available =
(xine_osd_get_capabilities (gui->osd.status.osd[0]) & XINE_OSD_CAP_UNSCALED
);
pthread_mutex_init(&osd_mutex, NULL);
} }
void osd_hide_sinfo (gGui_t *gui) { void osd_hide_sinfo (gGui_t *gui) {
pthread_mutex_lock(&osd_mutex); pthread_mutex_lock (&gui->osd.mutex);
if (gui->osd.sinfo.visible) { _osd_obj_set (gui, &gui->osd.sinfo, 0);
gui->osd.sinfo.visible = 0; pthread_mutex_unlock (&gui->osd.mutex);
xine_osd_hide (gui->osd.sinfo.osd[0], 0);
}
pthread_mutex_unlock(&osd_mutex);
} }
void osd_hide_bar (gGui_t *gui) { void osd_hide_bar (gGui_t *gui) {
pthread_mutex_lock(&osd_mutex); pthread_mutex_lock (&gui->osd.mutex);
if (gui->osd.bar.visible) { _osd_obj_set (gui, &gui->osd.bar, 0);
gui->osd.bar.visible = 0; pthread_mutex_unlock (&gui->osd.mutex);
xine_osd_hide (gui->osd.bar.osd[0], 0);
xine_osd_hide (gui->osd.bar.osd[1], 0);
}
pthread_mutex_unlock(&osd_mutex);
} }
void osd_hide_status (gGui_t *gui) { void osd_hide_status (gGui_t *gui) {
pthread_mutex_lock(&osd_mutex); pthread_mutex_lock (&gui->osd.mutex);
if (gui->osd.status.visible) { _osd_obj_set (gui, &gui->osd.status, 0);
gui->osd.status.visible = 0; pthread_mutex_unlock (&gui->osd.mutex);
xine_osd_hide (gui->osd.status.osd[0], 0);
}
pthread_mutex_unlock(&osd_mutex);
} }
void osd_hide_info (gGui_t *gui) { void osd_hide_info (gGui_t *gui) {
pthread_mutex_lock(&osd_mutex); pthread_mutex_lock (&gui->osd.mutex);
if (gui->osd.info.visible) { _osd_obj_set (gui, &gui->osd.info, 0);
gui->osd.info.visible = 0; pthread_mutex_unlock (&gui->osd.mutex);
xine_osd_hide (gui->osd.info.osd[0], 0);
}
pthread_mutex_unlock(&osd_mutex);
} }
void osd_hide (gGui_t *gui) { void osd_hide (gGui_t *gui) {
pthread_mutex_lock (&gui->osd.mutex);
osd_hide_sinfo (gui); _osd_obj_hide_all (gui);
osd_hide_bar (gui); pthread_mutex_unlock (&gui->osd.mutex);
osd_hide_status (gui);
osd_hide_info (gui);
} }
void osd_deinit (gGui_t *gui) { void osd_deinit (gGui_t *gui) {
osd_hide (gui); osd_hide (gui);
xine_osd_free (gui->osd.sinfo.osd[0]); xine_osd_free (gui->osd.sinfo.obj.osd[0]);
xine_osd_free (gui->osd.bar.osd[0]); xine_osd_free (gui->osd.bar.obj.osd[0]);
xine_osd_free (gui->osd.bar.osd[1]); xine_osd_free (gui->osd.bar.obj.osd[1]);
xine_osd_free (gui->osd.status.osd[0]); xine_osd_free (gui->osd.status.obj.osd[0]);
xine_osd_free (gui->osd.info.osd[0]); xine_osd_free (gui->osd.info.obj.osd[0]);
pthread_mutex_destroy(&osd_mutex); pthread_mutex_destroy (&gui->osd.mutex);
} }
void osd_update (gGui_t *gui) { void osd_update (gGui_t *gui) {
pthread_mutex_lock(&osd_mutex); pthread_mutex_lock (&gui->osd.mutex);
_osd_obj_tick (gui);
if (gui->osd.sinfo.visible) { pthread_mutex_unlock (&gui->osd.mutex);
gui->osd.sinfo.visible--;
if (!gui->osd.sinfo.visible) {
xine_osd_hide (gui->osd.sinfo.osd[0], 0);
}
}
if (gui->osd.bar.visible) {
gui->osd.bar.visible--;
if (!gui->osd.bar.visible) {
xine_osd_hide (gui->osd.bar.osd[0], 0);
xine_osd_hide (gui->osd.bar.osd[1], 0);
}
}
if (gui->osd.status.visible) {
gui->osd.status.visible--;
if (!gui->osd.status.visible) {
xine_osd_hide (gui->osd.status.osd[0], 0);
}
}
if (gui->osd.info.visible) {
gui->osd.info.visible--;
if (!gui->osd.info.visible) {
xine_osd_hide (gui->osd.info.osd[0], 0);
}
}
pthread_mutex_unlock(&osd_mutex);
} }
void osd_stream_infos (gGui_t *gui) { void osd_stream_infos (gGui_t *gui) {
if (gui->osd.enabled) { if (gui->osd.enabled) {
int vwidth, vheight, asrate; int vwidth, vheight, asrate;
int wwidth, wheight; int wwidth, wheight;
const char *vcodec, *acodec; const char *vcodec, *acodec;
char buffer[256], *p; char buffer[512], *p, *e = buffer + sizeof (buffer);
int x, y; int x, y;
int w, h, osdw; int w, h, osdw;
int playedtime, playeddays, totaltime, pos; int playedtime, playeddays, totaltime, pos;
int audiochannel, spuchannel, len; int audiochannel, spuchannel;
#ifdef XINE_QUERY_STREAM_INFO
char sbuf[512];
int strings[3] = {XINE_META_INFO_VIDEOCODEC, XINE_META_INFO_AUDIOCODEC, -1};
int ints[4] = { XINE_STREAM_INFO_VIDEO_WIDTH, XINE_STREAM_INFO_VIDEO_HEIGHT,
XINE_STREAM_INFO_AUDIO_SAMPLERATE, -1};
xine_query_stream_info (gui->stream, sbuf, sizeof (sbuf), strings, ints);
vcodec = strings[0] ? sbuf + strings[0] : NULL;
acodec = strings[1] ? sbuf + strings[1] : NULL;
vwidth = ints[0];
vheight = ints[1];
asrate = ints[2];
#else
vcodec = xine_get_meta_info (gui->stream, XINE_META_INFO_VIDEOCODEC); vcodec = xine_get_meta_info (gui->stream, XINE_META_INFO_VIDEOCODEC);
acodec = xine_get_meta_info (gui->stream, XINE_META_INFO_AUDIOCODEC); acodec = xine_get_meta_info (gui->stream, XINE_META_INFO_AUDIOCODEC);
vwidth = xine_get_stream_info (gui->stream, XINE_STREAM_INFO_VIDEO_WID TH); vwidth = xine_get_stream_info (gui->stream, XINE_STREAM_INFO_VIDEO_WID TH);
vheight = xine_get_stream_info (gui->stream, XINE_STREAM_INFO_VIDEO_HEI GHT); vheight = xine_get_stream_info (gui->stream, XINE_STREAM_INFO_VIDEO_HEI GHT);
asrate = xine_get_stream_info (gui->stream, XINE_STREAM_INFO_AUDIO_SAM PLERATE); asrate = xine_get_stream_info (gui->stream, XINE_STREAM_INFO_AUDIO_SAM PLERATE);
#endif
audiochannel = xine_get_param (gui->stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL ); audiochannel = xine_get_param (gui->stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL );
spuchannel = xine_get_param (gui->stream, XINE_PARAM_SPU_CHANNEL); spuchannel = xine_get_param (gui->stream, XINE_PARAM_SPU_CHANNEL);
if (!gui_xine_get_pos_length (gui, gui->stream, &pos, &playedtime, &totaltim e)) if (!gui_xine_get_pos_length (gui, gui->stream, &pos, &playedtime, &totaltim e))
return; return;
playedtime /= 1000; playedtime /= 1000;
totaltime /= 1000; totaltime /= 1000;
xine_osd_clear (gui->osd.sinfo.osd[0]); xine_osd_clear (gui->osd.sinfo.obj.osd[0]);
/* We're in visual animation mode */ /* We're in visual animation mode */
if((vwidth == 0) && (vheight == 0)) { if((vwidth == 0) && (vheight == 0)) {
if (gui->visual_anim.running) { if (gui->visual_anim.running) {
if (gui->visual_anim.enabled == 1) { if (gui->visual_anim.enabled == 1) {
video_window_get_frame_size (gui->vwin, &vwidth, &vheight); video_window_get_frame_size (gui->vwin, &vwidth, &vheight);
vcodec = _("post animation"); vcodec = _("post animation");
} }
else if (gui->visual_anim.enabled == 2) { else if (gui->visual_anim.enabled == 2) {
vcodec = xine_get_meta_info (gui->visual_anim.stream, XINE_META_INFO_ VIDEOCODEC); vcodec = xine_get_meta_info (gui->visual_anim.stream, XINE_META_INFO_ VIDEOCODEC);
skipping to change at line 335 skipping to change at line 363
else { else {
video_window_get_frame_size (gui->vwin, &vwidth, &vheight); video_window_get_frame_size (gui->vwin, &vwidth, &vheight);
vcodec = _("unknown"); vcodec = _("unknown");
} }
} }
_osd_get_output_size (gui, &wwidth, &wheight); _osd_get_output_size (gui, &wwidth, &wheight);
y = x = 0; y = x = 0;
pthread_mutex_lock (&gui->mmk_mutex); gui_playlist_lock (gui);
strlcpy (buffer, (gui->is_display_mrl) ? gui->mmk.mrl : gui->mmk.ident, size of (buffer)); strlcpy (buffer, (gui->is_display_mrl) ? gui->mmk.mrl : gui->mmk.ident, size of (buffer));
pthread_mutex_unlock (&gui->mmk_mutex); gui_playlist_unlock (gui);
xine_osd_get_text_size (gui->osd.sinfo.osd[0], buffer, &osdw, &h); xine_osd_get_text_size (gui->osd.sinfo.obj.osd[0], buffer, &osdw, &h);
p = buffer; p = buffer;
while(osdw > (wwidth - 40)) { while(osdw > (wwidth - 40)) {
*(p++) = '\0'; *(p++) = '\0';
*(p) = '.'; *(p) = '.';
*(p+1) = '.'; *(p+1) = '.';
*(p+2) = '.'; *(p+2) = '.';
xine_osd_get_text_size (gui->osd.sinfo.osd[0], p, &osdw, &h); xine_osd_get_text_size (gui->osd.sinfo.obj.osd[0], p, &osdw, &h);
} }
xine_osd_draw_text (gui->osd.sinfo.osd[0], x, y, p, XINE_OSD_TEXT1); xine_osd_draw_text (gui->osd.sinfo.obj.osd[0], x, y, p, XINE_OSD_TEXT1);
y += h; y += h;
if(vcodec && vwidth && vheight) { if(vcodec && vwidth && vheight) {
snprintf(buffer, sizeof(buffer), "%s: %dX%d", vcodec, vwidth, vheight); snprintf(buffer, sizeof(buffer), "%s: %dX%d", vcodec, vwidth, vheight);
xine_osd_draw_text (gui->osd.sinfo.osd[0], x, y, buffer, XINE_OSD_TEXT1); xine_osd_draw_text (gui->osd.sinfo.obj.osd[0], x, y, buffer, XINE_OSD_TEXT
xine_osd_get_text_size (gui->osd.sinfo.osd[0], buffer, &w, &h); 1);
xine_osd_get_text_size (gui->osd.sinfo.obj.osd[0], buffer, &w, &h);
if(w > osdw) if(w > osdw)
osdw = w; osdw = w;
y += h; y += h;
} }
if(acodec && asrate) { if(acodec && asrate) {
snprintf(buffer, sizeof(buffer), "%s: %d%s", acodec, asrate, "Hz"); snprintf(buffer, sizeof(buffer), "%s: %d%s", acodec, asrate, "Hz");
xine_osd_draw_text (gui->osd.sinfo.osd[0], x, y, buffer, XINE_OSD_TEXT1); xine_osd_draw_text (gui->osd.sinfo.obj.osd[0], x, y, buffer, XINE_OSD_TEXT
xine_osd_get_text_size (gui->osd.sinfo.osd[0], buffer, &w, &h); 1);
xine_osd_get_text_size (gui->osd.sinfo.obj.osd[0], buffer, &w, &h);
if(w > osdw) if(w > osdw)
osdw = w; osdw = w;
y += h; y += h;
} }
strlcpy(buffer, _("Audio: "), sizeof(buffer)); p = buffer;
len = strlen(buffer); p += strlcpy (p, _("Audio: "), e - p);
switch(audiochannel) { if (p > e)
case -2: p = e;
strlcat(buffer, "off", sizeof(buffer)); switch (audiochannel) {
break; case -2:
case -1: p += strlcpy (p, "off", e - p);
if(!xine_get_audio_lang (gui->stream, audiochannel, &buffer[len])) break;
strlcat(buffer, "auto", sizeof(buffer)); case -1:
break; if (xine_get_audio_lang (gui->stream, audiochannel, p))
default: p += strlen (p);
if(!xine_get_audio_lang (gui->stream, audiochannel, &buffer[len])) else
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), "%3d", aud p += strlcpy (p, "auto", e - p);
iochannel); break;
break; default:
} if (xine_get_audio_lang (gui->stream, audiochannel, p))
p += strlen (p);
strlcat(buffer, ", Spu: ", sizeof(buffer)); else
len = strlen(buffer); p += snprintf (p, e - p, "%3d", audiochannel);
}
if (p > e)
p = e;
p += strlcpy (p, ", Spu: ", e - p);
if (p > e)
p = e;
switch (spuchannel) { switch (spuchannel) {
case -2: case -2:
strlcat(buffer, "off", sizeof(buffer)); p += strlcpy (p, "off", e - p);
break; break;
case -1: case -1:
if (!xine_get_spu_lang (gui->stream, spuchannel, &buffer[len])) if (xine_get_spu_lang (gui->stream, spuchannel, p))
strlcat(buffer, "auto", sizeof(buffer)); p += strlen (p);
break; else
default: p += strlcpy (p, "auto", e - p);
if(!xine_get_spu_lang (gui->stream, spuchannel, &buffer[len])) break;
snprintf(buffer+strlen(buffer), sizeof(buffer)-strlen(buffer), "%3d", sp default:
uchannel); if (xine_get_spu_lang (gui->stream, spuchannel, p))
break; p += strlen (p);
} else
strlcat(buffer, ".", sizeof(buffer)); p += snprintf (p, e - p, "%3d", spuchannel);
xine_osd_draw_text (gui->osd.sinfo.osd[0], x, y, buffer, XINE_OSD_TEXT1); }
xine_osd_get_text_size (gui->osd.sinfo.osd[0], buffer, &w, &h); if (p > e)
p = e;
/* p += */ strlcpy (p, ".", e - p);
xine_osd_draw_text (gui->osd.sinfo.obj.osd[0], x, y, buffer, XINE_OSD_TEXT1)
;
xine_osd_get_text_size (gui->osd.sinfo.obj.osd[0], buffer, &w, &h);
if(w > osdw) if(w > osdw)
osdw = w; osdw = w;
y += (h); y += (h);
playeddays = playedtime / (3600 * 24); playeddays = playedtime / (3600 * 24);
if(playeddays > 0) if(playeddays > 0)
sprintf(buffer, "%d::%02d ", playeddays, playedtime / 3600); sprintf(buffer, "%d::%02d ", playeddays, playedtime / 3600);
else else
skipping to change at line 427 skipping to change at line 468
totaldays = totaltime / (3600 * 24); totaldays = totaltime / (3600 * 24);
sprintf(buffer+strlen(buffer), "(%.0f%%) %s ", ((float)playedtime / (float )totaltime) * 100, _("of")); sprintf(buffer+strlen(buffer), "(%.0f%%) %s ", ((float)playedtime / (float )totaltime) * 100, _("of"));
if(totaldays > 0) if(totaldays > 0)
sprintf(buffer+strlen(buffer), "%d::%02d", totaldays, totaltime / 3600); sprintf(buffer+strlen(buffer), "%d::%02d", totaldays, totaltime / 3600);
else else
sprintf(buffer+strlen(buffer), "%d:%02d:%02d", totaltime / 3600, (totalti me % 3600) / 60, totaltime % 60); sprintf(buffer+strlen(buffer), "%d:%02d:%02d", totaltime / 3600, (totalti me % 3600) / 60, totaltime % 60);
} }
xine_osd_draw_text (gui->osd.sinfo.osd[0], x, y, buffer, XINE_OSD_TEXT1); xine_osd_draw_text (gui->osd.sinfo.obj.osd[0], x, y, buffer, XINE_OSD_TEXT1)
xine_osd_get_text_size (gui->osd.sinfo.osd[0], buffer, &w, &h); ;
xine_osd_get_text_size (gui->osd.sinfo.obj.osd[0], buffer, &w, &h);
if(w > osdw) if(w > osdw)
osdw = w; osdw = w;
osd_stream_position (gui, pos); osd_stream_position (gui, pos);
x = (wwidth - osdw) - 40; x = (wwidth - osdw) - 40;
xine_osd_set_position (gui->osd.sinfo.osd[0], (x >= 0) ? x : 0, 15); xine_osd_set_position (gui->osd.sinfo.obj.osd[0], (x >= 0) ? x : 0, 15);
gui->osd.sinfo.x = (x >= 0) ? x : 0; gui->osd.sinfo.obj.x = (x >= 0) ? x : 0;
gui->osd.sinfo.y = 15; gui->osd.sinfo.obj.y = 15;
gui->osd.sinfo.w = osdw; gui->osd.sinfo.obj.w = osdw;
pthread_mutex_lock(&osd_mutex); pthread_mutex_lock (&gui->osd.mutex);
_xine_osd_show (gui, gui->osd.sinfo.osd[0], 0); _osd_obj_set (gui, &gui->osd.sinfo, gui->osd.timeout);
gui->osd.sinfo.visible = gui->osd.timeout; pthread_mutex_unlock (&gui->osd.mutex);
pthread_mutex_unlock(&osd_mutex);
} }
} }
void osd_draw_bar (gGui_t *gui, const char *title, int min, int max, int val, in t type) { void osd_draw_bar (gGui_t *gui, const char *title, int min, int max, int val, in t type) {
if (gui->osd.enabled) { if (gui->osd.enabled) {
int wwidth, wheight; int wwidth, wheight;
int bar_color[40]; int bar_color[40];
int i, x; int i, x;
float _val = (int) val; float _val = (int) val;
float _min = (int) min; float _min = (int) min;
skipping to change at line 470 skipping to change at line 510
_min = (int) (max - 1); _min = (int) (max - 1);
if(val > max) if(val > max)
_val = (int) max; _val = (int) max;
if(val < min) if(val < min)
_val = (int) min; _val = (int) min;
pos = (int) (_val + -_min) / ((_max + -_min) / 40); pos = (int) (_val + -_min) / ((_max + -_min) / 40);
_osd_get_output_size (gui, &wwidth, &wheight); _osd_get_output_size (gui, &wwidth, &wheight);
xine_osd_clear (gui->osd.bar.osd[0]); xine_osd_clear (gui->osd.bar.obj.osd[0]);
xine_osd_clear (gui->osd.bar.osd[1]); xine_osd_clear (gui->osd.bar.obj.osd[1]);
memset(&bar_color, (XINE_OSD_TEXT1 + 7), sizeof(int) * 40); memset(&bar_color, (XINE_OSD_TEXT1 + 7), sizeof(int) * 40);
switch(type) { switch(type) {
case OSD_BAR_PROGRESS: case OSD_BAR_PROGRESS:
case OSD_BAR_STEPPER: case OSD_BAR_STEPPER:
if(pos) if(pos)
memset(bar_color, (XINE_OSD_TEXT1 + 21), sizeof(int) * pos); memset(bar_color, (XINE_OSD_TEXT1 + 21), sizeof(int) * pos);
break; break;
case OSD_BAR_POS: case OSD_BAR_POS:
case OSD_BAR_POS2: case OSD_BAR_POS2:
if(pos) if(pos)
bar_color[pos - 1] = (XINE_OSD_TEXT1 + 21); bar_color[pos - 1] = (XINE_OSD_TEXT1 + 21);
break; break;
} }
if((type == OSD_BAR_PROGRESS) || (type == OSD_BAR_POS)) { if((type == OSD_BAR_PROGRESS) || (type == OSD_BAR_POS)) {
x = 3; x = 3;
xine_osd_draw_rect (gui->osd.bar.osd[0], x, 2, x + 3, BAR_HEIGHT - 2, XINE _OSD_TEXT1 + 9, 1); xine_osd_draw_rect (gui->osd.bar.obj.osd[0], x, 2, x + 3, BAR_HEIGHT - 2, XINE_OSD_TEXT1 + 9, 1);
x += 8; x += 8;
for(i = 0; i < 40; i++, x += 8) { for(i = 0; i < 40; i++, x += 8) {
xine_osd_draw_rect (gui->osd.bar.osd[0], xine_osd_draw_rect (gui->osd.bar.obj.osd[0],
x, 6, x + 3, BAR_HEIGHT - 2, bar_color[i], 1); x, 6, x + 3, BAR_HEIGHT - 2, bar_color[i], 1);
} }
xine_osd_draw_rect (gui->osd.bar.osd[0], xine_osd_draw_rect (gui->osd.bar.obj.osd[0],
x, 2, x + 3, BAR_HEIGHT - 2, XINE_OSD_TEXT1 + 9, 1); x, 2, x + 3, BAR_HEIGHT - 2, XINE_OSD_TEXT1 + 9, 1);
} }
else if(type == OSD_BAR_POS2) { else if(type == OSD_BAR_POS2) {
x = 3; x = 3;
xine_osd_draw_rect (gui->osd.bar.osd[0], x, 2, x + 3, BAR_HEIGHT - 2, XINE _OSD_TEXT1 + 9, 1); xine_osd_draw_rect (gui->osd.bar.obj.osd[0], x, 2, x + 3, BAR_HEIGHT - 2, XINE_OSD_TEXT1 + 9, 1);
x += 8; x += 8;
for(i = 0; i < 40; i++, x += 8) { for(i = 0; i < 40; i++, x += 8) {
if(i == (pos - 1)) if(i == (pos - 1))
xine_osd_draw_rect (gui->osd.bar.osd[0], xine_osd_draw_rect (gui->osd.bar.obj.osd[0],
x, 2, x + 3, BAR_HEIGHT - 2, bar_color[i], 1); x, 2, x + 3, BAR_HEIGHT - 2, bar_color[i], 1);
else else
xine_osd_draw_rect (gui->osd.bar.osd[0], xine_osd_draw_rect (gui->osd.bar.obj.osd[0],
x, 6, x + 3, BAR_HEIGHT - 6, bar_color[i], 1); x, 6, x + 3, BAR_HEIGHT - 6, bar_color[i], 1);
} }
xine_osd_draw_rect (gui->osd.bar.osd[0], xine_osd_draw_rect (gui->osd.bar.obj.osd[0],
x, 2, x + 3, BAR_HEIGHT - 2, XINE_OSD_TEXT1 + 9, 1); x, 2, x + 3, BAR_HEIGHT - 2, XINE_OSD_TEXT1 + 9, 1);
} }
else if(type == OSD_BAR_STEPPER) { else if(type == OSD_BAR_STEPPER) {
int y = BAR_HEIGHT - 4; int y = BAR_HEIGHT - 4;
int step = y / 20; int step = y / 20;
x = 11; x = 11;
for(i = 0; i < 40; i++, x += 8) { for(i = 0; i < 40; i++, x += 8) {
xine_osd_draw_rect (gui->osd.bar.osd[0], xine_osd_draw_rect (gui->osd.bar.obj.osd[0],
x, y, x + 3, BAR_HEIGHT - 2, bar_color[i], 1); x, y, x + 3, BAR_HEIGHT - 2, bar_color[i], 1);
if(!(i % 2)) if(!(i % 2))
y -= step; y -= step;
} }
} }
if(title) { if(title) {
int tw, th; int tw, th;
gui->osd.bar.have_text = 1; gui->osd.bar.obj.have_text = 1;
xine_osd_get_text_size (gui->osd.bar.osd[1], title, &tw, &th); xine_osd_get_text_size (gui->osd.bar.obj.osd[1], title, &tw, &th);
xine_osd_draw_text (gui->osd.bar.osd[1], (BAR_WIDTH - tw) >> 1, 0, title, xine_osd_draw_text (gui->osd.bar.obj.osd[1], (BAR_WIDTH - tw) >> 1, 0, tit
XINE_OSD_TEXT1); le, XINE_OSD_TEXT1);
} }
else else
gui->osd.bar.have_text = 0; gui->osd.bar.obj.have_text = 0;
x = (wwidth - BAR_WIDTH) >> 1; x = (wwidth - BAR_WIDTH) >> 1;
xine_osd_set_position (gui->osd.bar.osd[0], (x >= 0) ? x : 0, (wheight - BAR xine_osd_set_position (gui->osd.bar.obj.osd[0], (x >= 0) ? x : 0, (wheight -
_HEIGHT) - 40); BAR_HEIGHT) - 40);
xine_osd_set_position (gui->osd.bar.osd[1], (x >= 0) ? x : 0, (wheight - (BA xine_osd_set_position (gui->osd.bar.obj.osd[1], (x >= 0) ? x : 0, (wheight -
R_HEIGHT * 2)) - 40); (BAR_HEIGHT * 2)) - 40);
/* don't even bother drawing osd over those small streams. /* don't even bother drawing osd over those small streams.
* it would look pretty bad. * it would look pretty bad.
*/ */
if( wwidth > MINIMUM_WIN_WIDTH ) { if( wwidth > MINIMUM_WIN_WIDTH ) {
pthread_mutex_lock(&osd_mutex); pthread_mutex_lock (&gui->osd.mutex);
_xine_osd_show (gui, gui->osd.bar.osd[0], 0); _osd_obj_set (gui, &gui->osd.bar, gui->osd.timeout);
if(title) pthread_mutex_unlock (&gui->osd.mutex);
_xine_osd_show (gui, gui->osd.bar.osd[1], 0);
gui->osd.bar.visible = gui->osd.timeout;
pthread_mutex_unlock(&osd_mutex);
} }
} }
} }
void osd_stream_position (gGui_t *gui, int pos) { void osd_stream_position (gGui_t *gui, int pos) {
osd_draw_bar (gui, _("Position in Stream"), 0, 65535, pos, OSD_BAR_POS2); osd_draw_bar (gui, _("Position in Stream"), 0, 65535, pos, OSD_BAR_POS2);
} }
void osd_display_info (gGui_t *gui, const char *info, ...) { void osd_display_info (gGui_t *gui, const char *info, ...) {
char *buf; char *buf;
skipping to change at line 595 skipping to change at line 632
text = buf = xitk_vasprintf (info, args); text = buf = xitk_vasprintf (info, args);
} }
va_end (args); va_end (args);
} }
} else { } else {
text = buf = NULL; text = buf = NULL;
} }
if (!text) if (!text)
return; return;
xine_osd_clear (gui->osd.info.osd[0]); xine_osd_clear (gui->osd.info.obj.osd[0]);
xine_osd_draw_text (gui->osd.info.osd[0], 0, 0, text, XINE_OSD_TEXT1); xine_osd_draw_text (gui->osd.info.obj.osd[0], 0, 0, text, XINE_OSD_TEXT1);
xine_osd_set_position (gui->osd.info.osd[0], 20, 10 + 30); xine_osd_set_position (gui->osd.info.obj.osd[0], 20, 10 + 30);
pthread_mutex_lock (&osd_mutex); pthread_mutex_lock (&gui->osd.mutex);
_xine_osd_show (gui, gui->osd.info.osd[0], 0); _osd_obj_set (gui, &gui->osd.info, gui->osd.timeout);
gui->osd.info.visible = gui->osd.timeout; pthread_mutex_unlock (&gui->osd.mutex);
pthread_mutex_unlock (&osd_mutex);
free (buf); free (buf);
} }
void osd_update_status (gGui_t *gui) { void osd_update_status (gGui_t *gui) {
if (gui->osd.enabled) { if (gui->osd.enabled) {
int status; int status;
char buffer[256]; char buffer[256];
int wwidth, wheight; int wwidth, wheight;
status = xine_get_status (gui->stream); status = xine_get_status (gui->stream);
xine_osd_clear (gui->osd.status.osd[0]);
/* /*
{ : eject { : eject
[ : previous [ : previous
| : | (thin) | : | (thin)
@ : | (large) @ : | (large)
] : next ] : next
} : stop } : stop
$ : > (large) $ : > (large)
> : play > : play
< : pause < : pause
*/ */
memset(&buffer, 0, sizeof(buffer)); buffer[0] = 0;
switch(status) { switch (status) {
case XINE_STATUS_IDLE:
case XINE_STATUS_STOP:
strlcpy(buffer, _osd_get_status_sym(status), sizeof(buffer));
break;
case XINE_STATUS_PLAY: case XINE_STATUS_IDLE:
{ case XINE_STATUS_STOP:
int speed = xine_get_param (gui->stream, XINE_PARAM_SPEED); {
int secs; char *q = buffer;
_osd_get_status_sym (&q, status);
}
break;
case XINE_STATUS_PLAY:
{
int speed = xine_get_param (gui->stream, XINE_PARAM_FINE_SPEED), ms =
0;
char *q = buffer;
_osd_get_speed_sym (&q, speed);
if (gui_xine_get_pos_length (gui, gui->stream, NULL, &ms, NULL)) {
uint32_t u = (ms < 0) ? -ms : ms;
if (ms < 0)
*q++ = '-';
if (speed < XINE_FINE_SPEED_NORMAL * 4 / 5) {
if (!u)
break;
q[13] = 0;
q[12] = u % 10u + '0';
u /= 10u;
q[11] = u % 10 + '0';
u /= 10u;
q[10] = u % 10u + '0';
u /= 10u;
q[9] = '.';
} else {
u /= 1000u;
if (!u)
break;
q[9] = 0;
}
q[8] = u % 10u + '0';
u /= 10u;
q[7] = u % 6u + '0';
u /= 6u;
q[6] = ':';
q[5] = u % 10u + '0';
u /= 10u;
q[4] = u % 6u + '0';
u /= 6u;
q[3] = ':';
q[2] = u % 10u + '0';
u /= 10u;
q[1] = u % 10u + '0';
q[0] = ' ';
}
}
break;
if (gui_xine_get_pos_length (gui, gui->stream, NULL, &secs, NULL)) { default: ;
secs /= 1000; }
snprintf(buffer, sizeof(buffer), "%s %02d:%02d:%02d", (_osd_get_speed_s _osd_get_output_size (gui, &wwidth, &wheight);
ym(speed)),
secs / (60*60), (secs / 60) % 60, secs % 60);
}
else
strlcpy(buffer, _osd_get_speed_sym(speed), sizeof(buffer));
} pthread_mutex_lock (&gui->osd.mutex);
break;
case XINE_STATUS_QUIT: xine_osd_clear (gui->osd.status.obj.osd[0]);
/* noop */
break;
}
if (gui->osd.use_unscaled && gui->osd.unscaled_available) if (gui->osd.use_unscaled && gui->osd.unscaled_available)
xine_osd_set_font (gui->osd.status.osd[0], "cetus", UNSCALED_FONT_SIZE); xine_osd_set_font (gui->osd.status.obj.osd[0], "cetus", UNSCALED_FONT_SIZE );
else else
xine_osd_set_font (gui->osd.status.osd[0], "cetus", FONT_SIZE); xine_osd_set_font (gui->osd.status.obj.osd[0], "cetus", FONT_SIZE);
/* set latin1 encoding (NULL) for status text with special characters, /* set latin1 encoding (NULL) for status text with special characters,
* then switch back to locale encoding ("") * then switch back to locale encoding ("")
*/ */
xine_osd_set_encoding (gui->osd.status.osd[0], NULL); xine_osd_set_encoding (gui->osd.status.obj.osd[0], NULL);
xine_osd_draw_text (gui->osd.status.osd[0], 0, 0, buffer, XINE_OSD_TEXT1); xine_osd_draw_text (gui->osd.status.obj.osd[0], 0, 0, buffer, XINE_OSD_TEXT1
xine_osd_set_encoding (gui->osd.status.osd[0], ""); );
xine_osd_set_position (gui->osd.status.osd[0], 20, 10); xine_osd_set_encoding (gui->osd.status.obj.osd[0], "");
xine_osd_set_position (gui->osd.status.obj.osd[0], 20, 10);
_osd_get_output_size (gui, &wwidth, &wheight);
/* don't even bother drawing osd over those small streams. /* don't even bother drawing osd over those small streams.
* it would look pretty bad. * it would look pretty bad.
*/ */
if( wwidth > MINIMUM_WIN_WIDTH ) { if (wwidth > MINIMUM_WIN_WIDTH)
pthread_mutex_lock(&osd_mutex); _osd_obj_set (gui, &gui->osd.status, gui->osd.timeout);
_xine_osd_show (gui, gui->osd.status.osd[0], 0);
gui->osd.status.visible = gui->osd.timeout; pthread_mutex_unlock (&gui->osd.mutex);
pthread_mutex_unlock(&osd_mutex);
}
} }
} }
void osd_display_spu_lang (gGui_t *gui) { void osd_display_spu_lang (gGui_t *gui) {
char buffer[XINE_LANG_MAX+128]; char buffer[XINE_LANG_MAX+128];
char lang_buffer[XINE_LANG_MAX]; char lang_buffer[XINE_LANG_MAX];
int channel; int channel;
const char *lang = NULL; const char *lang = NULL;
channel = xine_get_param (gui->stream, XINE_PARAM_SPU_CHANNEL); channel = xine_get_param (gui->stream, XINE_PARAM_SPU_CHANNEL);
skipping to change at line 749 skipping to change at line 817
} }
snprintf(buffer, sizeof(buffer), "%s%s", _("Audio Channel: "), get_language_fr om_iso639_1(lang)); snprintf(buffer, sizeof(buffer), "%s%s", _("Audio Channel: "), get_language_fr om_iso639_1(lang));
osd_display_info (gui, "%s", buffer); osd_display_info (gui, "%s", buffer);
} }
void osd_update_osd (gGui_t *gui) { void osd_update_osd (gGui_t *gui) {
int vwidth, vheight, wwidth, wheight; int vwidth, vheight, wwidth, wheight;
int x; int x;
if (!gui->osd.sinfo.visible && !gui->osd.bar.visible) if (!gui->osd.sinfo.obj.visible && !gui->osd.bar.obj.visible)
return; return;
vwidth = xine_get_stream_info (gui->stream, XINE_STREAM_INFO_VIDEO_WIDTH); vwidth = xine_get_stream_info (gui->stream, XINE_STREAM_INFO_VIDEO_WIDTH);
vheight = xine_get_stream_info (gui->stream, XINE_STREAM_INFO_VIDEO_HEIGHT); vheight = xine_get_stream_info (gui->stream, XINE_STREAM_INFO_VIDEO_HEIGHT);
if((vwidth == 0) && (vheight == 0)) { if((vwidth == 0) && (vheight == 0)) {
if (gui->visual_anim.running) { if (gui->visual_anim.running) {
if (gui->visual_anim.enabled == 1) if (gui->visual_anim.enabled == 1)
video_window_get_frame_size (gui->vwin, &vwidth, &vheight); video_window_get_frame_size (gui->vwin, &vwidth, &vheight);
else if (gui->visual_anim.enabled == 2) else if (gui->visual_anim.enabled == 2)
vwidth = xine_get_stream_info (gui->visual_anim.stream, XINE_STREAM_INFO _VIDEO_WIDTH); vwidth = xine_get_stream_info (gui->visual_anim.stream, XINE_STREAM_INFO _VIDEO_WIDTH);
} }
else else
video_window_get_frame_size (gui->vwin, &vwidth, &vheight); video_window_get_frame_size (gui->vwin, &vwidth, &vheight);
} }
_osd_get_output_size (gui, &wwidth, &wheight); _osd_get_output_size (gui, &wwidth, &wheight);
pthread_mutex_lock(&osd_mutex); pthread_mutex_lock (&gui->osd.mutex);
if (gui->osd.sinfo.visible) { if (gui->osd.sinfo.obj.visible) {
xine_osd_hide (gui->osd.sinfo.osd[0], 0); xine_osd_hide (gui->osd.sinfo.obj.osd[0], 0);
x = (wwidth - gui->osd.sinfo.w) - 40; x = (wwidth - gui->osd.sinfo.obj.w) - 40;
xine_osd_set_position (gui->osd.sinfo.osd[0], (x >= 0) ? x : 0, gui->osd.si xine_osd_set_position (gui->osd.sinfo.obj.osd[0], (x >= 0) ? x : 0, gui->os
nfo.y); d.sinfo.obj.y);
_xine_osd_show (gui, gui->osd.sinfo.osd[0], 0); _xine_osd_show (gui, gui->osd.sinfo.obj.osd[0], 0);
} }
if (gui->osd.bar.visible) { if (gui->osd.bar.obj.visible) {
xine_osd_hide (gui->osd.bar.osd[0], 0); xine_osd_hide (gui->osd.bar.obj.osd[0], 0);
xine_osd_hide (gui->osd.bar.osd[1], 0); xine_osd_hide (gui->osd.bar.obj.osd[1], 0);
x = (wwidth - BAR_WIDTH) >> 1; x = (wwidth - BAR_WIDTH) >> 1;
xine_osd_set_position (gui->osd.bar.osd[0], (x >= 0) ? x : 0, (wheight - BAR xine_osd_set_position (gui->osd.bar.obj.osd[0], (x >= 0) ? x : 0, (wheight -
_HEIGHT) - 40); BAR_HEIGHT) - 40);
xine_osd_set_position (gui->osd.bar.osd[1], (x >= 0) ? x : 0, (wheight - (BA xine_osd_set_position (gui->osd.bar.obj.osd[1], (x >= 0) ? x : 0, (wheight -
R_HEIGHT * 2)) - 40); (BAR_HEIGHT * 2)) - 40);
/* don't even bother drawing osd over those small streams. /* don't even bother drawing osd over those small streams.
* it would look pretty bad. * it would look pretty bad.
*/ */
if(wwidth > MINIMUM_WIN_WIDTH) { if (wwidth > MINIMUM_WIN_WIDTH) {
_xine_osd_show (gui, gui->osd.bar.osd[0], 0); _xine_osd_show (gui, gui->osd.bar.obj.osd[0], 0);
if (gui->osd.bar.have_text) if (gui->osd.bar.obj.have_text)
_xine_osd_show (gui, gui->osd.bar.osd[1], 0); _xine_osd_show (gui, gui->osd.bar.obj.osd[1], 0);
} }
} }
pthread_mutex_unlock(&osd_mutex); pthread_mutex_unlock (&gui->osd.mutex);
} }
 End of changes. 73 change blocks. 
294 lines changed or deleted 368 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)