intf_qt.cpp 19.7 KB
Newer Older
Sam Hocevar's avatar
 
Sam Hocevar committed
1
2
3
4
/*****************************************************************************
 * intf_qt.cpp: Qt interface
 *****************************************************************************
 * Copyright (C) 1999, 2000 VideoLAN
5
 * $Id: intf_qt.cpp,v 1.15 2002/07/01 17:39:55 sam Exp $
Sam Hocevar's avatar
 
Sam Hocevar committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 *
 * Authors: Samuel Hocevar <sam@zoy.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
 *****************************************************************************/

/*****************************************************************************
 * Preamble
 *****************************************************************************/
#include <errno.h>                                                 /* ENOMEM */
#include <stdlib.h>                                                /* free() */
#include <string.h>                                            /* strerror() */
#include <stdio.h>

32
33
#include <vlc/vlc.h>
#include <vlc/intf.h>
Sam Hocevar's avatar
 
Sam Hocevar committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

#include <qapplication.h>
#include <qmainwindow.h>
#include <qtoolbar.h>
#include <qtoolbutton.h>
#include <qwhatsthis.h>
#include <qpushbutton.h>
#include <qfiledialog.h>
#include <qslider.h>
#include <qlcdnumber.h>
#include <qmenubar.h>
#include <qstatusbar.h>
#include <qmessagebox.h>
#include <qlabel.h> 
#include <qtimer.h> 
Sam Hocevar's avatar
   
Sam Hocevar committed
49
#include <qiconset.h> 
Sam Hocevar's avatar
 
Sam Hocevar committed
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93

#include <qvbox.h>
#include <qhbox.h>

/*****************************************************************************
 * Local Qt slider class
 *****************************************************************************/
class IntfSlider : public QSlider
{
    Q_OBJECT

public:
    IntfSlider( intf_thread_t *, QWidget * );  /* Constructor and destructor */
    ~IntfSlider();

    bool b_free;                                     /* Is the slider free ? */

    int  oldvalue   ( void ) { return i_oldvalue; };
    void setOldValue( int i_value ) { i_oldvalue = i_value; };

private slots:
    void SlideStart ( void ) { b_free = FALSE; };
    void SlideStop  ( void ) { b_free = TRUE; };

private:
    intf_thread_t *p_intf;
    int  i_oldvalue;
};

/*****************************************************************************
 * Local Qt interface window class
 *****************************************************************************/
class IntfWindow : public QMainWindow
{
    Q_OBJECT

public:
    IntfWindow( intf_thread_t * );
    ~IntfWindow();

private slots:
    void Manage( void );

    void FileOpen  ( void );
Sam Hocevar's avatar
   
Sam Hocevar committed
94
    void FileQuit  ( void ) { qApp->quit(); };
Sam Hocevar's avatar
 
Sam Hocevar committed
95
96
97
98
99
100
101
102
103
104
105
106

    void PlaybackPlay  ( void );
    void PlaybackPause ( void );
    void PlaybackSlow  ( void );
    void PlaybackFast  ( void );

    void PlaylistPrev  ( void );
    void PlaylistNext  ( void );

    void DateDisplay  ( int );
    void About ( void );

107
    void Unimplemented( void ) { msg_Warn( p_intf, "unimplemented" ); };
Sam Hocevar's avatar
 
Sam Hocevar committed
108
109
110
111
112
113
114
115
116
117
118

private:
    intf_thread_t *p_intf;

    IntfSlider *p_slider;

    QToolBar   *p_toolbar;
    QPopupMenu *p_popup;
    QLabel     *p_date;
};

Sam Hocevar's avatar
   
Sam Hocevar committed
119
#include "intf_qt.moc"
Sam Hocevar's avatar
 
Sam Hocevar committed
120
121
122
123
124
125
126
127

#define SLIDER_MIN    0x00000
#define SLIDER_MAX    0x10000
#define SLIDER_STEP   (SLIDER_MAX >> 4)

/*****************************************************************************
 * intf_sys_t: description and status of Qt interface
 *****************************************************************************/
128
struct intf_sys_s
Sam Hocevar's avatar
 
Sam Hocevar committed
129
130
131
{
    QApplication *p_app;
    IntfWindow   *p_window;
132
133

    input_thread_t *p_input;
134
};
Sam Hocevar's avatar
 
Sam Hocevar committed
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170

/*****************************************************************************
 * Local prototypes.
 *****************************************************************************/
static int  intf_Open      ( intf_thread_t *p_intf );
static void intf_Close     ( intf_thread_t *p_intf );
static void intf_Run       ( intf_thread_t *p_intf );

/*****************************************************************************
 * Functions exported as capabilities. They are declared as static so that
 * we don't pollute the namespace too much.
 *****************************************************************************/
extern "C"
{

void _M( intf_getfunctions )( function_list_t * p_function_list )
{
    p_function_list->functions.intf.pf_open  = intf_Open;
    p_function_list->functions.intf.pf_close = intf_Close;
    p_function_list->functions.intf.pf_run   = intf_Run;
}

}

/*****************************************************************************
 * intf_Open: initialize and create window
 *****************************************************************************/
static int intf_Open( intf_thread_t *p_intf )
{
    char *pp_argv[] = { "" };
    int   i_argc    = 1;

    /* Allocate instance and initialize some members */
    p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
    if( p_intf->p_sys == NULL )
    {
171
        msg_Err( p_intf, "out of memory" );
172
        return 1;
Sam Hocevar's avatar
 
Sam Hocevar committed
173
174
175
176
177
178
179
180
181
    }

    /* Create the C++ objects */
    p_intf->p_sys->p_app = new QApplication( i_argc, pp_argv );
    p_intf->p_sys->p_window = new IntfWindow( p_intf );

    /* Tell the world we are here */
    p_intf->p_sys->p_window->setCaption( VOUT_TITLE " (Qt interface)" );

182
183
184
    p_intf->p_sys->p_input = NULL;

    return 0;
Sam Hocevar's avatar
 
Sam Hocevar committed
185
186
187
188
189
190
191
}

/*****************************************************************************
 * intf_Close: destroy interface window
 *****************************************************************************/
static void intf_Close( intf_thread_t *p_intf )
{
192
193
194
195
196
    if( p_intf->p_sys->p_input )
    {
        vlc_object_release( p_intf->p_sys->p_input );
    }

Sam Hocevar's avatar
 
Sam Hocevar committed
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
    /* Get rid of the C++ objects */
    delete p_intf->p_sys->p_window;
    delete p_intf->p_sys->p_app;

    /* Destroy structure */
    free( p_intf->p_sys );
}

/*****************************************************************************
 * intf_Run: Qt thread
 *****************************************************************************
 * This part of the interface is in a separate thread so that we can call
 * exec() from within it without annoying the rest of the program.
 *****************************************************************************/
static void intf_Run( intf_thread_t *p_intf )
{
    p_intf->p_sys->p_window->show();

    p_intf->p_sys->p_app->exec();
}

/* following functions are local */

/*****************************************************************************
 * IntfWindow: interface window creator
 *****************************************************************************
 * This function creates the interface window, and populates it with a
 * menu bar, a toolbar and a slider.
 *****************************************************************************/
IntfWindow::IntfWindow( intf_thread_t *p_intf )
           :QMainWindow( 0 )
{
    setUsesTextLabel( TRUE );

    this->p_intf = p_intf;

    /*
     * Create the toolbar
     */

    p_toolbar = new QToolBar( this, "toolbar" );
    p_toolbar->setHorizontalStretchable( TRUE );

Sam Hocevar's avatar
   
Sam Hocevar committed
240
241
    QIconSet * set = new QIconSet();
    QPixmap pixmap = set->pixmap( QIconSet::Automatic, QIconSet::Normal );
Sam Hocevar's avatar
 
Sam Hocevar committed
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364

#define addbut( l, t, s ) new QToolButton( pixmap, l, t, this, s, p_toolbar );
    addbut( "Open", "Open a File", SLOT(FileOpen()) );
    addbut( "Disc", "Open a DVD or VCD", SLOT(Unimplemented()) );
    addbut( "Net", "Select a Network Stream", SLOT(Unimplemented()) );
    p_toolbar->addSeparator();
    addbut( "Back", "Rewind Stream", SLOT(Unimplemented()) );
    addbut( "Stop", "Stop Stream", SLOT(Unimplemented()) );
    addbut( "Play", "Play Stream", SLOT(PlaybackPlay()) );
    addbut( "Pause", "Pause Stream", SLOT(PlaybackPause()) );
    addbut( "Slow", "Play Slower", SLOT(PlaybackSlow()) );
    addbut( "Fast", "Play Faster", SLOT(PlaybackFast()) );
    p_toolbar->addSeparator();
    addbut( "Playlist", "Open Playlist", SLOT(Unimplemented()) );
    addbut( "Prev", "Previous File", SLOT(PlaylistPrev()) );
    addbut( "Next", "Next File", SLOT(PlaylistNext()) );
#undef addbut

    /* 
     * Create the menubar
     */

    QPopupMenu * p_tmpmenu = new QPopupMenu( this );

#define instmp( x, y... ) p_tmpmenu->insertItem( x, this, ## y )
    menuBar()->insertItem( "&File", p_tmpmenu );
    instmp( "&Open File...", SLOT(FileOpen()), Key_F3 );
    instmp( "Open &Disc...", SLOT(Unimplemented()), Key_F4 );
    instmp( "&Network Stream...", SLOT(Unimplemented()), Key_F5 );
    p_tmpmenu->insertSeparator();
    instmp( "&Exit", SLOT(FileQuit()), CTRL+Key_Q );

    p_tmpmenu = new QPopupMenu( this );
    menuBar()->insertItem( "&View", p_tmpmenu );
    instmp( "&Playlist...", SLOT(Unimplemented()) );
    instmp( "&Modules...", SLOT(Unimplemented()) );

    p_tmpmenu = new QPopupMenu( this );
    menuBar()->insertItem( "&Settings", p_tmpmenu );
    instmp( "&Preferences...", SLOT(Unimplemented()) );

    p_tmpmenu = new QPopupMenu( this );
    menuBar()->insertItem( "&Help", p_tmpmenu );
    instmp( "&About...", SLOT(About()) );
#undef instmp

    /*
     * Create the popup menu
     */

    p_popup = new QPopupMenu( /* floating menu */ );

#define inspop( x, y... ) p_popup->insertItem( x, this, ## y )
    inspop( "&Play", SLOT(PlaybackPlay()) );
    inspop( "Pause", SLOT(PlaybackPause()) );
    inspop( "&Slow", SLOT(PlaybackSlow()) );
    inspop( "&Fast", SLOT(PlaybackFast()) );
    p_popup->insertSeparator();
    inspop( "&Open File...", SLOT(FileOpen()), Key_F3 );
    inspop( "Open &Disc...", SLOT(Unimplemented()), Key_F4 );
    inspop( "&Network Stream...", SLOT(Unimplemented()), Key_F5 );
    p_popup->insertSeparator();
    inspop( "&About...", SLOT(About()) );
    inspop( "&Exit", SLOT(FileQuit()) );
#undef inspop

    /* Activate the statusbar */
    statusBar();

    /* Add the vertical box */
    QVBox * p_vbox = new QVBox( this );
    setCentralWidget( p_vbox );

        /* The horizontal box */
        QHBox * p_hbox = new QHBox( p_vbox );

            /* The date label */
            p_date  = new QLabel( p_hbox );
            p_date->setAlignment( AlignHCenter | AlignVCenter );
            p_date->setText( "-:--:--" );

            /* The status label */
            QLabel *p_label  = new QLabel( p_hbox );
            p_label->setAlignment( AlignHCenter | AlignVCenter );
            p_label->setText( "Status: foo" );

            /* The bar label */
            p_label  = new QLabel( p_hbox );
            p_label->setAlignment( AlignHCenter | AlignVCenter );
            p_label->setText( "Bar: baz quux" );

        /* Create the slider and connect it to the date label */
        p_slider = new IntfSlider( p_intf, p_vbox );

        connect( p_slider, SIGNAL(valueChanged(int)),
                 this, SLOT(DateDisplay(int)) );

    /* The timer */
    QTimer *p_timer = new QTimer( this );
    connect( p_timer, SIGNAL(timeout()), this, SLOT(Manage()) );
    p_timer->start( INTF_IDLE_SLEEP / 1000 );

    /* Everything worked fine */
    resize( 620, 30 );
}

/*****************************************************************************
 * ~IntfWindow: interface window destructor
 *****************************************************************************
 * This function is called when the interface window is destroyed.
 *****************************************************************************/
IntfWindow::~IntfWindow( void )
{
    /* FIXME: remove everything cleanly */
}

/*****************************************************************************
 * DateDisplay: display date
 *****************************************************************************
 * This function displays the current date in the date label.
 *****************************************************************************/
void IntfWindow::DateDisplay( int i_range )
{
365
    if( p_intf->p_sys->p_input )
Sam Hocevar's avatar
 
Sam Hocevar committed
366
367
368
    {
        char psz_time[ OFFSETTOTIME_MAX_SIZE ];

369
370
371
372
373
        vlc_mutex_lock( &p_intf->p_sys->p_input->stream.stream_lock );
        p_date->setText( input_OffsetToTime( p_intf->p_sys->p_input, psz_time,
           ( p_intf->p_sys->p_input->stream.p_selected_area->i_size * i_range )
               / SLIDER_MAX ) );
        vlc_mutex_unlock( &p_intf->p_sys->p_input->stream.stream_lock );
Sam Hocevar's avatar
 
Sam Hocevar committed
374
375
376
377
378
379
380
381
382
383
384
    }
}

/*****************************************************************************
 * FileOpen: open a file
 *****************************************************************************
 * This function opens a file requester and adds the selected file to
 * the playlist.
 *****************************************************************************/
void IntfWindow::FileOpen( void )
{
385
    playlist_t *p_playlist;
Sam Hocevar's avatar
 
Sam Hocevar committed
386
387
388
389
390
391
392
393
394
    QString file = QFileDialog::getOpenFileName( QString::null,
                                                 QString::null, this );

    if( file.isEmpty() )
    {
        statusBar()->message( "No file loaded", 2000 );
    }
    else
    {
395
396
397
398
399
400
401
402
403
404
        p_playlist = (playlist_t *)
                vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
        if( p_playlist == NULL )
        {
            return;
        }

        playlist_Add( p_playlist, file.latin1(),
                      PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
        vlc_object_release( p_playlist );
Sam Hocevar's avatar
 
Sam Hocevar committed
405
406
407
408
409
410
411
412
413
414
415
416
    }
}

/*****************************************************************************
 * About: display the "about" box
 *****************************************************************************
 * This function displays a simple "about" box with copyright information.
 *****************************************************************************/
void IntfWindow::About( void )
{
    QMessageBox::about( this, "About",
        "VideoLAN Client\n"
Sam Hocevar's avatar
   
Sam Hocevar committed
417
        "(C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 - the VideoLAN Team\n"
Sam Hocevar's avatar
 
Sam Hocevar committed
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
        "\n"
        "This is the VideoLAN client, a DVD and MPEG player.\n"
        "It can play MPEG and MPEG 2 files from a file "
            "or from a network source.\n"
        "\n"
        "More information: http://www.videolan.org/" );
}

/*****************************************************************************
 * Manage: manage main thread messages
 *****************************************************************************
 * In this function, called approx. 10 times a second, we check what the
 * main program wanted to tell us.
 *****************************************************************************/
void IntfWindow::Manage( void )
{
434
435
436
437
438
439
440
441
442
443
444
    /* Update the input */
    if( p_intf->p_sys->p_input == NULL )
    {
        p_intf->p_sys->p_input = (input_thread_t *)
                vlc_object_find( p_intf, VLC_OBJECT_INPUT, FIND_ANYWHERE );
    }
    else if( p_intf->p_sys->p_input->b_dead )
    {
        vlc_object_release( p_intf->p_sys->p_input );
        p_intf->p_sys->p_input = NULL;
    }
445

Sam Hocevar's avatar
 
Sam Hocevar committed
446
    /* Manage the slider */
447
    if( p_intf->p_sys->p_input && p_intf->p_sys->p_input->stream.b_seekable )
Sam Hocevar's avatar
 
Sam Hocevar committed
448
449
450
    {
        int i_value = p_slider->value();

451
#define p_area p_intf->p_sys->p_input->stream.p_selected_area
Sam Hocevar's avatar
 
Sam Hocevar committed
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
        /* If the user hasn't touched the slider since the last time,
         * then the input can safely change it */
        if( i_value == p_slider->oldvalue() )
        {
            i_value = ( SLIDER_MAX * p_area->i_tell ) / p_area->i_size;

            p_slider->setValue( i_value );
            p_slider->setOldValue( i_value );
        }
        /* Otherwise, send message to the input if the user has
         * finished dragging the slider */
        else if( p_slider->b_free )
        {
            off_t i_seek = ( i_value * p_area->i_size ) / SLIDER_MAX;

467
            input_Seek( p_intf->p_sys->p_input, i_seek, INPUT_SEEK_SET );
Sam Hocevar's avatar
 
Sam Hocevar committed
468
469
470
471
472
473
474

            /* Update the old value */
            p_slider->setOldValue( i_value );
        }
#undef p_area
    }

Sam Hocevar's avatar
   
Sam Hocevar committed
475
    /* If the "display popup" flag has changed, popup the context menu */
Sam Hocevar's avatar
 
Sam Hocevar committed
476
477
    if( p_intf->b_menu_change )
    {
Sam Hocevar's avatar
   
Sam Hocevar committed
478
        p_popup->popup( QCursor::pos() );
Sam Hocevar's avatar
 
Sam Hocevar committed
479
480
481
        p_intf->b_menu_change = 0;
    }

482
    if( p_intf->p_vlc->b_die )
Sam Hocevar's avatar
 
Sam Hocevar committed
483
484
485
486
487
488
489
490
491
492
    {
        qApp->quit();
    }
}

/*****************************************************************************
 * PlaybackPlay: play
 *****************************************************************************/
void IntfWindow::PlaybackPlay( void )
{
493
    if( p_intf->p_sys->p_input != NULL )
Sam Hocevar's avatar
 
Sam Hocevar committed
494
    {
495
        input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PLAY );
Sam Hocevar's avatar
 
Sam Hocevar committed
496
497
498
499
500
501
502
503
    }
}

/*****************************************************************************
 * PlaybackPause: pause
 *****************************************************************************/
void IntfWindow::PlaybackPause( void )
{
504
    if( p_intf->p_sys->p_input != NULL )
Sam Hocevar's avatar
 
Sam Hocevar committed
505
    {
506
        input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_PAUSE );
Sam Hocevar's avatar
 
Sam Hocevar committed
507
508
509
510
511
512
513
514
    }
}

/*****************************************************************************
 * PlaybackSlow: slow
 *****************************************************************************/
void IntfWindow::PlaybackSlow( void )
{
515
    if( p_intf->p_sys->p_input != NULL )
Sam Hocevar's avatar
 
Sam Hocevar committed
516
    {
517
        input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_SLOWER );
Sam Hocevar's avatar
 
Sam Hocevar committed
518
519
520
521
522
523
524
525
    }
}

/*****************************************************************************
 * PlaybackFast: fast
 *****************************************************************************/
void IntfWindow::PlaybackFast( void )
{
526
    if( p_intf->p_sys->p_input != NULL )
Sam Hocevar's avatar
 
Sam Hocevar committed
527
    {
528
        input_SetStatus( p_intf->p_sys->p_input, INPUT_STATUS_FASTER );
Sam Hocevar's avatar
 
Sam Hocevar committed
529
530
531
532
533
534
535
536
    }
}

/*****************************************************************************
 * PlaylistPrev: previous playlist entry
 *****************************************************************************/
void IntfWindow::PlaylistPrev( void )
{
537
538
539
540
    playlist_t *p_playlist = (playlist_t *)
        vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );

    if( p_playlist == NULL )
Sam Hocevar's avatar
 
Sam Hocevar committed
541
    {
542
        return;
Sam Hocevar's avatar
 
Sam Hocevar committed
543
    }
544
545
546

    playlist_Prev( p_playlist );
    vlc_object_release( p_playlist );
Sam Hocevar's avatar
 
Sam Hocevar committed
547
548
549
550
551
552
553
}

/*****************************************************************************
 * PlaylistNext: next playlist entry
 *****************************************************************************/
void IntfWindow::PlaylistNext( void )
{
554
555
556
557
    playlist_t *p_playlist = (playlist_t *)
        vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );

    if( p_playlist == NULL )
Sam Hocevar's avatar
 
Sam Hocevar committed
558
    {
559
        return;
Sam Hocevar's avatar
 
Sam Hocevar committed
560
    }
561
562
563

    playlist_Next( p_playlist );
    vlc_object_release( p_playlist );
Sam Hocevar's avatar
 
Sam Hocevar committed
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
}

/*****************************************************************************
 * IntfSlider: slider creator
 *****************************************************************************
 * This function creates the slider, sets its default values, and connects
 * the interesting signals.
 *****************************************************************************/
IntfSlider::IntfSlider( intf_thread_t *p_intf, QWidget *p_parent )
           :QSlider( Horizontal, p_parent )
{
    this->p_intf = p_intf;

    setRange( SLIDER_MIN, SLIDER_MAX );
    setPageStep( SLIDER_STEP );

    setValue( SLIDER_MIN );
    setOldValue( SLIDER_MIN );

    setTracking( TRUE );
    b_free = TRUE;

    connect( this, SIGNAL(sliderMoved(int)), this, SLOT(SlideStart()) );
    connect( this, SIGNAL(sliderPressed()), this, SLOT(SlideStart()) );
    connect( this, SIGNAL(sliderReleased()), this, SLOT(SlideStop()) );
}

/*****************************************************************************
 * ~IntfSlider: slider destructor
 *****************************************************************************
 * This function is called when the interface slider is destroyed.
 *****************************************************************************/
IntfSlider::~IntfSlider( void )
{
    /* We don't need to remove anything */
}