comparison gui/interface.c @ 34610:4ff933a89818

Cosmetic: Rename functions in list.c. Additionally, change a parameter name of new listMgr() and add some doxygen comments to list.h.
author ib
date Sun, 12 Feb 2012 18:44:19 +0000
parents 19398061c204
children 5d6367c875c2
comparison
equal deleted inserted replaced
34609:a8497c26c9f1 34610:4ff933a89818
266 cfg_write(); 266 cfg_write();
267 wsXDone(); 267 wsXDone();
268 } 268 }
269 269
270 appFreeStruct(); 270 appFreeStruct();
271 listSet(gtkDelPl, NULL); 271 listMgr(gtkDelPl, NULL);
272 listSet(gtkDelURL, NULL); 272 listMgr(gtkDelURL, NULL);
273 free(guiIcon.collection); 273 free(guiIcon.collection);
274 274
275 if (gui_conf) { 275 if (gui_conf) {
276 m_config_free(gui_conf); 276 m_config_free(gui_conf);
277 gui_conf = NULL; 277 gui_conf = NULL;
447 if (!video_driver_list) { 447 if (!video_driver_list) {
448 int i = 0; 448 int i = 0;
449 449
450 while (video_out_drivers[i++]) { 450 while (video_out_drivers[i++]) {
451 if (video_out_drivers[i - 1]->control(VOCTRL_GUISUPPORT, NULL) == VO_TRUE) { 451 if (video_out_drivers[i - 1]->control(VOCTRL_GUISUPPORT, NULL) == VO_TRUE) {
452 gaddlist(&video_driver_list, (char *)video_out_drivers[i - 1]->info->short_name); 452 listSet(&video_driver_list, (char *)video_out_drivers[i - 1]->info->short_name);
453 break; 453 break;
454 } 454 }
455 } 455 }
456 } 456 }
457 457
485 485
486 // audio opts 486 // audio opts
487 487
488 // if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; } 488 // if ( ao_plugin_cfg.plugin_list ) { free( ao_plugin_cfg.plugin_list ); ao_plugin_cfg.plugin_list=NULL; }
489 if (gtkAONorm) 489 if (gtkAONorm)
490 greplace(&af_cfg.list, "volnorm", "volnorm"); 490 listRepl(&af_cfg.list, "volnorm", "volnorm");
491 491
492 if (gtkEnableAudioEqualizer) 492 if (gtkEnableAudioEqualizer)
493 greplace(&af_cfg.list, "equalizer", "equalizer"); 493 listRepl(&af_cfg.list, "equalizer", "equalizer");
494 494
495 if (gtkAOExtraStereo) { 495 if (gtkAOExtraStereo) {
496 char *name; 496 char *name;
497 497
498 name = malloc(12 + 20 + 1); 498 name = malloc(12 + 20 + 1);
499 snprintf(name, 12 + 20, "extrastereo=%f", gtkAOExtraStereoMul); 499 snprintf(name, 12 + 20, "extrastereo=%f", gtkAOExtraStereoMul);
500 name[12 + 20] = 0; 500 name[12 + 20] = 0;
501 greplace(&af_cfg.list, "extrastereo", name); 501 listRepl(&af_cfg.list, "extrastereo", name);
502 free(name); 502 free(name);
503 } 503 }
504 504
505 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "oss", 3)) { 505 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "oss", 3)) {
506 char *tmp; 506 char *tmp;
512 tmp = calloc(1, strlen(gtkAOOSSDevice) + 7); 512 tmp = calloc(1, strlen(gtkAOOSSDevice) + 7);
513 sprintf(tmp, "oss:%s", gtkAOOSSDevice); 513 sprintf(tmp, "oss:%s", gtkAOOSSDevice);
514 } else 514 } else
515 tmp = strdup("oss"); 515 tmp = strdup("oss");
516 516
517 gaddlist(&audio_driver_list, tmp); 517 listSet(&audio_driver_list, tmp);
518 free(tmp); 518 free(tmp);
519 } 519 }
520 520
521 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "alsa", 4)) { 521 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "alsa", 4)) {
522 char *tmp; 522 char *tmp;
528 tmp = calloc(1, strlen(gtkAOALSADevice) + 14); 528 tmp = calloc(1, strlen(gtkAOALSADevice) + 14);
529 sprintf(tmp, "alsa:device=%s", gtkAOALSADevice); 529 sprintf(tmp, "alsa:device=%s", gtkAOALSADevice);
530 } else 530 } else
531 tmp = strdup("alsa"); 531 tmp = strdup("alsa");
532 532
533 gaddlist(&audio_driver_list, tmp); 533 listSet(&audio_driver_list, tmp);
534 free(tmp); 534 free(tmp);
535 } 535 }
536 536
537 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "sdl", 3)) { 537 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "sdl", 3)) {
538 char *tmp; 538 char *tmp;
541 tmp = calloc(1, strlen(gtkAOSDLDriver) + 10); 541 tmp = calloc(1, strlen(gtkAOSDLDriver) + 10);
542 sprintf(tmp, "sdl:%s", gtkAOSDLDriver); 542 sprintf(tmp, "sdl:%s", gtkAOSDLDriver);
543 } else 543 } else
544 tmp = strdup("sdl"); 544 tmp = strdup("sdl");
545 545
546 gaddlist(&audio_driver_list, tmp); 546 listSet(&audio_driver_list, tmp);
547 free(tmp); 547 free(tmp);
548 } 548 }
549 549
550 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "esd", 3)) { 550 if (audio_driver_list && !gstrncmp(audio_driver_list[0], "esd", 3)) {
551 char *tmp; 551 char *tmp;
554 tmp = calloc(1, strlen(gtkAOESDDevice) + 10); 554 tmp = calloc(1, strlen(gtkAOESDDevice) + 10);
555 sprintf(tmp, "esd:%s", gtkAOESDDevice); 555 sprintf(tmp, "esd:%s", gtkAOESDDevice);
556 } else 556 } else
557 tmp = strdup("esd"); 557 tmp = strdup("esd");
558 558
559 gaddlist(&audio_driver_list, tmp); 559 listSet(&audio_driver_list, tmp);
560 free(tmp); 560 free(tmp);
561 } 561 }
562 562
563 // subtitle 563 // subtitle
564 564
775 775
776 if (guiInfo.Playing) 776 if (guiInfo.Playing)
777 break; 777 break;
778 } 778 }
779 779
780 if (guiInfo.Playing && (next = listSet(gtkGetNextPlItem, NULL)) && (plLastPlayed != next)) { 780 if (guiInfo.Playing && (next = listMgr(gtkGetNextPlItem, NULL)) && (plLastPlayed != next)) {
781 plLastPlayed = next; 781 plLastPlayed = next;
782 uiSetFileName(next->path, next->name, STREAMTYPE_FILE); 782 uiSetFileName(next->path, next->name, STREAMTYPE_FILE);
783 guiInfo.NewPlay = GUI_FILE_NEW; 783 guiInfo.NewPlay = GUI_FILE_NEW;
784 guiInfo.Track++; 784 guiInfo.Track++;
785 } else { 785 } else {
856 856
857 item->name = filename; 857 item->name = filename;
858 item->path = pathname; 858 item->path = pathname;
859 859
860 if (insert) 860 if (insert)
861 listSet(gtkInsertPlItem, item); // inserts the item after current, and makes current=item 861 listMgr(gtkInsertPlItem, item); // inserts the item after current, and makes current=item
862 else 862 else
863 listSet(gtkAddPlItem, item); 863 listMgr(gtkAddPlItem, item);
864 864
865 return 1; 865 return 1;
866 } 866 }
867 867
868 // This function imports the initial playtree (based on cmd-line files) 868 // This function imports the initial playtree (based on cmd-line files)
873 { 873 {
874 play_tree_iter_t *my_pt_iter = NULL; 874 play_tree_iter_t *my_pt_iter = NULL;
875 int result = 0; 875 int result = 0;
876 876
877 if (!enqueue) 877 if (!enqueue)
878 listSet(gtkDelPl, NULL); // delete playlist before "appending" 878 listMgr(gtkDelPl, NULL); // delete playlist before "appending"
879 879
880 if ((my_pt_iter = pt_iter_create(&my_playtree, config))) { 880 if ((my_pt_iter = pt_iter_create(&my_playtree, config))) {
881 while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL) 881 while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL)
882 // add it to end of list 882 // add it to end of list
883 if (import_file_into_gui(filename, 0)) 883 if (import_file_into_gui(filename, 0))
902 { 902 {
903 play_tree_iter_t *my_pt_iter = NULL; 903 play_tree_iter_t *my_pt_iter = NULL;
904 int result = 0; 904 int result = 0;
905 plItem *save; 905 plItem *save;
906 906
907 save = (plItem *)listSet(gtkGetCurrPlItem, NULL); // save current item 907 save = (plItem *)listMgr(gtkGetCurrPlItem, NULL); // save current item
908 908
909 if ((my_pt_iter = pt_iter_create(&my_playtree, config))) { 909 if ((my_pt_iter = pt_iter_create(&my_playtree, config))) {
910 while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL) 910 while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL)
911 // insert it into the list and set plCurrent=new item 911 // insert it into the list and set plCurrent=new item
912 if (import_file_into_gui(filename, 1)) 912 if (import_file_into_gui(filename, 1))
914 914
915 pt_iter_destroy(&my_pt_iter); 915 pt_iter_destroy(&my_pt_iter);
916 } 916 }
917 917
918 if (save) 918 if (save)
919 listSet(gtkSetCurrPlItem, save); 919 listMgr(gtkSetCurrPlItem, save);
920 else 920 else
921 listSet(gtkSetCurrPlItem, plList); // go to head, if plList was empty before 921 listMgr(gtkSetCurrPlItem, plList); // go to head, if plList was empty before
922 922
923 if (save && result) 923 if (save && result)
924 listSet(gtkDelCurrPlItem, NULL); 924 listMgr(gtkDelCurrPlItem, NULL);
925 925
926 uiCurr(); // update filename 926 uiCurr(); // update filename
927 927
928 return result; 928 return result;
929 } 929 }