comparison gui/ui/main.c @ 34663:73a5ecb53ee2

Replace symbolic constants by enums. There is no relation to gtk whatsoever, use self-explanatory names instead and add a doxygen comment. For optical reasons, change parameter data from NULL to 0 where it isn't used to pass anything.
author ib
date Tue, 21 Feb 2012 18:55:14 +0000
parents 4ff933a89818
children 697aaedfe59e
comparison
equal deleted inserted replaced
34662:06c84dbac243 34663:73a5ecb53ee2
109 if (what & CLEAR_FILE) 109 if (what & CLEAR_FILE)
110 { 110 {
111 nfree(guiInfo.Filename); 111 nfree(guiInfo.Filename);
112 nfree(guiInfo.SubtitleFilename); 112 nfree(guiInfo.SubtitleFilename);
113 nfree(guiInfo.AudioFilename); 113 nfree(guiInfo.AudioFilename);
114 listMgr(gtkDelPl, NULL); 114 listMgr(PLAYLIST_DELETE, 0);
115 } 115 }
116 116
117 if (what & CLEAR_VCD) guiInfo.Tracks = 0; 117 if (what & CLEAR_VCD) guiInfo.Tracks = 0;
118 118
119 if (what & CLEAR_DVD) 119 if (what & CLEAR_DVD)
206 case evPlaySwitchToPause: 206 case evPlaySwitchToPause:
207 play: 207 play:
208 208
209 if ( ( msg == evPlaySwitchToPause )&&( guiInfo.Playing == GUI_PAUSE ) ) goto NoPause; 209 if ( ( msg == evPlaySwitchToPause )&&( guiInfo.Playing == GUI_PAUSE ) ) goto NoPause;
210 210
211 if ( listMgr( gtkGetCurrPlItem,NULL ) &&( guiInfo.StreamType == STREAMTYPE_FILE ) ) 211 if ( listMgr( PLAYLIST_ITEM_GET_CURR,0 ) &&( guiInfo.StreamType == STREAMTYPE_FILE ) )
212 { 212 {
213 plItem * next = listMgr( gtkGetCurrPlItem,NULL ); 213 plItem * next = listMgr( PLAYLIST_ITEM_GET_CURR,0 );
214 plLastPlayed=next; 214 plLastPlayed=next;
215 uiSetFileName( next->path,next->name,SAME_STREAMTYPE ); 215 uiSetFileName( next->path,next->name,SAME_STREAMTYPE );
216 } 216 }
217 217
218 switch ( guiInfo.StreamType ) 218 switch ( guiInfo.StreamType )
269 269
270 case evLoadPlay: 270 case evLoadPlay:
271 uiMainAutoPlay=1; 271 uiMainAutoPlay=1;
272 // guiInfo.StreamType=STREAMTYPE_FILE; 272 // guiInfo.StreamType=STREAMTYPE_FILE;
273 case evLoad: 273 case evLoad:
274 listMgr( gtkDelPl,NULL ); 274 listMgr( PLAYLIST_DELETE,0 );
275 gtkShow( evLoad,NULL ); 275 gtkShow( evLoad,NULL );
276 break; 276 break;
277 case evLoadSubtitle: gtkShow( evLoadSubtitle,NULL ); break; 277 case evLoadSubtitle: gtkShow( evLoadSubtitle,NULL ); break;
278 case evDropSubtitle: 278 case evDropSubtitle:
279 nfree( guiInfo.SubtitleFilename ); 279 nfree( guiInfo.SubtitleFilename );
641 } 641 }
642 642
643 /* clear playlist */ 643 /* clear playlist */
644 if (filename == NULL) { 644 if (filename == NULL) {
645 filename = files[f]; 645 filename = files[f];
646 listMgr(gtkDelPl,NULL); 646 listMgr(PLAYLIST_DELETE,0);
647 } 647 }
648 648
649 item = calloc(1,sizeof(plItem)); 649 item = calloc(1,sizeof(plItem));
650 650
651 /* FIXME: decompose file name ? */ 651 /* FIXME: decompose file name ? */
656 item->path = gstrdup( str ); 656 item->path = gstrdup( str );
657 } else { 657 } else {
658 item->name = strdup(str); 658 item->name = strdup(str);
659 item->path = strdup(""); 659 item->path = strdup("");
660 } 660 }
661 listMgr(gtkAddPlItem,item); 661 listMgr(PLAYLIST_ITEM_ADD,item);
662 } else { 662 } else {
663 mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_NotAFile,str ); 663 mp_msg( MSGT_GPLAYER,MSGL_WARN,MSGTR_NotAFile,str );
664 } 664 }
665 free( str ); 665 free( str );
666 } 666 }