Mercurial > mplayer.hg
diff Gui/interface.c @ 7092:8e9607c5897e
- warning fixes from Dominik Mierzejewski <dominik@rangers.eu.org>
- wsXDNDProcessSelection return Truae fix
- add url list saving support from Morten Volden <mvolden@tdcadsl.dk>
- fix bug's in this patches
- fix some memleak and bug
author | pontscho |
---|---|
date | Mon, 26 Aug 2002 22:20:58 +0000 |
parents | e37a67d5e117 |
children | b65b78640d49 |
line wrap: on
line diff
--- a/Gui/interface.c Mon Aug 26 17:20:17 2002 +0000 +++ b/Gui/interface.c Mon Aug 26 22:20:58 2002 +0000 @@ -555,6 +555,8 @@ plItem * plList = NULL; plItem * plLastPlayed = NULL; +URLItem *URLList = NULL; + #if defined( MP_DEBUG ) && 0 void list( void ) { @@ -577,6 +579,9 @@ equalizer_t * eq = (equalizer_t *)vparam; plItem * item = (plItem *)vparam; + URLItem * url_item = (URLItem *)vparam; + int is_added = True; + switch ( cmd ) { // --- handle playlist @@ -586,8 +591,7 @@ plItem * next = plList; while ( next->next ) { /*printf( "%s\n",next->name );*/ next=next->next; } next->next=item; item->prev=next; - } - else { item->prev=item->next=NULL; plCurrent=plList=item; } + } else { item->prev=item->next=NULL; plCurrent=plList=item; } list(); return NULL; case gtkGetNextPlItem: // get current item from playlist @@ -638,6 +642,24 @@ plList=NULL; plCurrent=NULL; } return NULL; + // ----- Handle url + case gtkAddURLItem: + if ( URLList ) + { + URLItem * next_url = URLList; + is_added = False; + while ( next_url->next ) + { + if ( !gstrcmp( next_url->url,url_item->url ) ) + { + is_added=True; + break; + } + next_url=next_url->next; + } + if ( ( !is_added )&&( gstrcmp( next_url->url,url_item->url ) ) ) next_url->next=url_item; + } else { url_item->next=NULL; URLList=url_item; } + return NULL; // --- subtitle case gtkSetSubAuto: sub_auto=(int)fparam;