Mercurial > mplayer.hg
comparison gui/interface.c @ 33530:7ced3616af42
Revise some messages.
Revise message levels, message types and texts, move some messages
at a more appropriate place and remove an unused message.
author | ib |
---|---|
date | Tue, 14 Jun 2011 23:05:02 +0000 |
parents | 276eef06fb3d |
children | 729826b857cf |
comparison
equal
deleted
inserted
replaced
33529:276eef06fb3d | 33530:7ced3616af42 |
---|---|
159 | 159 |
160 void guiInit(void) | 160 void guiInit(void) |
161 { | 161 { |
162 int i; | 162 int i; |
163 | 163 |
164 mp_msg(MSGT_GPLAYER, MSGL_V, "GUI init.\n"); | |
165 | |
164 memset(&guiIntfStruct, 0, sizeof(guiIntfStruct)); | 166 memset(&guiIntfStruct, 0, sizeof(guiIntfStruct)); |
165 guiIntfStruct.Balance = 50.0f; | 167 guiIntfStruct.Balance = 50.0f; |
166 guiIntfStruct.StreamType = -1; | 168 guiIntfStruct.StreamType = -1; |
167 | 169 |
168 memset(>kEquChannels, 0, sizeof(gtkEquChannels)); | 170 memset(>kEquChannels, 0, sizeof(gtkEquChannels)); |
198 // load skin | 200 // load skin |
199 | 201 |
200 skinDirInHome = get_path("skins"); | 202 skinDirInHome = get_path("skins"); |
201 skinMPlayerDir = MPLAYER_DATADIR "/skins"; | 203 skinMPlayerDir = MPLAYER_DATADIR "/skins"; |
202 | 204 |
203 mp_msg(MSGT_GPLAYER, MSGL_V, "SKIN dir 1: '%s'\n", skinDirInHome); | 205 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] skin directory #1: %s\n", skinDirInHome); |
204 mp_msg(MSGT_GPLAYER, MSGL_V, "SKIN dir 2: '%s'\n", skinMPlayerDir); | 206 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] skin directory #2: %s\n", skinMPlayerDir); |
205 | 207 |
206 if (!skinName) | 208 if (!skinName) |
207 skinName = strdup("default"); | 209 skinName = strdup("default"); |
208 | 210 |
209 i = skinRead(skinName); | 211 i = skinRead(skinName); |
267 i = wsShowFrame | wsMaxSize | wsHideWindow; | 269 i = wsShowFrame | wsMaxSize | wsHideWindow; |
268 wsCreateWindow(&appMPlayer.mainWindow, appMPlayer.main.x, appMPlayer.main.y, appMPlayer.main.width, appMPlayer.main.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, i, "MPlayer"); | 270 wsCreateWindow(&appMPlayer.mainWindow, appMPlayer.main.x, appMPlayer.main.y, appMPlayer.main.width, appMPlayer.main.height, wsNoBorder, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, i, "MPlayer"); |
269 wsSetShape(&appMPlayer.mainWindow, appMPlayer.main.Mask.Image); | 271 wsSetShape(&appMPlayer.mainWindow, appMPlayer.main.Mask.Image); |
270 wsXDNDMakeAwareness(&appMPlayer.mainWindow); | 272 wsXDNDMakeAwareness(&appMPlayer.mainWindow); |
271 | 273 |
272 #ifdef DEBUG | 274 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] screen depth: %d\n", wsDepthOnScreen); |
273 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[main] depth on screen: %d\n", wsDepthOnScreen); | 275 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] mainWindow ID: 0x%x\n", (int)appMPlayer.mainWindow.WindowID); |
274 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[main] parent: 0x%x\n", (int)appMPlayer.mainWindow.WindowID); | 276 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] subWindow ID: 0x%x\n", (int)appMPlayer.subWindow.WindowID); |
275 mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[main] sub: 0x%x\n", (int)appMPlayer.subWindow.WindowID); | |
276 #endif | |
277 | 277 |
278 appMPlayer.mainWindow.ReDraw = (void *)mplMainDraw; | 278 appMPlayer.mainWindow.ReDraw = (void *)mplMainDraw; |
279 appMPlayer.mainWindow.MouseHandler = mplMainMouseHandle; | 279 appMPlayer.mainWindow.MouseHandler = mplMainMouseHandle; |
280 appMPlayer.mainWindow.KeyHandler = mplMainKeyHandle; | 280 appMPlayer.mainWindow.KeyHandler = mplMainKeyHandle; |
281 appMPlayer.mainWindow.DandDHandler = mplDandDHandler; | 281 appMPlayer.mainWindow.DandDHandler = mplDandDHandler; |
382 void guiDone(void) | 382 void guiDone(void) |
383 { | 383 { |
384 if (initialized) { | 384 if (initialized) { |
385 mplMainRender = 0; | 385 mplMainRender = 0; |
386 | 386 |
387 mp_msg(MSGT_GPLAYER, MSGL_V, "[GUI] done.\n"); | |
388 | |
389 if (gui_save_pos) { | 387 if (gui_save_pos) { |
390 gui_main_pos_x = appMPlayer.mainWindow.X; | 388 gui_main_pos_x = appMPlayer.mainWindow.X; |
391 gui_main_pos_y = appMPlayer.mainWindow.Y; | 389 gui_main_pos_y = appMPlayer.mainWindow.Y; |
392 gui_sub_pos_x = appMPlayer.subWindow.X; | 390 gui_sub_pos_x = appMPlayer.subWindow.X; |
393 gui_sub_pos_y = appMPlayer.subWindow.Y; | 391 gui_sub_pos_y = appMPlayer.subWindow.Y; |
408 | 406 |
409 if (gui_conf) { | 407 if (gui_conf) { |
410 m_config_free(gui_conf); | 408 m_config_free(gui_conf); |
411 gui_conf = NULL; | 409 gui_conf = NULL; |
412 } | 410 } |
411 | |
412 mp_msg(MSGT_GPLAYER, MSGL_V, "GUI done.\n"); | |
413 } | 413 } |
414 | 414 |
415 void guiExit(enum exit_reason how) | 415 void guiExit(enum exit_reason how) |
416 { | 416 { |
417 exit_player_with_rc(how, how >= EXIT_ERROR); | 417 exit_player_with_rc(how, how >= EXIT_ERROR); |
448 | 448 |
449 if (font_name) { | 449 if (font_name) { |
450 vo_font = read_font_desc(font_name, font_factor, 0); | 450 vo_font = read_font_desc(font_name, font_factor, 0); |
451 | 451 |
452 if (!vo_font) | 452 if (!vo_font) |
453 mp_msg(MSGT_CPLAYER, MSGL_ERR, MSGTR_CantLoadFont, font_name); | 453 gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadFont, font_name); |
454 } else { | 454 } else { |
455 font_name = gstrdup(get_path("font/font.desc")); | 455 font_name = gstrdup(get_path("font/font.desc")); |
456 vo_font = read_font_desc(font_name, font_factor, 0); | 456 vo_font = read_font_desc(font_name, font_factor, 0); |
457 | 457 |
458 if (!vo_font) { | 458 if (!vo_font) { |
503 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_LoadingSubtitles, name); | 503 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_LoadingSubtitles, name); |
504 | 504 |
505 subdata = sub_read_file(name, guiIntfStruct.FPS); | 505 subdata = sub_read_file(name, guiIntfStruct.FPS); |
506 | 506 |
507 if (!subdata) | 507 if (!subdata) |
508 mp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadSub, name); | 508 gmp_msg(MSGT_GPLAYER, MSGL_ERR, MSGTR_CantLoadSub, name); |
509 | 509 |
510 sub_name = (malloc(2 * sizeof(char *))); // when mplayer will be restarted | 510 sub_name = (malloc(2 * sizeof(char *))); // when mplayer will be restarted |
511 sub_name[0] = strdup(name); // sub_name[0] will be read | 511 sub_name[0] = strdup(name); // sub_name[0] will be read |
512 sub_name[1] = NULL; | 512 sub_name[1] = NULL; |
513 } | 513 } |
545 vf_settings[0].name = strdup(str); | 545 vf_settings[0].name = strdup(str); |
546 vf_settings[0].attribs = NULL; | 546 vf_settings[0].attribs = NULL; |
547 vf_settings[1].name = NULL; | 547 vf_settings[1].name = NULL; |
548 } | 548 } |
549 | 549 |
550 mp_msg(MSGT_GPLAYER, MSGL_STATUS, MSGTR_AddingVideoFilter, str); | 550 mp_msg(MSGT_GPLAYER, MSGL_INFO, MSGTR_AddingVideoFilter, str); |
551 } | 551 } |
552 | 552 |
553 int guiGetEvent(int type, void *arg) | 553 int guiGetEvent(int type, void *arg) |
554 { | 554 { |
555 mixer_t *mixer = NULL; | 555 mixer_t *mixer = NULL; |
680 | 680 |
681 break; | 681 break; |
682 | 682 |
683 case guiIEvent: | 683 case guiIEvent: |
684 | 684 |
685 mp_msg(MSGT_GPLAYER, MSGL_V, "cmd: %d\n", (int)arg); | 685 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] guiIEvent: %d\n", (int)arg); |
686 | 686 |
687 switch ((int)arg) { | 687 switch ((int)arg) { |
688 case MP_CMD_QUIT: | 688 case MP_CMD_QUIT: |
689 mplEventHandling(evExit, 0); | 689 mplEventHandling(evExit, 0); |
690 break; | 690 break; |
1383 if (strlen(pathname) - strlen(filename) > 0) | 1383 if (strlen(pathname) - strlen(filename) > 0) |
1384 pathname[strlen(pathname) - strlen(filename) - 1] = 0; // we have some path, so remove / at end | 1384 pathname[strlen(pathname) - strlen(filename) - 1] = 0; // we have some path, so remove / at end |
1385 else | 1385 else |
1386 pathname[strlen(pathname) - strlen(filename)] = 0; | 1386 pathname[strlen(pathname) - strlen(filename)] = 0; |
1387 | 1387 |
1388 // NOTE TO MYSELF: FIXME: Change to MSGL_DBG2? | 1388 mp_dbg(MSGT_GPLAYER, MSGL_DBG2, "[interface] playtree, add: %s/%s\n", pathname, filename); |
1389 mp_msg(MSGT_PLAYTREE, MSGL_V, "Adding filename %s && pathname %s\n", filename, pathname); | |
1390 | 1389 |
1391 item = calloc(1, sizeof(plItem)); | 1390 item = calloc(1, sizeof(plItem)); |
1392 | 1391 |
1393 if (!item) | 1392 if (!item) |
1394 return 0; | 1393 return 0; |