414
285
mp_msg(MSGT_GPLAYER, MSGL_V, "GUI done.\n");
417
void guiExit(enum exit_reason how)
419
exit_player_with_rc(how, how >= EXIT_ERROR);
422
void guiLoadFont(void)
424
#ifdef CONFIG_FREETYPE
425
load_font_ft(vo_image_width, vo_image_height, &vo_font, font_name, osd_font_scale_factor);
431
free(vo_font->fpath);
433
for (i = 0; i < 16; i++) {
434
if (vo_font->pic_a[i]) {
435
free(vo_font->pic_a[i]->bmp);
436
free(vo_font->pic_a[i]->pal);
440
for (i = 0; i < 16; i++) {
441
if (vo_font->pic_b[i]) {
442
free(vo_font->pic_b[i]->bmp);
443
free(vo_font->pic_b[i]->pal);
452
vo_font = read_font_desc(font_name, font_factor, 0);
455
gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadFont, font_name);
457
font_name = gstrdup(get_path("font/font.desc"));
458
vo_font = read_font_desc(font_name, font_factor, 0);
461
gfree((void **)&font_name);
462
font_name = gstrdup(MPLAYER_DATADIR "/font/font.desc");
463
vo_font = read_font_desc(font_name, font_factor, 0);
469
void guiLoadSubtitle(char *name)
471
if (guiInfo.Playing == 0) {
472
guiInfo.SubtitleChanged = 1; // what is this for? (mw)
477
mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_DeletingSubtitles);
490
if (osd->type == OSDTYPE_SUBTITLE)
496
if (osd && (osd->flags & OSDFLAG_VISIBLE)) {
497
len = osd->stride * (osd->bbox.y2 - osd->bbox.y1);
498
memset(osd->bitmap_buffer, 0, len);
499
memset(osd->alpha_buffer, 0, len);
505
mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_LoadingSubtitles, name);
507
subdata = sub_read_file(name, guiInfo.FPS);
510
gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadSub, name);
512
sub_name = (malloc(2 * sizeof(char *))); // when mplayer will be restarted
513
sub_name[0] = strdup(name); // sub_name[0] will be read
517
update_set_of_subtitles();
520
288
static void add_vf(char *str)
552
320
mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_AddingVideoFilter, str);
555
int guiGetEvent(int type, void *arg)
323
int gui(int what, void *data)
557
325
mixer_t *mixer = NULL;
559
stream_t *stream = arg;
561
327
#ifdef CONFIG_DVDREAD
562
dvd_priv_t *dvdp = arg;
565
333
if (guiInfo.mpcontext)
566
334
mixer = mpctx_get_mixer(guiInfo.mpcontext);
570
guiInfo.event_struct = arg;
571
wsEvents(wsDisplay, arg);
337
case GUI_SET_CONTEXT:
338
guiInfo.mpcontext = data;
579
346
// if ( !gtkShowVideoWindow ) wsVisibleWindow( &guiApp.subWindow,wsHideWindow );
580
guiInfo.Playing = GUI_PLAY;
584
// if ( !gtkShowVideoWindow ) wsVisibleWindow( &guiApp.subWindow,wsHideWindow );
585
guiInfo.Playing = GUI_STOP;
589
guiInfo.Playing = GUI_PAUSE;
348
guiInfo.Playing = (int)data;
598
guiSetFilename(guiInfo.Filename, arg);
601
case guiSetAudioOnly:
603
guiInfo.AudioOnly = (int)arg;
606
guiInfo.NoWindow = True;
607
wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
609
wsVisibleWindow(&guiApp.subWindow, wsShowWindow);
614
guiInfo.mpcontext = arg;
615
// NOTE TO MYSELF: is break missing?
618
guiInfo.demuxer = arg;
622
guiInfo.afilter = arg;
627
if (!guiApp.subWindow.isFullScreen) {
628
wsResizeWindow(&guiApp.subWindow, vo_dwidth, vo_dheight);
629
wsMoveWindow(&guiApp.subWindow, True, guiApp.sub.x, guiApp.sub.y);
632
guiInfo.MovieWidth = vo_dwidth;
633
guiInfo.MovieHeight = vo_dheight;
636
wsMoveWindow(&guiApp.mainWindow, 0, 0, vo_dheight);
638
WinID = guiApp.subWindow.WindowID;
641
#ifdef CONFIG_DVDREAD
643
guiInfo.DVD.titles = dvdp->vmg_file->tt_srpt->nr_of_srpts;
644
guiInfo.DVD.chapters = dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts;
645
guiInfo.DVD.angles = dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_angles;
646
guiInfo.DVD.nr_of_audio_channels = dvdp->nr_of_channels;
647
memcpy(guiInfo.DVD.audio_streams, dvdp->audio_streams, sizeof(dvdp->audio_streams));
648
guiInfo.DVD.nr_of_subtitles = dvdp->nr_of_subtitles;
649
memcpy(guiInfo.DVD.subtitles, dvdp->subtitles, sizeof(dvdp->subtitles));
650
guiInfo.DVD.current_title = dvd_title + 1;
651
guiInfo.DVD.current_chapter = dvd_chapter + 1;
652
guiInfo.DVD.current_angle = dvd_angle + 1;
653
guiInfo.Track = dvd_title + 1;
659
guiInfo.StreamType = stream->type;
661
switch (stream->type) {
662
#ifdef CONFIG_DVDREAD
664
guiGetEvent(guiSetDVD, stream->priv);
670
guiInfo.VCDTracks = 0;
671
stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.VCDTracks);
683
mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] guiIEvent: %d\n", (int)arg);
355
case GUI_HANDLE_EVENTS:
356
if (!guiInfo.Playing || !guiInfo.VideoWindow)
362
case GUI_RUN_COMMAND:
364
mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] GUI_RUN_COMMAND: %d\n", (int)data);
367
case MP_CMD_VO_FULLSCREEN:
368
uiEventHandling(evFullScreen, 0);
371
case MP_CMD_PLAY_TREE_STEP:
372
uiEventHandling(evNext, 0);
375
case -MP_CMD_PLAY_TREE_STEP:
376
uiEventHandling(evPrev, 0);
380
uiEventHandling(evStop, 0);
686
383
case MP_CMD_QUIT:
687
384
uiEventHandling(evExit, 0);
690
case MP_CMD_VO_FULLSCREEN:
691
uiEventHandling(evFullScreen, 0);
698
uiEventHandling(evRedraw, 0);
705
mixer_getvolume(mixer, &l, &r);
706
guiInfo.Volume = (r > l ? r : l);
709
guiInfo.Balance = ((r - l) + 100) * 0.5f;
711
guiInfo.Balance = 50.0f;
713
btnModify(evSetVolume, guiInfo.Volume);
714
btnModify(evSetBalance, guiInfo.Balance);
718
case guiSetFileFormat:
719
guiInfo.FileFormat = (int)arg;
726
guiInfo.sh_video = arg;
729
sh_video_t *sh = arg;
730
guiInfo.FPS = sh->fps;
733
if (guiInfo.NoWindow)
734
wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
736
if (guiInfo.StreamType == STREAMTYPE_STREAM)
737
btnSet(evSetMoviePosition, btnDisabled);
739
btnSet(evSetMoviePosition, btnReleased);
746
mixer_getvolume(mixer, &l, &r);
747
guiInfo.Volume = (r > l ? r : l);
750
guiInfo.Balance = ((r - l) + 100) * 0.5f;
752
guiInfo.Balance = 50.0f;
754
btnModify(evSetVolume, guiInfo.Volume);
755
btnModify(evSetBalance, guiInfo.Balance);
758
if (gtkEnableAudioEqualizer) {
762
for (i = 0; i < 6; i++) {
763
for (j = 0; j < 10; j++) {
766
eq.gain = gtkEquChannels[i][j];
767
gtkSet(gtkSetEqualizer, 0, &eq);
775
if (video_driver_list && !gstrcmp(video_driver_list[0], "dxr3") && (guiInfo.FileFormat != DEMUXER_TYPE_MPEG_PS) && !gtkVfLAVC) {
776
gtkMessageBox(GTK_MB_FATAL, MSGTR_NEEDLAVC);
786
// if ( guiInfo.Playing == 1 && guiInfo.FilenameChanged )
787
if (guiInfo.FilenameChanged) {
390
case GUI_RUN_MESSAGE:
391
mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] GUI_RUN_MESSAGE: %s\n", (const char *)data);
392
msg = appFindMessage((const char *)data);
393
if (appFindItem(msg))
394
uiEventHandling(msg, 0);
399
wsVisibleMouse(&guiApp.subWindow, wsHideMouseCursor);
401
if (guiInfo.NewPlay == GUI_FILE_NEW) {
792
408
stream_cache_size = -1;
798
guiInfo.demuxer = NULL;
799
guiInfo.sh_video = NULL;
800
wsPostRedisplay(&guiApp.subWindow);
804
case guiSetParameters:
806
guiGetEvent(guiSetDefaults, NULL);
808
413
switch (guiInfo.StreamType) {
809
case STREAMTYPE_PLAYLIST:
414
case STREAMTYPE_FILE:
415
case STREAMTYPE_STREAM:
419
case STREAMTYPE_CDDA:
423
sprintf(tmp, "cdda://%d", guiInfo.Track);
424
uiSetFileName(NULL, tmp, SAME_STREAMTYPE);
812
429
#ifdef CONFIG_VCD
813
430
case STREAMTYPE_VCD:
817
sprintf(tmp, "vcd://%d", guiInfo.Track + 1);
818
guiSetFilename(guiInfo.Filename, tmp);
434
sprintf(tmp, "vcd://%d", guiInfo.Track);
435
uiSetFileName(NULL, tmp, SAME_STREAMTYPE);
1021
void guiEventHandling(void)
1023
if (!guiInfo.Playing || guiInfo.NoWindow)
1030
#if defined(MP_DEBUG) && 0
1033
plItem *next = plList;
1035
printf("--- list ---\n");
1037
while (next || next->next) {
1038
printf("item: %s/%s\n", next->path, next->name);
1046
printf("--- end of list ---\n");
1052
void *gtkSet(int cmd, float fparam, void *vparam)
1054
equalizer_t *eq = (equalizer_t *)vparam;
1055
plItem *item = (plItem *)vparam;
1056
urlItem *url_item = (urlItem *)vparam;
1057
int is_added = True;
1062
// add item to playlist
1066
plItem *next = plList;
1070
// printf( "%s\n",next->name );
1078
item->prev = item->next = NULL;
1079
plCurrent = plList = item;
1086
// add item into playlist after current
1087
case gtkInsertPlItem:
1089
plItem *curr = plCurrent;
1090
item->next = curr->next;
1093
item->next->prev = item;
1097
plCurrent = plCurrent->next;
1101
return gtkSet(gtkAddPlItem, 0, (void *)item);
1102
return NULL; // NOTE TO MYSELF: remove this
1104
// get next item from playlist
1105
case gtkGetNextPlItem:
1106
if (plCurrent && plCurrent->next) {
1107
plCurrent = plCurrent->next;
1108
// if (!plCurrent && plList)
1110
// plItem *next = plList;
1112
// while (next->next)
1114
// if (!next->next) break;
1115
// next = next->next;
1118
// plCurrent = next;
1125
// get previous item from playlist
1126
case gtkGetPrevPlItem:
1127
if (plCurrent && plCurrent->prev) {
1128
plCurrent = plCurrent->prev;
1129
// if ( !plCurrent && plList ) plCurrent=plList;
1136
case gtkSetCurrPlItem:
1141
case gtkGetCurrPlItem:
1144
// delete current item
1145
case gtkDelCurrPlItem:
1147
plItem *curr = plCurrent;
1153
curr->prev->next = curr->next;
1155
curr->next->prev = curr->prev;
1157
plList = curr->next;
1159
plCurrent = curr->next;
1167
uiCurr(); // instead of using uiNext && uiPrev
1174
plItem *curr = plList;
1185
while (curr->next) {
1203
urlItem *next_url = URLList;
1206
while (next_url->next) {
1207
if (!gstrcmp(next_url->url, url_item->url)) {
1212
next_url = next_url->next;
1215
if (!is_added && gstrcmp(next_url->url, url_item->url))
1216
next_url->next = url_item;
1218
url_item->next = NULL;
1226
#ifndef CONFIG_FREETYPE
1227
case gtkSetFontFactor:
1228
font_factor = fparam;
1232
case gtkSetFontOutLine:
1233
subtitle_font_thickness = (8.0f / 100.0f) * fparam;
1237
case gtkSetFontBlur:
1238
subtitle_font_radius = (8.0f / 100.0f) * fparam;
1242
case gtkSetFontTextScale:
1243
text_font_scale_factor = fparam;
1247
case gtkSetFontOSDScale:
1248
osd_font_scale_factor = fparam;
1252
case gtkSetFontEncoding:
1253
gfree((void **)&subtitle_font_encoding);
1254
subtitle_font_encoding = gstrdup((char *)vparam);
1258
case gtkSetFontAutoScale:
1259
subtitle_autoscale = (int)fparam;
1265
case gtkSetSubEncoding:
1266
gfree((void **)&sub_cp);
1267
sub_cp = gstrdup((char *)vparam);
1273
case gtkClearStruct:
1275
if ((unsigned int)vparam & guiFilenames) {
1276
gfree((void **)&guiInfo.Filename);
1277
gfree((void **)&guiInfo.Subtitlename);
1278
gfree((void **)&guiInfo.AudioFile);
1279
gtkSet(gtkDelPl, 0, NULL);
1282
#ifdef CONFIG_DVDREAD
1283
if ((unsigned int)vparam & guiDVD)
1284
memset(&guiInfo.DVD, 0, sizeof(guiDVDStruct));
627
guiInfo.StreamType = stream->type;
629
switch (guiInfo.StreamType) {
630
case STREAMTYPE_FILE:
631
case STREAMTYPE_STREAM:
635
case STREAMTYPE_CDDA:
637
stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks);
1287
641
#ifdef CONFIG_VCD
1288
if ((unsigned int)vparam & guiVCD)
1289
guiInfo.VCDTracks = 0;
1294
case gtkSetExtraStereo:
1295
gtkAOExtraStereoMul = fparam;
1296
if (guiInfo.afilter)
1297
af_control_any_rev(guiInfo.afilter, AF_CONTROL_ES_MUL | AF_CONTROL_SET, >kAOExtraStereoMul);
1304
mp_cmd = calloc(1, sizeof(*mp_cmd));
1305
mp_cmd->id = MP_CMD_PANSCAN;
1306
mp_cmd->name = strdup("panscan");
1307
mp_cmd->args[0].v.f = fparam;
1308
mp_cmd->args[1].v.i = 1;
1309
mp_input_queue_cmd(mp_cmd);
1315
auto_quality = (int)fparam;
1320
case gtkSetContrast:
1321
if (guiInfo.sh_video)
1322
set_video_colors(guiInfo.sh_video, "contrast", (int)fparam);
1325
case gtkSetBrightness:
1326
if (guiInfo.sh_video)
1327
set_video_colors(guiInfo.sh_video, "brightness", (int)fparam);
1331
if (guiInfo.sh_video)
1332
set_video_colors(guiInfo.sh_video, "hue", (int)fparam);
1335
case gtkSetSaturation:
1336
if (guiInfo.sh_video)
1337
set_video_colors(guiInfo.sh_video, "saturation", (int)fparam);
1340
case gtkSetEqualizer:
1342
af_control_ext_t tmp;
1345
gtkEquChannels[eq->channel][eq->band] = eq->gain;
1346
tmp.ch = eq->channel;
1347
tmp.arg = gtkEquChannels[eq->channel];
1349
if (guiInfo.afilter)
1350
af_control_any_rev(guiInfo.afilter, AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_SET, &tmp);
644
stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks);
648
#ifdef CONFIG_DVDREAD
651
stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks);
652
guiInfo.Chapters = 0;
653
stream_control(stream, STREAM_CTRL_GET_NUM_CHAPTERS, &guiInfo.Chapters);
655
stream_control(stream, STREAM_CTRL_GET_NUM_ANGLES, &guiInfo.Angles);
657
guiInfo.AudioStreams = dvd->nr_of_channels;
658
memcpy(guiInfo.AudioStream, dvd->audio_streams, sizeof(dvd->audio_streams));
659
guiInfo.Subtitles = dvd->nr_of_subtitles;
660
memcpy(guiInfo.Subtitle, dvd->subtitles, sizeof(dvd->subtitles));
661
guiInfo.Track = dvd_title + 1;
662
guiInfo.Chapter = dvd_chapter + 1;
663
guiInfo.Angle = dvd_angle + 1;
670
case GUI_SET_AFILTER:
671
guiInfo.afilter = data;
678
guiInfo.sh_video = data;
680
state = (guiInfo.StreamType == STREAMTYPE_STREAM ? btnDisabled : btnReleased);
681
btnSet(evForward10sec, state);
682
btnSet(evBackward10sec, state);
683
btnSet(evForward1min, state);
684
btnSet(evBackward1min, state);
685
btnSet(evForward10min, state);
686
btnSet(evBackward10min, state);
687
btnSet(evSetMoviePosition, state);
690
if (video_driver_list && !gstrcmp(video_driver_list[0], "dxr3") && (((demuxer_t *)mpctx_get_demuxer(guiInfo.mpcontext))->file_format != DEMUXER_TYPE_MPEG_PS) && !gtkVfLAVC) {
691
gtkMessageBox(GTK_MB_FATAL, MSGTR_NEEDLAVC);
700
guiInfo.AudioChannels = data ? ((sh_audio_t *)data)->channels : 0;
702
if (data && !guiInfo.sh_video)
703
guiInfo.VideoWindow = False;
705
gui(GUI_SET_MIXER, 0);
707
if (gtkEnableAudioEqualizer) {
711
for (i = 0; i < FF_ARRAY_ELEMS(gtkEquChannels); i++) {
712
for (j = 0; j < FF_ARRAY_ELEMS(*gtkEquChannels); j++) {
715
eq.gain = gtkEquChannels[i][j];
716
mplayer(MPLAYER_SET_EQUALIZER, 0, &eq);
721
// These must be done here (in the last call from MPlayer before
722
// playback starts) and not in GUI_SETUP_VIDEO_WINDOW, because...
724
// ...without video there will be no call to GUI_SETUP_VIDEO_WINDOW
725
if (!guiInfo.VideoWindow) {
726
wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
727
btnSet(evFullScreen, (gtkLoadFullscreen ? btnPressed : btnReleased));
730
// ...option variable fullscreen determines whether MPlayer will handle
731
// the window given by WinID as fullscreen window (and will do aspect
732
// scaling then) or not - quite rubbish
733
fullscreen = gtkLoadFullscreen;
740
static float last_balance = -1;
742
mixer_getvolume(mixer, &l, &r);
744
guiInfo.Volume = FFMAX(l, r);
745
btnModify(evSetVolume, guiInfo.Volume);
747
if (guiInfo.Balance != last_balance) {
749
guiInfo.Balance = ((r - l) / guiInfo.Volume + 1.0) * 50.0;
751
guiInfo.Balance = 50.0f;
753
last_balance = guiInfo.Balance;
754
btnModify(evSetBalance, guiInfo.Balance);
760
uiEventHandling(ivRedraw, 0);
763
case GUI_SETUP_VIDEO_WINDOW:
765
guiInfo.VideoWidth = vo_dwidth;
766
guiInfo.VideoHeight = vo_dheight;
768
if (!guiApp.subWindow.isFullScreen || !guiApp.subWindow.Mapped) {
769
if (!guiApp.subWindow.isFullScreen)
770
wsResizeWindow(&guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight);
772
wsMoveWindow(&guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y);
774
if (!guiApp.subWindow.Mapped)
775
wsVisibleWindow(&guiApp.subWindow, wsShowWindow);
778
if (gtkLoadFullscreen ^ guiApp.subWindow.isFullScreen)
779
uiEventHandling(evFullScreen, 0);
782
wsMoveWindow(&guiApp.mainWindow, True, 0, guiInfo.VideoHeight);
786
case GUI_HANDLE_X_EVENT:
787
wsEvents(wsDisplay, data);
793
uiEventHandling(ivRedraw, 1);
795
guiInfo.sh_video = NULL;
797
if (!uiGotoTheNext && guiInfo.Playing) {
803
if (guiInfo.StreamType == STREAMTYPE_CDDA) {
811
if (guiInfo.Playing && (next = listSet(gtkGetNextPlItem, NULL)) && (plLastPlayed != next)) {
813
uiSetFileName(next->path, next->name, STREAMTYPE_FILE);
814
guiInfo.NewPlay = GUI_FILE_NEW;
1354
memset(gtkEquChannels, 0, sizeof(gtkEquChannels));
1356
if (guiInfo.afilter) {
1357
for (i = 0; i < 6; i++) {
1359
tmp.arg = gtkEquChannels[i];
1360
af_control_any_rev(guiInfo.afilter, AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_SET, &tmp);
817
if (guiInfo.NewPlay == GUI_FILE_NEW)
822
guiInfo.ElapsedTime = 0;
823
guiInfo.Position = 0;
824
guiInfo.AudioChannels = 0;
826
#ifdef CONFIG_DVDREAD
832
if (gtkShowVideoWindow) {
833
guiInfo.VideoWindow = True;
834
guiInfo.VideoWidth = guiApp.sub.width;
835
guiInfo.VideoHeight = guiApp.sub.height;
837
if (!guiApp.subWindow.isFullScreen) {
838
wsResizeWindow(&guiApp.subWindow, guiInfo.VideoWidth, guiInfo.VideoHeight);
839
wsMoveWindow(&guiApp.subWindow, False, guiApp.sub.x, guiApp.sub.y);
842
if (!guiApp.subWindow.Mapped)
843
wsVisibleWindow(&guiApp.subWindow, wsShowWindow);
845
if (gtkLoadFullscreen ^ guiApp.subWindow.isFullScreen)
846
uiEventHandling(evFullScreen, 0);
848
wsVisibleWindow(&guiApp.subWindow, wsHideWindow);
849
guiInfo.VideoWindow = False;
850
btnSet(evFullScreen, (gtkLoadFullscreen ? btnPressed : btnReleased));
853
gui(GUI_SET_STATE, (void *)GUI_STOP);
857
wsSetBackgroundRGB(&guiApp.subWindow, guiApp.sub.R, guiApp.sub.G, guiApp.sub.B);
858
wsClearWindow(guiApp.subWindow);
859
wsPostRedisplay(&guiApp.subWindow);
860
wsVisibleMouse(&guiApp.subWindow, wsShowMouseCursor);
1372
869
// This function adds/inserts one file into the gui playlist.
1457
gtkSet(gtkSetCurrPlItem, 0, (void *)save);
952
listSet(gtkSetCurrPlItem, save);
1459
gtkSet(gtkSetCurrPlItem, 0, (void *)plList); // go to head, if plList was empty before
954
listSet(gtkSetCurrPlItem, plList); // go to head, if plList was empty before
1461
956
if (save && result)
1462
gtkSet(gtkDelCurrPlItem, 0, 0);
957
listSet(gtkDelCurrPlItem, NULL);
1464
959
uiCurr(); // update filename
966
void mplayer(int what, float value, void *data)
968
equalizer_t *eq = (equalizer_t *)data;
973
#ifndef CONFIG_FREETYPE
974
case MPLAYER_SET_FONT_FACTOR:
979
case MPLAYER_SET_FONT_OUTLINE:
980
subtitle_font_thickness = (8.0f / 100.0f) * value;
984
case MPLAYER_SET_FONT_BLUR:
985
subtitle_font_radius = (8.0f / 100.0f) * value;
989
case MPLAYER_SET_FONT_TEXTSCALE:
990
text_font_scale_factor = value;
994
case MPLAYER_SET_FONT_OSDSCALE:
995
osd_font_scale_factor = value;
999
case MPLAYER_SET_FONT_ENCODING:
1000
nfree(subtitle_font_encoding);
1001
subtitle_font_encoding = gstrdup((char *)data);
1005
case MPLAYER_SET_FONT_AUTOSCALE:
1006
subtitle_autoscale = (int)value;
1012
case MPLAYER_SET_SUB_ENCODING:
1014
sub_cp = gstrdup((char *)data);
1018
case MPLAYER_SET_EXTRA_STEREO:
1019
gtkAOExtraStereoMul = value;
1020
if (guiInfo.afilter)
1021
af_control_any_rev(guiInfo.afilter, AF_CONTROL_ES_MUL | AF_CONTROL_SET, >kAOExtraStereoMul);
1024
case MPLAYER_SET_PANSCAN:
1028
mp_cmd = calloc(1, sizeof(*mp_cmd));
1029
mp_cmd->id = MP_CMD_PANSCAN;
1030
mp_cmd->name = strdup("panscan");
1031
mp_cmd->args[0].v.f = value;
1032
mp_cmd->args[1].v.i = 1;
1033
mp_input_queue_cmd(mp_cmd);
1037
case MPLAYER_SET_AUTO_QUALITY:
1038
auto_quality = (int)value;
1043
case MPLAYER_SET_CONTRAST:
1044
if (guiInfo.sh_video)
1045
set_video_colors(guiInfo.sh_video, "contrast", (int)value);
1048
case MPLAYER_SET_BRIGHTNESS:
1049
if (guiInfo.sh_video)
1050
set_video_colors(guiInfo.sh_video, "brightness", (int)value);
1053
case MPLAYER_SET_HUE:
1054
if (guiInfo.sh_video)
1055
set_video_colors(guiInfo.sh_video, "hue", (int)value);
1058
case MPLAYER_SET_SATURATION:
1059
if (guiInfo.sh_video)
1060
set_video_colors(guiInfo.sh_video, "saturation", (int)value);
1063
case MPLAYER_SET_EQUALIZER:
1065
af_control_ext_t tmp;
1068
gtkEquChannels[eq->channel][eq->band] = eq->gain;
1069
tmp.ch = eq->channel;
1070
tmp.arg = gtkEquChannels[eq->channel];
1072
if (guiInfo.afilter)
1073
af_control_any_rev(guiInfo.afilter, AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_SET, &tmp);
1077
memset(gtkEquChannels, 0, sizeof(gtkEquChannels));
1079
if (guiInfo.afilter) {
1080
for (i = 0; i < FF_ARRAY_ELEMS(gtkEquChannels); i++) {
1082
tmp.arg = gtkEquChannels[i];
1083
af_control_any_rev(guiInfo.afilter, AF_CONTROL_EQUALIZER_GAIN | AF_CONTROL_SET, &tmp);
1091
case MPLAYER_EXIT_GUI:
1092
exit_player_with_rc((enum exit_reason)value, (enum exit_reason)value >= EXIT_ERROR);
1097
void mplayerLoadFont(void)
1099
#ifdef CONFIG_FREETYPE
1100
load_font_ft(vo_image_width, vo_image_height, &vo_font, font_name, osd_font_scale_factor);
1105
free(vo_font->name);
1106
free(vo_font->fpath);
1108
for (i = 0; i < 16; i++) {
1109
if (vo_font->pic_a[i]) {
1110
free(vo_font->pic_a[i]->bmp);
1111
free(vo_font->pic_a[i]->pal);
1115
for (i = 0; i < 16; i++) {
1116
if (vo_font->pic_b[i]) {
1117
free(vo_font->pic_b[i]->bmp);
1118
free(vo_font->pic_b[i]->pal);
1127
vo_font = read_font_desc(font_name, font_factor, 0);
1130
gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadFont, font_name);
1132
font_name = gstrdup(get_path("font/font.desc"));
1133
vo_font = read_font_desc(font_name, font_factor, 0);
1137
font_name = gstrdup(MPLAYER_DATADIR "/font/font.desc");
1138
vo_font = read_font_desc(font_name, font_factor, 0);
1144
void mplayerLoadSubtitle(const char *name)
1146
if (guiInfo.Playing == 0)
1150
mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_DeletingSubtitles);
1163
if (osd->type == OSDTYPE_SUBTITLE)
1169
if (osd && (osd->flags & OSDFLAG_VISIBLE)) {
1170
len = osd->stride * (osd->bbox.y2 - osd->bbox.y1);
1171
memset(osd->bitmap_buffer, 0, len);
1172
memset(osd->alpha_buffer, 0, len);
1178
mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_LoadingSubtitles, name);
1180
subdata = sub_read_file(name, (guiInfo.sh_video ? guiInfo.sh_video->fps : 0));
1183
gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadSub, name);
1185
sub_name = (malloc(2 * sizeof(char *))); // when mplayer will be restarted
1186
sub_name[0] = strdup(name); // sub_name[0] will be read
1190
update_set_of_subtitles();
1470
1193
// NOTE TO MYSELF: This function is nonsense.
1471
1194
// MPlayer should pass messages to the GUI
1472
1195
// which must decide then which message has