comparison gui/interface.c @ 35512:ce2cda8acb4e

Cosmetic: Change variable names.
author ib
date Wed, 05 Dec 2012 12:08:12 +0000
parents 6616645f91ea
children a24abc593a88
comparison
equal deleted inserted replaced
35511:6616645f91ea 35512:ce2cda8acb4e
851 } 851 }
852 852
853 return True; 853 return True;
854 } 854 }
855 855
856 int guiPlaylist(int what, play_tree_t *my_playtree, m_config_t *config, int enqueue) 856 int guiPlaylist(int what, play_tree_t *playtree, m_config_t *config, int enqueue)
857 { 857 {
858 play_tree_iter_t *my_pt_iter = NULL; 858 play_tree_iter_t *pt_iter = NULL;
859 int added = False; 859 int added = False;
860 plItem *save; 860 plItem *curr;
861 861
862 switch (what) { 862 switch (what) {
863 // This function imports the initial playtree (based on cmd-line files) 863 // This function imports the initial playtree (based on cmd-line files)
864 // into the gui playlist by either: 864 // into the gui playlist by either:
865 // - overwriting gui pl (enqueue=0) 865 // - overwriting gui pl (enqueue=0)
867 case GUI_PLAYLIST_INIT: 867 case GUI_PLAYLIST_INIT:
868 868
869 if (!enqueue) 869 if (!enqueue)
870 listMgr(PLAYLIST_DELETE, 0); // delete playlist before "appending" 870 listMgr(PLAYLIST_DELETE, 0); // delete playlist before "appending"
871 871
872 if ((my_pt_iter = pt_iter_create(&my_playtree, config))) { 872 if ((pt_iter = pt_iter_create(&playtree, config))) {
873 while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL) 873 while ((filename = pt_iter_get_next_file(pt_iter)) != NULL)
874 /* add it to end of list */ 874 /* add it to end of list */
875 if (add_to_gui_playlist(filename, PLAYLIST_ITEM_APPEND)) 875 if (add_to_gui_playlist(filename, PLAYLIST_ITEM_APPEND))
876 added = True; 876 added = True;
877 } 877 }
878 878
892 // with "File Open". (The latter, actually, isn't allowed in MPlayer and thus 892 // with "File Open". (The latter, actually, isn't allowed in MPlayer and thus
893 // not working which is why this function won't get called for that reason.) 893 // not working which is why this function won't get called for that reason.)
894 // The file which contained the playlist is thereby replaced with it's contents. 894 // The file which contained the playlist is thereby replaced with it's contents.
895 case GUI_PLAYLIST_ADD: 895 case GUI_PLAYLIST_ADD:
896 896
897 save = (plItem *)listMgr(PLAYLIST_ITEM_GET_CURR, 0); // save current item 897 curr = (plItem *)listMgr(PLAYLIST_ITEM_GET_CURR, 0);
898 898
899 if ((my_pt_iter = pt_iter_create(&my_playtree, config))) { 899 if ((pt_iter = pt_iter_create(&playtree, config))) {
900 while ((filename = pt_iter_get_next_file(my_pt_iter)) != NULL) 900 while ((filename = pt_iter_get_next_file(pt_iter)) != NULL)
901 /* insert it into the list and set plCurrent=new item */ 901 /* insert it into the list and set plCurrent=new item */
902 if (add_to_gui_playlist(filename, PLAYLIST_ITEM_INSERT)) 902 if (add_to_gui_playlist(filename, PLAYLIST_ITEM_INSERT))
903 added = True; 903 added = True;
904 904
905 pt_iter_destroy(&my_pt_iter); 905 pt_iter_destroy(&pt_iter);
906 } 906 }
907 907
908 if (save) 908 if (curr)
909 listMgr(PLAYLIST_ITEM_SET_CURR, save); 909 listMgr(PLAYLIST_ITEM_SET_CURR, curr);
910 else 910 else
911 listMgr(PLAYLIST_ITEM_SET_CURR, listMgr(PLAYLIST_GET, 0)); // go to head, if plList was empty before 911 listMgr(PLAYLIST_ITEM_SET_CURR, listMgr(PLAYLIST_GET, 0)); // go to head, if plList was empty before
912 912
913 if (save && added) 913 if (curr && added)
914 listMgr(PLAYLIST_ITEM_DEL_CURR, 0); 914 listMgr(PLAYLIST_ITEM_DEL_CURR, 0);
915 915
916 uiCurr(); // update filename 916 uiCurr(); // update filename
917 917
918 break; 918 break;