]> git.sesse.net Git - vlc/blob - modules/gui/wxwindows/interface.cpp
* oups forgot to commit this one. still the hide/show thing.
[vlc] / modules / gui / wxwindows / interface.cpp
1 /*****************************************************************************
2  * interface.cpp : wxWindows plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2000-2001 VideoLAN
5  * $Id: interface.cpp,v 1.21 2003/04/17 14:18:47 anil Exp $
6  *
7  * Authors: Gildas Bazin <gbazin@netcourrier.com>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include <stdlib.h>                                      /* malloc(), free() */
28 #include <errno.h>                                                 /* ENOMEM */
29 #include <string.h>                                            /* strerror() */
30 #include <stdio.h>
31
32 #include <vlc/vlc.h>
33
34 #ifdef WIN32                                                 /* mingw32 hack */
35 #undef Yield
36 #undef CreateDialog
37 #endif
38
39 /* Let vlc take care of the i18n stuff */
40 #define WXINTL_NO_GETTEXT_MACRO
41
42 #include <wx/wxprec.h>
43 #include <wx/wx.h>
44
45 #include <vlc/intf.h>
46 #include "stream_control.h"
47
48 #include "wxwindows.h"
49
50 /* include the toolbar graphics */
51 #include "bitmaps/file.xpm"
52 #include "bitmaps/disc.xpm"
53 #include "bitmaps/net.xpm"
54 #if 0
55 #include "bitmaps/sat.xpm"
56 #endif
57 #include "bitmaps/play.xpm"
58 #include "bitmaps/pause.xpm"
59 #include "bitmaps/stop.xpm"
60 #include "bitmaps/previous.xpm"
61 #include "bitmaps/next.xpm"
62 #include "bitmaps/playlist.xpm"
63 #define TOOLBAR_BMP_WIDTH 24
64 #define TOOLBAR_BMP_HEIGHT 24
65
66 /* include the icon graphic */
67 #include "share/vlc32x32.xpm"
68
69 /*****************************************************************************
70  * Local class declarations.
71  *****************************************************************************/
72
73 /*****************************************************************************
74  * Event Table.
75  *****************************************************************************/
76
77 /* IDs for the controls and the menu commands */
78 enum
79 {
80     /* menu items */
81     Exit_Event = wxID_HIGHEST,
82     OpenFile_Event,
83     OpenDisc_Event,
84     OpenNet_Event,
85     OpenSat_Event,
86     EjectDisc_Event,
87
88     Playlist_Event,
89     Logs_Event,
90     FileInfo_Event,
91
92     Audio_Event,
93     Subtitles_Event,
94     Prefs_Event,
95
96     SliderScroll_Event,
97     StopStream_Event,
98     PlayStream_Event,
99     PrevStream_Event,
100     NextStream_Event,
101
102     /* it is important for the id corresponding to the "About" command to have
103      * this standard value as otherwise it won't be handled properly under Mac
104      * (where it is special and put into the "Apple" menu) */
105     About_Event = wxID_ABOUT
106 };
107
108 BEGIN_EVENT_TABLE(Interface, wxFrame)
109     /* Menu events */
110     EVT_MENU(Exit_Event, Interface::OnExit)
111     EVT_MENU(About_Event, Interface::OnAbout)
112     EVT_MENU(Playlist_Event, Interface::OnPlaylist)
113     EVT_MENU(Logs_Event, Interface::OnLogs)
114     EVT_MENU(FileInfo_Event, Interface::OnFileInfo)
115     EVT_MENU(Prefs_Event, Interface::OnPreferences)
116
117     /* Toolbar events */
118     EVT_MENU(OpenFile_Event, Interface::OnOpenFile)
119     EVT_MENU(OpenDisc_Event, Interface::OnOpenDisc)
120     EVT_MENU(OpenNet_Event, Interface::OnOpenNet)
121     EVT_MENU(OpenSat_Event, Interface::OnOpenSat)
122     EVT_MENU(StopStream_Event, Interface::OnStopStream)
123     EVT_MENU(PlayStream_Event, Interface::OnPlayStream)
124     EVT_MENU(PrevStream_Event, Interface::OnPrevStream)
125     EVT_MENU(NextStream_Event, Interface::OnNextStream)
126
127     /* Slider events */
128     EVT_COMMAND_SCROLL(SliderScroll_Event, Interface::OnSliderUpdate)
129 END_EVENT_TABLE()
130
131 /*****************************************************************************
132  * Constructor.
133  *****************************************************************************/
134 Interface::Interface( intf_thread_t *_p_intf ):
135     wxFrame( NULL, -1, VOUT_TITLE,
136              wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE )
137 {
138     /* Initializations */
139     p_intf = _p_intf;
140     p_prefs_dialog = NULL;
141     i_old_playing_status = PAUSE_S;
142
143     /* Give our interface a nice little icon */
144     p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
145     SetIcon( *p_intf->p_sys->p_icon );
146
147     /* Create a sizer for the main frame */
148     frame_sizer = new wxBoxSizer( wxHORIZONTAL );
149     SetSizer( frame_sizer );
150
151     /* Creation of the menu bar */
152     CreateOurMenuBar();
153
154     /* Creation of the tool bar */
155     CreateOurToolBar();
156
157     /* Creation of the slider sub-window */
158     CreateOurSlider();
159     frame_sizer->Add( slider_frame, 1, wxGROW, 0 );
160     frame_sizer->Hide( slider_frame );
161
162     /* Creation of the status bar
163      * Helptext for menu items and toolbar tools will automatically get
164      * displayed here. */
165     int i_status_width[2] = {-2,-3};
166     statusbar = CreateStatusBar( 2 );                            /* 2 fields */
167     statusbar->SetStatusWidths( 2, i_status_width );
168
169     /* Make sure we've got the right background colour */
170     SetBackgroundColour( slider_frame->GetBackgroundColour() );
171
172     /* Layout everything */
173     SetAutoLayout( TRUE );
174     frame_sizer->Layout();
175     frame_sizer->Fit(this);
176
177 #if !defined(__WXX11__)
178     /* Associate drop targets with the main interface */
179     SetDropTarget( new DragAndDrop( p_intf ) );
180 #endif
181 }
182
183 Interface::~Interface()
184 {
185     if( p_prefs_dialog ) p_prefs_dialog->Destroy();
186 }
187
188 /*****************************************************************************
189  * Private methods.
190  *****************************************************************************/
191 void Interface::CreateOurMenuBar()
192 {
193 #define HELP_FILE  N_("Open a file")
194 #define HELP_DISC  N_("Open a DVD or (S)VCD")
195 #define HELP_NET   N_("Open a network stream")
196 #define HELP_SAT   N_("Open a satellite stream")
197 #define HELP_EJECT N_("Eject the DVD/CD")
198 #define HELP_EXIT  N_("Exit this program")
199
200 #define HELP_PLAYLIST   N_("Open the playlist")
201 #define HELP_LOGS       N_("Show the program logs")
202 #define HELP_FILEINFO       N_("Show information about the file being played")
203
204 #define HELP_AUDIO N_("Change the current audio track")
205 #define HELP_SUBS  N_("Change the current subtitles stream")
206 #define HELP_PREFS N_("Go to the preferences menu")
207
208 #define HELP_ABOUT N_("About this program")
209
210     /* Create the "File" menu */
211     wxMenu *file_menu = new wxMenu;
212     file_menu->Append( OpenFile_Event, _("&Open File..."), HELP_FILE );
213     file_menu->Append( OpenDisc_Event, _("Open &Disc..."), HELP_DISC );
214     file_menu->Append( OpenNet_Event, _("&Network Stream..."), HELP_NET );
215 #if 0
216     file_menu->Append( OpenSat_Event, _("&Satellite Stream..."), HELP_NET );
217 #endif
218     file_menu->AppendSeparator();
219     file_menu->Append( EjectDisc_Event, _("&Eject Disc"), HELP_EJECT );
220     file_menu->AppendSeparator();
221     file_menu->Append( Exit_Event, _("E&xit"), HELP_EXIT );
222
223     /* Create the "View" menu */
224     wxMenu *view_menu = new wxMenu;
225     view_menu->Append( Playlist_Event, _("&Playlist..."), HELP_PLAYLIST );
226     view_menu->Append( Logs_Event, _("&Logs..."), HELP_LOGS );
227     view_menu->Append( FileInfo_Event, _("&File info..."), HELP_FILEINFO );
228
229     /* Create the "Settings" menu */
230     wxMenu *settings_menu = new wxMenu;
231     settings_menu->Append( Audio_Event, _("&Audio"), HELP_AUDIO );
232     settings_menu->Append( Subtitles_Event, _("&Subtitles"), HELP_SUBS );
233     settings_menu->AppendSeparator();
234     settings_menu->Append( Prefs_Event, _("&Preferences..."), HELP_PREFS );
235
236     /* Create the "Help" menu */
237     wxMenu *help_menu = new wxMenu;
238     help_menu->Append( About_Event, _("&About..."), HELP_ABOUT );
239
240     /* Append the freshly created menus to the menu bar... */
241     wxMenuBar *menubar = new wxMenuBar( wxMB_DOCKABLE );
242     menubar->Append( file_menu, _("&File") );
243     menubar->Append( view_menu, _("&View") );
244     menubar->Append( settings_menu, _("&Settings") );
245     menubar->Append( help_menu, _("&Help") );
246
247     /* Attach the menu bar to the frame */
248     SetMenuBar( menubar );
249
250 #if !defined(__WXX11__)
251     /* Associate drop targets with the menubar */
252     menubar->SetDropTarget( new DragAndDrop( p_intf ) );
253 #endif
254 }
255
256 void Interface::CreateOurToolBar()
257 {
258 #define HELP_STOP N_("Stop current playlist item")
259 #define HELP_PLAY N_("Play current playlist item")
260 #define HELP_PAUSE N_("Pause current playlist item")
261 #define HELP_PLO N_("Open playlist")
262 #define HELP_PLP N_("Previous playlist item")
263 #define HELP_PLN N_("Next playlist item")
264
265     wxLogNull LogDummy; /* Hack to suppress annoying log message on the win32
266                          * version because we don't include wx.rc */
267
268     wxToolBar *toolbar = CreateToolBar(
269         wxTB_HORIZONTAL | wxTB_TEXT | wxTB_FLAT | wxTB_DOCKABLE );
270
271     toolbar->SetToolBitmapSize( wxSize(TOOLBAR_BMP_WIDTH,TOOLBAR_BMP_HEIGHT) );
272
273     toolbar->AddTool( OpenFile_Event, _("File"), wxBitmap( file_xpm ),
274                       HELP_FILE );
275     toolbar->AddTool( OpenDisc_Event, _("Disc"), wxBitmap( disc_xpm ),
276                       HELP_DISC );
277     toolbar->AddTool( OpenNet_Event, _("Net"), wxBitmap( net_xpm ),
278                       HELP_NET );
279 #if 0
280     toolbar->AddTool( OpenSat_Event, _("Sat"), wxBitmap( sat_xpm ),
281                       HELP_SAT );
282 #endif
283     toolbar->AddSeparator();
284     toolbar->AddTool( StopStream_Event, _("Stop"), wxBitmap( stop_xpm ),
285                       HELP_STOP );
286     toolbar->AddTool( PlayStream_Event, _("Play"), wxBitmap( play_xpm ),
287                       HELP_PLAY );
288     toolbar->AddSeparator();
289     toolbar->AddTool( Playlist_Event, _("Playlist"), wxBitmap( playlist_xpm ),
290                       HELP_PLO );
291     toolbar->AddTool( PrevStream_Event, _("Prev"), wxBitmap( previous_xpm ),
292                       HELP_PLP );
293     toolbar->AddTool( NextStream_Event, _("Next"), wxBitmap( next_xpm ),
294                       HELP_PLN );
295
296     toolbar->Realize();
297
298     /* Place the toolbar in a sizer, so we can calculate the width of the
299      * toolbar and set this as the minimum for the main frame size. */
300     wxBoxSizer *toolbar_sizer = new wxBoxSizer( wxHORIZONTAL );
301     toolbar_sizer->Add( toolbar, 0, 0, 0 );
302     toolbar_sizer->Layout();
303
304 #ifndef WIN32
305     frame_sizer->SetMinSize( toolbar_sizer->GetMinSize().GetWidth(), -1 );
306 #else
307     frame_sizer->SetMinSize( toolbar->GetToolSize().GetWidth() *
308                              toolbar->GetToolsCount(), -1 );
309 #endif
310
311 #if !defined(__WXX11__)
312     /* Associate drop targets with the toolbar */
313     toolbar->SetDropTarget( new DragAndDrop( p_intf ) );
314 #endif
315 }
316
317 void Interface::CreateOurSlider()
318 {
319     /* Create a new frame containing the slider */
320     slider_frame = new wxPanel( this, -1, wxDefaultPosition, wxDefaultSize );
321     slider_frame->SetAutoLayout( TRUE );
322
323     /* Create static box to surround the slider */
324     slider_box = new wxStaticBox( slider_frame, -1, "" );
325
326     /* Create sizer for slider frame */
327     wxStaticBoxSizer *slider_sizer =
328         new wxStaticBoxSizer( slider_box, wxHORIZONTAL );
329     slider_frame->SetSizer( slider_sizer );
330     slider_sizer->SetMinSize( -1, 50 );
331
332     /* Create slider */
333     slider = new wxSlider( slider_frame, SliderScroll_Event, 0, 0,
334                            SLIDER_MAX_POS, wxDefaultPosition, wxDefaultSize );
335     slider_sizer->Add( slider, 1, wxGROW | wxALL, 5 );
336     slider_sizer->Layout();
337     slider_sizer->SetSizeHints(slider_frame);
338
339     /* Hide the slider by default */
340     slider_frame->Hide();
341 }
342
343 void Interface::Open( int i_access_method )
344 {
345     /* Show/hide the open dialog */
346     OpenDialog dialog( p_intf, this, i_access_method );
347
348     if( dialog.ShowModal() == wxID_OK )
349     {
350         /* Update the playlist */
351         playlist_t *p_playlist =
352             (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
353                                            FIND_ANYWHERE );
354         if( p_playlist == NULL )
355         {
356             return;
357         }
358
359         playlist_Add( p_playlist, (char *)dialog.mrl.c_str(),
360                       PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
361
362         TogglePlayButton( PLAYING_S );
363
364         /* Rebuild the playlist */
365         p_intf->p_sys->p_playlist_window->Rebuild();
366
367         vlc_object_release( p_playlist );
368     }
369 }
370
371 /*****************************************************************************
372  * Event Handlers.
373  *****************************************************************************/
374 void Interface::OnExit( wxCommandEvent& WXUNUSED(event) )
375 {
376     /* TRUE is to force the frame to close. */
377     Close(TRUE);
378 }
379
380 void Interface::OnAbout( wxCommandEvent& WXUNUSED(event) )
381 {
382     wxString msg;
383     msg.Printf( VOUT_TITLE + wxString(_(" (wxWindows interface)\n\n")) +
384         wxString(_("(C) 1996-2003 - the VideoLAN Team\n\n")) +
385         wxString(_("The VideoLAN team <videolan@videolan.org>\n"
386                    "http://www.videolan.org/\n\n")) +
387         wxString(_("This is the VideoLAN Client, a DVD, MPEG and DivX player."
388           "\nIt can play MPEG and MPEG2 files from a file or from a "
389           "network source.")) );
390
391     wxMessageBox( msg, wxString::Format(_("About %s"), VOUT_TITLE),
392                   wxOK | wxICON_INFORMATION, this );
393 }
394
395 void Interface::OnPlaylist( wxCommandEvent& WXUNUSED(event) )
396 {
397     /* Show/hide the playlist window */
398     wxFrame *p_playlist_window = p_intf->p_sys->p_playlist_window;
399     if( p_playlist_window )
400     {
401         p_playlist_window->Show( ! p_playlist_window->IsShown() );
402     }
403 }
404
405 void Interface::OnLogs( wxCommandEvent& WXUNUSED(event) )
406 {
407     /* Show/hide the log window */
408     wxFrame *p_messages_window = p_intf->p_sys->p_messages_window;
409     if( p_messages_window )
410     {
411         p_messages_window->Show( ! p_messages_window->IsShown() );
412     }
413 }
414
415 void Interface::OnFileInfo( wxCommandEvent& WXUNUSED(event) )
416 {
417     /* Show/hide the file info window */
418     wxFrame *p_fileinfo_window = p_intf->p_sys->p_fileinfo_window;
419     if( p_fileinfo_window )
420     {
421         p_fileinfo_window->Show( ! p_fileinfo_window->IsShown() );
422     }
423 }
424
425 void Interface::OnPreferences( wxCommandEvent& WXUNUSED(event) )
426 {
427     /* Show/hide the open dialog */
428     if( p_prefs_dialog == NULL )
429     {
430         p_prefs_dialog = new PrefsDialog( p_intf, this );
431     }
432
433     if( p_prefs_dialog )
434     {
435         p_prefs_dialog->Show( true );
436     }
437 }
438
439 void Interface::OnOpenFile( wxCommandEvent& WXUNUSED(event) )
440 {
441     Open( FILE_ACCESS );
442 }
443
444 void Interface::OnOpenDisc( wxCommandEvent& WXUNUSED(event) )
445 {
446     Open( DISC_ACCESS );
447 }
448
449 void Interface::OnOpenNet( wxCommandEvent& WXUNUSED(event) )
450 {
451     Open( NET_ACCESS );
452 }
453
454 void Interface::OnOpenSat( wxCommandEvent& WXUNUSED(event) )
455 {
456     Open( SAT_ACCESS );
457 }
458
459 void Interface::OnPlayStream( wxCommandEvent& WXUNUSED(event) )
460 {
461     wxCommandEvent dummy;
462     playlist_t *p_playlist =
463         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
464                                        FIND_ANYWHERE );
465     if( p_playlist == NULL )
466     {
467         /* If the playlist is empty, open a file requester instead */
468         OnOpenFile( dummy );
469         return;
470     }
471
472     vlc_mutex_lock( &p_playlist->object_lock );
473     if( p_playlist->i_size )
474     {
475         vlc_mutex_unlock( &p_playlist->object_lock );
476
477         input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_intf,
478                                                        VLC_OBJECT_INPUT,
479                                                        FIND_ANYWHERE );
480         if( p_input == NULL )
481         {
482             /* No stream was playing, start one */
483             playlist_Play( p_playlist );
484             TogglePlayButton( PLAYING_S );
485             vlc_object_release( p_playlist );
486             return;
487         }
488
489         if( p_input->stream.control.i_status != PAUSE_S )
490         {
491             /* A stream is being played, pause it */
492             input_SetStatus( p_input, INPUT_STATUS_PAUSE );
493             TogglePlayButton( PAUSE_S );
494             vlc_object_release( p_playlist );
495             vlc_object_release( p_input );
496             return;
497         }
498
499         /* Stream is paused, resume it */
500         playlist_Play( p_playlist );
501         TogglePlayButton( PLAYING_S );
502         vlc_object_release( p_input );
503         vlc_object_release( p_playlist );
504     }
505     else
506     {
507         vlc_mutex_unlock( &p_playlist->object_lock );
508         vlc_object_release( p_playlist );
509         OnOpenFile( dummy );
510     }
511 }
512
513 void Interface::OnStopStream( wxCommandEvent& WXUNUSED(event) )
514 {
515     playlist_t * p_playlist =
516         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
517                                        FIND_ANYWHERE );
518     if( p_playlist == NULL )
519     {
520         return;
521     }
522
523     playlist_Stop( p_playlist );
524     TogglePlayButton( PAUSE_S );
525     vlc_object_release( p_playlist );
526 }
527
528 void Interface::OnSliderUpdate( wxScrollEvent& event )
529 {
530     vlc_mutex_lock( &p_intf->change_lock );
531
532 #ifdef WIN32
533     if( event.GetEventType() == wxEVT_SCROLL_THUMBRELEASE
534         || event.GetEventType() == wxEVT_SCROLL_ENDSCROLL )
535     {
536 #endif
537         if( p_intf->p_sys->i_slider_pos != event.GetPosition()
538             && p_intf->p_sys->p_input )
539         {
540             p_intf->p_sys->i_slider_pos = event.GetPosition();
541             input_Seek( p_intf->p_sys->p_input, p_intf->p_sys->i_slider_pos *
542                         100 / SLIDER_MAX_POS,
543                         INPUT_SEEK_PERCENT | INPUT_SEEK_SET );
544         }
545
546 #ifdef WIN32
547         p_intf->p_sys->b_slider_free = VLC_TRUE;
548     }
549     else
550     {
551         p_intf->p_sys->b_slider_free = VLC_FALSE;
552
553         if( p_intf->p_sys->p_input )
554         {
555             /* Update stream date */
556 #define p_area p_intf->p_sys->p_input->stream.p_selected_area
557             char psz_time[ OFFSETTOTIME_MAX_SIZE ];
558
559             slider_box->SetLabel(
560                 input_OffsetToTime( p_intf->p_sys->p_input,
561                                     psz_time,
562                                     p_area->i_size * event.GetPosition()
563                                     / SLIDER_MAX_POS ) );
564 #undef p_area
565         }
566     }
567 #endif
568
569     vlc_mutex_unlock( &p_intf->change_lock );
570 }
571
572 void Interface::OnPrevStream( wxCommandEvent& WXUNUSED(event) )
573 {
574     playlist_t * p_playlist =
575         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
576                                        FIND_ANYWHERE );
577     if( p_playlist == NULL )
578     {
579         return;
580     }
581
582     playlist_Prev( p_playlist );
583     vlc_object_release( p_playlist );
584 }
585
586 void Interface::OnNextStream( wxCommandEvent& WXUNUSED(event) )
587 {
588     playlist_t * p_playlist =
589         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
590                                        FIND_ANYWHERE );
591     if( p_playlist == NULL )
592     {
593         return;
594     }
595
596     playlist_Next( p_playlist );
597     vlc_object_release( p_playlist );
598 }
599
600 void Interface::TogglePlayButton( int i_playing_status )
601 {
602     if( i_playing_status == i_old_playing_status )
603         return;
604
605     GetToolBar()->DeleteTool( PlayStream_Event );
606
607     if( i_playing_status == PLAYING_S )
608     {
609         GetToolBar()->InsertTool( 5, PlayStream_Event, _("Pause"),
610                                   wxBitmap( pause_xpm ) );
611     }
612     else
613     {
614         GetToolBar()->InsertTool( 5, PlayStream_Event, _("Play"),
615                                   wxBitmap( play_xpm ) );
616     }
617
618     GetToolBar()->Realize();
619
620     i_old_playing_status = i_playing_status;
621 }
622
623 #if !defined(__WXX11__)
624 /*****************************************************************************
625  * Definition of DragAndDrop class.
626  *****************************************************************************/
627 DragAndDrop::DragAndDrop( intf_thread_t *_p_intf )
628 {
629     p_intf = _p_intf;
630 }
631
632 bool DragAndDrop::OnDropFiles( wxCoord, wxCoord,
633                                const wxArrayString& filenames )
634 {
635     unsigned int i;
636
637     /* Add dropped files to the playlist */
638
639     playlist_t *p_playlist =
640         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
641                                        FIND_ANYWHERE );
642     if( p_playlist == NULL )
643     {
644         return FALSE;
645     }
646
647     for( i = 0; i < filenames.GetCount(); i++ )
648         playlist_Add( p_playlist, (char *)filenames[i].c_str(),
649                       PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
650
651     /* Rebuild the playlist */
652     p_intf->p_sys->p_playlist_window->Rebuild();
653
654     vlc_object_release( p_playlist );
655
656     return TRUE;
657 }
658 #endif