vlm_panel.cpp 18.3 KB
Newer Older
1 2 3 4
/*****************************************************************************
 * vlm_panel.cpp: VLM Panel
 *****************************************************************************
 * Copyright (C) 2000-2005 the VideoLAN team
5
 * $Id$
6
 *
7
 * Authors: Clément Stenac <zorglub@videolan.org>
8 9 10 11 12 13 14 15 16 17 18 19 20
 *
 * 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
Antoine Cellerier's avatar
Antoine Cellerier committed
21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 23 24 25 26 27
 *****************************************************************************/

#include "dialogs/vlm/vlm_panel.hpp"
#include "dialogs/vlm/vlm_wrapper.hpp"
#include "dialogs/vlm/vlm_stream.hpp"
#include "dialogs/vlm/vlm_streampanel.hpp"
Yoann Peronneau's avatar
Yoann Peronneau committed
28
#include <wx/statline.h>
29

30 31
#include "charset.h"

32 33 34 35
enum
{
    Notebook_Event,
    Timer_Event,
36 37 38
    Close_Event,
    Load_Event,
    Save_Event,
39 40 41 42
};

BEGIN_EVENT_TABLE( VLMPanel, wxPanel)
   EVT_TIMER( Timer_Event, VLMPanel::OnTimer )
43
   EVT_BUTTON( wxID_CLOSE, VLMPanel::OnClose )
44
   EVT_BUTTON( Load_Event, VLMPanel::OnLoad )
45
   EVT_BUTTON( wxID_SAVE, VLMPanel::OnSave )
46 47 48 49 50 51 52 53
END_EVENT_TABLE()


VLMPanel::VLMPanel( intf_thread_t *_p_intf, wxWindow *_p_parent ) :
        wxPanel( _p_parent, -1, wxDefaultPosition, wxDefaultSize ),
       timer( this, Timer_Event )
{
    p_intf = _p_intf;
54
    p_parent = _p_parent;
55 56 57 58 59 60 61 62 63 64 65 66 67

    p_vlm = new VLMWrapper( p_intf );
    p_vlm->AttachVLM();

    SetAutoLayout( TRUE );

    wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );

    p_notebook = new wxNotebook( this, Notebook_Event );
#if (!wxCHECK_VERSION(2,5,0))
    wxNotebookSizer *notebook_sizer = new wxNotebookSizer( p_notebook );
#endif
    p_notebook->AddPage( BroadcastPanel( p_notebook ), wxU( _("Broadcasts") ) );
68
#if 0
69
    p_notebook->AddPage( VODPanel( p_notebook ), wxU( _("VOD") ) );
70
#endif
71 72 73 74 75 76
#if (!wxCHECK_VERSION(2,5,0))
    panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 );
#else
    panel_sizer->Add( p_notebook, 1 , wxEXPAND | wxALL, 5 );
#endif

77
    wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
78
    button_sizer->Add( new wxButton( this, wxID_CLOSE ));
79 80
    button_sizer->Add( 0, 0, 1 );
    button_sizer->Add( new wxButton( this, Load_Event, wxU(_("Load") ) ), 0, wxRIGHT, 10 );
81
    button_sizer->Add( new wxButton( this, wxID_SAVE ));
82 83
    panel_sizer->Add( button_sizer, 0 , wxEXPAND | wxALL, 5 );

84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 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 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
    panel_sizer->Layout();
    SetSizerAndFit( panel_sizer );

    Update();

    timer.Start( 300 );
}

VLMPanel::~VLMPanel()
{
    delete p_vlm;
}

void VLMPanel::OnTimer( wxTimerEvent& event )
{
    Update();
}

void VLMPanel::Update()
{
    unsigned int i;
    for( i = 0 ; i < broadcasts.size(); i++ )
    {
        ((VLMBroadcastStreamPanel *)broadcasts[i])->b_found = VLC_FALSE;
    }
    for( i = 0 ; i < vods.size(); i++ )
    {
        ((VLMVODStreamPanel *)vods[i])->b_found = VLC_FALSE;
    }

    p_vlm->LockVLM();
    /* Iterate over the media, to find the panels to add / remove */
    /* FIXME: This code should be better wrapped */
    for( i = 0; i < p_vlm->NbMedia(); i++ )
    {
        vlm_media_t *p_media = p_vlm->GetMedia( i );

        if( p_media->i_type == BROADCAST_TYPE )
        {
            vlc_bool_t b_foundthis = VLC_FALSE;
            for( unsigned int j = 0 ; j < broadcasts.size(); j++ )
            {
                VLMBroadcastStreamPanel *p_streamp =
                       (VLMBroadcastStreamPanel *)(broadcasts[j]);
                /* FIXME: dangerous .. */
                if( p_streamp->GetStream()->p_media ==  p_media )
                {
                    p_streamp->b_found = VLC_TRUE;
                    b_foundthis = VLC_TRUE;
                    break;
                }
            }
            /* Create the stream */
            if( !b_foundthis )
            {
                VLMBroadcastStream *p_broadcast =
                        new VLMBroadcastStream( p_intf, p_media, p_vlm );
                AppendBroadcast( p_broadcast );
            }
        }
        else if( p_media->i_type == VOD_TYPE )
        {
            vlc_bool_t b_foundthis = VLC_FALSE;
            for( unsigned int j = 0 ; i < vods.size(); i++ )
            {
                VLMVODStreamPanel *p_streamp = (VLMVODStreamPanel *)( vods[j] );
                if(  p_streamp->GetStream()->p_media ==  p_media )
                {
                    p_streamp->b_found = VLC_TRUE;
                    b_foundthis = VLC_TRUE;
                    break;
                }
            }
            /* Create it */
            if( !b_foundthis )
            {
                VLMVODStream *p_vod = new VLMVODStream(p_intf, p_media, p_vlm );
                AppendVOD( p_vod );
            }
        }
    }

    /* Those not marked as found must be removed */
    vector<VLMBroadcastStreamPanel *>::iterator it = broadcasts.begin();
    while( it < broadcasts.end() )
    {
        if( (*it)->b_found == VLC_FALSE )
        {
            vector<VLMBroadcastStreamPanel *>::iterator rem = it;
            it++;
            VLMBroadcastStreamPanel *p_remove = *rem;
            broadcasts.erase( rem );
            RemoveBroadcast( p_remove );
            delete p_remove;
        }
        else
            it++;
    }
    vector<VLMVODStreamPanel *>::iterator it2 = vods.begin();
    while( it2 < vods.end() )
    {
        if( (*it2)->b_found == VLC_FALSE )
        {
            vector<VLMVODStreamPanel *>::iterator rem = it2;
            it2++;
            VLMVODStreamPanel *p_remove = *rem;
            vods.erase( rem );
            RemoveVOD( p_remove );
            delete p_remove;
        }
        else
            it2++;
    }

    /* Update sliders*/
    for( unsigned int j = 0 ; j < broadcasts.size(); j++ )
    {
        VLMBroadcastStreamPanel *p_streamp =
                (VLMBroadcastStreamPanel *)( broadcasts[j] );
        p_streamp->Update();
    }
    p_vlm->UnlockVLM();
}

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
void VLMPanel::OnClose( wxCommandEvent &event )
{
    ((VLMFrame*)p_parent)->OnClose( *( new wxCloseEvent() ) );
}

void VLMPanel::OnLoad( wxCommandEvent &event )
{
    p_file_dialog = new wxFileDialog( NULL, wxT(""), wxT(""), wxT(""),
                                      wxT("*"), wxOPEN | wxMULTIPLE );
    if( p_file_dialog == NULL ) return;

    p_file_dialog->SetTitle( wxU(_("Load configuration") ) );
    if( p_file_dialog->ShowModal() == wxID_OK )
    {
        vlm_Load( p_vlm->GetVLM(), p_file_dialog->GetPath().mb_str() );
    }
    Update();
}

void VLMPanel::OnSave( wxCommandEvent &event )
{
    p_file_dialog = new wxFileDialog( NULL, wxT(""), wxT(""), wxT(""),
                                      wxT("*"), wxSAVE | wxOVERWRITE_PROMPT );
    if( p_file_dialog == NULL ) return;

    p_file_dialog->SetTitle( wxU(_("Save configuration") ) );
    if( p_file_dialog->ShowModal() == wxID_OK )
    {
        vlm_Save( p_vlm->GetVLM(), p_file_dialog->GetPath().mb_str() );
    }
}

240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
/*************************
 * Broadcasts management
 *************************/
wxPanel * VLMPanel::BroadcastPanel( wxWindow *parent )
{
     broadcasts_panel = new wxPanel( parent, -1, wxDefaultPosition, wxSize( 500, 350 ) );
     broadcasts_sizer = new wxBoxSizer( wxVERTICAL );

     wxStaticBox *add_box = new wxStaticBox( broadcasts_panel, -1,
                                            wxU( _( "New broadcast") ) );
     wxStaticBoxSizer *box_sizer = new wxStaticBoxSizer( add_box, wxHORIZONTAL );
     box_sizer->Add( AddBroadcastPanel( broadcasts_panel), 0, wxEXPAND|wxALL, 5 );
     box_sizer->Layout();

     broadcasts_sizer->Add( box_sizer, 0, wxEXPAND|wxALL, 5 );

256
     wxStaticLine *static_line = new wxStaticLine( broadcasts_panel, wxID_ANY );
Yoann Peronneau's avatar
Yoann Peronneau committed
257 258
     broadcasts_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );

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
     scrolled_broadcasts = new wxScrolledWindow( broadcasts_panel, -1,
                                wxDefaultPosition, wxDefaultSize,
                                wxBORDER_NONE | wxVSCROLL );

     scrolled_broadcasts_sizer = new wxBoxSizer( wxVERTICAL );
     scrolled_broadcasts->SetAutoLayout( TRUE );
     scrolled_broadcasts->SetScrollRate( 5,5 );
     scrolled_broadcasts->SetSizerAndFit( scrolled_broadcasts_sizer );

     broadcasts_sizer->Add( scrolled_broadcasts, 1, wxEXPAND| wxALL, 5 );
     broadcasts_sizer->Layout();

     broadcasts_panel->SetSizerAndFit( broadcasts_sizer );

     return broadcasts_panel;
}

wxPanel * VLMPanel::AddBroadcastPanel( wxPanel *panel )
{
     return new VLMAddStreamPanel( p_intf, panel, p_vlm, VLC_FALSE,
                                   VLC_TRUE );
}

void VLMPanel::AppendBroadcast( VLMBroadcastStream *p_broadcast )
{
    VLMBroadcastStreamPanel *p_new =
                   new VLMBroadcastStreamPanel( p_intf, scrolled_broadcasts,
                                                p_broadcast );
    p_new->b_found = VLC_TRUE;
    scrolled_broadcasts_sizer->Add( p_new, 0, wxEXPAND | wxALL, 5 );
    scrolled_broadcasts_sizer->Layout();
    scrolled_broadcasts->FitInside();
    broadcasts.push_back( p_new );
}

void VLMPanel::RemoveBroadcast( VLMBroadcastStreamPanel *p_streamp )
{
    scrolled_broadcasts_sizer->Remove( p_streamp );
    scrolled_broadcasts_sizer->Layout();
    scrolled_broadcasts->FitInside();
}

/*************************
 * VODS management
 *************************/
wxPanel * VLMPanel::VODPanel( wxWindow *parent )
{
     vods_panel = new wxPanel( parent, -1, wxDefaultPosition, wxSize( 500, 350 ) );
     return vods_panel;
}

wxPanel * VLMPanel::AddVODPanel( wxPanel *panel )
{
     return new VLMAddStreamPanel( p_intf, panel, p_vlm, VLC_FALSE,
                                   VLC_FALSE );
}

void VLMPanel::AppendVOD( VLMVODStream *p_vod )
{
    VLMVODStreamPanel *p_new =
                   new VLMVODStreamPanel( p_intf, scrolled_vods, p_vod );
    p_new->b_found = VLC_TRUE;
    scrolled_vods_sizer->Add( p_new, 0, wxEXPAND | wxALL, 5 );
    scrolled_vods_sizer->Layout();
    scrolled_vods->FitInside();
    vods.push_back( p_new );
}

void VLMPanel::RemoveVOD( VLMVODStreamPanel *p_streamp )
{
    scrolled_vods_sizer->Remove( p_streamp );
    scrolled_vods_sizer->Layout();
    scrolled_vods->FitInside();
}

/****************************************************************************
 * VLM Add Broadcast panel implementation
 *****************************************************************************/
enum
{
    Create_Event,
    Clear_Event,
    ChooseInput_Event,
    ChooseOutput_Event,
};

BEGIN_EVENT_TABLE( VLMAddStreamPanel, wxPanel)
   EVT_BUTTON( Create_Event, VLMAddStreamPanel::OnCreate )
   EVT_BUTTON( Clear_Event, VLMAddStreamPanel::OnClear )
348 349
   EVT_BUTTON( ChooseInput_Event, VLMAddStreamPanel::OnChooseInput )
   EVT_BUTTON( ChooseOutput_Event, VLMAddStreamPanel::OnChooseOutput )
350 351 352 353 354 355 356 357
END_EVENT_TABLE()

VLMAddStreamPanel::VLMAddStreamPanel( intf_thread_t *_p_intf,
                wxWindow *_p_parent, VLMWrapper *_p_vlm,
                vlc_bool_t _b_edit, vlc_bool_t _b_broadcast ):
                wxPanel( _p_parent, -1, wxDefaultPosition, wxDefaultSize )
{
    p_intf = _p_intf;
358
    p_parent = _p_parent;
359 360 361 362
    p_vlm = _p_vlm;
    b_edit = _b_edit;
    b_broadcast = _b_broadcast;

363 364 365
    p_open_dialog = NULL;
    p_sout_dialog = NULL;

366 367 368 369
    SetAutoLayout( TRUE );

    wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );

Yoann Peronneau's avatar
Yoann Peronneau committed
370 371 372
    wxFlexGridSizer *upper_sizer = new wxFlexGridSizer( 5, 2 );
    upper_sizer->AddGrowableCol( 1 );
    upper_sizer->AddGrowableCol( 3 );
373

Yoann Peronneau's avatar
Yoann Peronneau committed
374 375
    upper_sizer->Add( new wxStaticText( this, -1, wxU( _("Name") ) ), 0,
                                        wxALIGN_CENTER_VERTICAL, 0 );
376
    name_text = new wxTextCtrl( this, -1, wxU( "" ), wxDefaultPosition,
377 378 379
                                          wxSize( 150, -1 ) );
    upper_sizer->Add( name_text , 1, wxEXPAND | wxLEFT | wxRIGHT, 5 );

Yoann Peronneau's avatar
Yoann Peronneau committed
380 381
    upper_sizer->Add( new wxStaticText( this, -1, wxU( _("Input") ) ), 0,
                                        wxALIGN_CENTER_VERTICAL, 0 );
382
    input_text = new wxTextCtrl( this, -1, wxU( "" ) ,
383 384 385 386 387 388 389
                      wxDefaultPosition, wxSize( 150, -1 ) );
    upper_sizer->Add( input_text , 1, wxEXPAND | wxLEFT | wxRIGHT, 5 );
    upper_sizer->Add( new wxButton( this, ChooseInput_Event, wxU( _("Choose") )  ) );

    upper_sizer->Add( 0,0 );
    upper_sizer->Add( 0,0 );

Yoann Peronneau's avatar
Yoann Peronneau committed
390 391
    upper_sizer->Add( new wxStaticText( this, -1, wxU( _("Output") ) ), 0,
                                        wxALIGN_CENTER_VERTICAL, 0 );
392
    output_text = new wxTextCtrl( this, -1, wxU( "" ) ,
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
                      wxDefaultPosition, wxSize( 150, -1 ) );
    upper_sizer->Add( output_text, 1, wxEXPAND | wxLEFT | wxRIGHT, 5 );
    upper_sizer->Add( new wxButton( this, ChooseOutput_Event,
                      wxU( _("Choose") )  ) );

    panel_sizer->Add( upper_sizer, 0, wxEXPAND | wxALL, 5 );

    wxBoxSizer *lower_sizer = new wxBoxSizer( wxHORIZONTAL );
    enabled_checkbox = new wxCheckBox( this, -1, wxU( _("Enabled" ) ) );
    enabled_checkbox->SetValue( true );
    lower_sizer->Add( enabled_checkbox,  1 , wxEXPAND | wxALL , 5 );
    if( b_broadcast )
    {
        loop_checkbox = new wxCheckBox( this, -1, wxU( _("Loop" ) ) );
        lower_sizer->Add( loop_checkbox,  1 , wxEXPAND | wxALL , 5 );
    }

410 411
    if( !b_edit )
    {
412
        lower_sizer->Add( new wxButton( this, wxID_CLEAR ),
413 414 415 416 417 418 419
                         0 , wxEXPAND | wxALL , 5 );
    }
    lower_sizer->Add( new wxButton( this, Create_Event,
                          wxU( _( b_edit ? "OK" : "Create" ) ) ),
                      0 , wxEXPAND | wxALL , 5 );


420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
    panel_sizer->Add( lower_sizer, 0 , wxEXPAND| wxALL, 5 );
    panel_sizer->Layout();
    SetSizerAndFit( panel_sizer );
}

VLMAddStreamPanel::~VLMAddStreamPanel()
{
}

void VLMAddStreamPanel::Load( VLMStream *p_stream )
{
    name_text->SetValue( wxU( p_stream->p_media->psz_name ) );
    name_text->SetEditable( false );
    if( p_stream->p_media->i_input > 0 )
    {
        input_text->SetValue( wxU( p_stream->p_media->input[0] ) );
    }
    output_text->SetValue( wxU( p_stream->p_media->psz_output ) );
    enabled_checkbox->SetValue( p_stream->p_media->b_enabled );
    if( b_broadcast)
        loop_checkbox->SetValue( p_stream->p_media->b_loop );
}

void VLMAddStreamPanel::OnCreate( wxCommandEvent &event )
{
    char *psz_name = FromLocale( name_text->GetValue().mb_str() );
    char *psz_input = FromLocale(  input_text->GetValue().mb_str() );
    char *psz_output = FromLocale( output_text->GetValue().mb_str() );
    if( b_broadcast && ! b_edit )
    {
        p_vlm->AddBroadcast( psz_name, psz_input, psz_output,
                         enabled_checkbox->IsChecked() ? VLC_TRUE: VLC_FALSE,
                         loop_checkbox->IsChecked() ? VLC_TRUE : VLC_FALSE );
    }
    else if( b_broadcast && b_edit )
    {
        p_vlm->EditBroadcast( psz_name, psz_input, psz_output,
                        enabled_checkbox->IsChecked() ? VLC_TRUE: VLC_FALSE,
                        loop_checkbox->IsChecked() ? VLC_TRUE : VLC_FALSE );
    }
    else if( !b_broadcast && !b_edit )
    {
        p_vlm->AddVod( psz_name, psz_input, psz_output,
                       enabled_checkbox->IsChecked() ? VLC_TRUE: VLC_FALSE,
                       loop_checkbox->IsChecked() ? VLC_TRUE : VLC_FALSE );
    }
    else
    {
        p_vlm->EditVod( psz_name, psz_input, psz_output,
                        enabled_checkbox->IsChecked() ? VLC_TRUE: VLC_FALSE,
                        loop_checkbox->IsChecked() ? VLC_TRUE : VLC_FALSE );
    }
    LocaleFree( psz_name) ; LocaleFree( psz_input ) ;
    LocaleFree( psz_output);
    if( !b_edit )
        OnClear( event );
476 477
    if( b_edit )
        p_parent->Hide();
478 479 480 481 482 483 484 485 486
}

void VLMAddStreamPanel::OnClear( wxCommandEvent &event )
{
    name_text->SetValue( wxU("") );
    input_text->SetValue( wxU("") );
    output_text->SetValue( wxU("") );
}

487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507
void VLMAddStreamPanel::OnChooseInput( wxCommandEvent &event )
{
    if( p_open_dialog == NULL )
        p_open_dialog = new OpenDialog( p_intf, this, -1, -1, OPEN_STREAM );

    if( p_open_dialog && p_open_dialog->ShowModal() == wxID_OK )
    {
        input_text->SetValue( p_open_dialog->mrl[0] );
    }
}

void VLMAddStreamPanel::OnChooseOutput( wxCommandEvent &event )
{
    if( p_sout_dialog == NULL )
        p_sout_dialog = new SoutDialog( p_intf, this );

    if( p_sout_dialog && p_sout_dialog->ShowModal() == wxID_OK )
    {
        output_text->SetValue( (p_sout_dialog->GetOptions())[0] );
    }
}
508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573

/****************************************************************************
 * VLM Frame implementation
 ****************************************************************************/
enum
{
};

BEGIN_EVENT_TABLE( VLMFrame, wxFrame )
    EVT_CLOSE( VLMFrame::OnClose )
END_EVENT_TABLE()

VLMFrame::VLMFrame( intf_thread_t *_p_intf, wxWindow *_p_parent ) :
        wxFrame( _p_parent, -1, wxU( _("VLM configuration") ),
        wxDefaultPosition, wxSize( 640,480 ), wxDEFAULT_FRAME_STYLE )
{
    SetIcon( *_p_intf->p_sys->p_icon );

    wxBoxSizer *main_sizer = new wxBoxSizer( wxHORIZONTAL );
    vlm_panel = new VLMPanel( _p_intf, this );

    main_sizer->Add( vlm_panel, 1, wxEXPAND | wxALL, 5 );
    main_sizer->Layout();
    SetSizerAndFit( main_sizer );
}

void VLMFrame::OnClose( wxCloseEvent& WXUNUSED(event) )
{
    Hide();
}

void VLMFrame::Update()
{
    vlm_panel->Update();
}

VLMFrame::~VLMFrame()
{
    delete vlm_panel;
}

/****************************************************************************
 * VLM Add stream Frame implementation
 ****************************************************************************/
VLMEditStreamFrame::VLMEditStreamFrame( intf_thread_t *_p_intf,
            wxWindow *_p_parent, VLMWrapper *_p_vlm, vlc_bool_t _b_broadcast,
            VLMStream *p_stream ) :
        wxFrame( _p_parent, -1, wxU( _("VLM stream") ),
        wxDefaultPosition, wxSize( 640,480 ), wxDEFAULT_FRAME_STYLE )
{
    SetIcon( *_p_intf->p_sys->p_icon );

    wxBoxSizer *main_sizer = new wxBoxSizer( wxHORIZONTAL );
    vlm_panel = new VLMAddStreamPanel( _p_intf, this, _p_vlm ,
                                       VLC_TRUE, _b_broadcast );

    vlm_panel->Load( p_stream );

    main_sizer->Add( vlm_panel, 1, wxEXPAND | wxALL, 5 );
    main_sizer->Layout();
    SetSizerAndFit( main_sizer );
}

VLMEditStreamFrame::~VLMEditStreamFrame()
{
}