1 /*****************************************************************************
\r
2 * sout.cpp: the stream ouput dialog box
\r
3 *****************************************************************************
\r
4 * Copyright (C) 2002-2003 VideoLAN
\r
5 * $Id: sout.cpp,v 1.4 2003/01/26 03:55:36 ipkiss Exp $
\r
7 * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
\r
9 * This program is free software; you can redistribute it and/or modify
\r
10 * it under the terms of the GNU General Public License as published by
\r
11 * the Free Software Foundation; either version 2 of the License, or
\r
12 * (at your option) any later version.
\r
14 * This program is distributed in the hope that it will be useful,
\r
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
17 * GNU General Public License for more details.
\r
19 * You should have received a copy of the GNU General Public License
\r
20 * along with this program; if not, write to the Free Software
\r
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
\r
22 *****************************************************************************/
\r
27 #include <vlc/vlc.h>
\r
28 #include <vlc/intf.h>
\r
32 #include "win32_common.h"
\r
34 //---------------------------------------------------------------------------
\r
35 #pragma link "CSPIN"
\r
36 #pragma resource "*.dfm"
\r
37 //---------------------------------------------------------------------------
\r
38 __fastcall TSoutDlg::TSoutDlg( TComponent* Owner, intf_thread_t *_p_intf )
\r
43 PanelAccess->BevelOuter = bvNone;
\r
44 PanelMux->BevelOuter = bvNone;
\r
48 //---------------------------------------------------------------------------
\r
49 void __fastcall TSoutDlg::ButtonBrowseClick( TObject *Sender )
\r
51 if( OpenDialog1->Execute() )
\r
53 EditFile->Text = OpenDialog1->FileName;
\r
57 //---------------------------------------------------------------------------
\r
58 void __fastcall TSoutDlg::CustomEditChange( TObject *Sender )
\r
62 //---------------------------------------------------------------------------
\r
63 void __fastcall TSoutDlg::RadioButtonMuxClick( TObject *Sender )
\r
67 //---------------------------------------------------------------------------
\r
68 void __fastcall TSoutDlg::RadioButtonAccessClick( TObject *Sender )
\r
70 bool b_file = RadioButtonFile->Checked;
\r
71 bool b_udp = RadioButtonUDP->Checked;
\r
72 bool b_rtp = RadioButtonRTP->Checked;
\r
74 EditFile->Enabled = b_file;
\r
75 ButtonBrowse->Enabled = b_file;
\r
76 LabelAddress->Enabled = b_udp | b_rtp;
\r
77 EditAddress->Enabled = b_udp | b_rtp;
\r
78 LabelPort->Enabled = b_udp | b_rtp;
\r
79 SpinEditPort->Enabled = b_udp | b_rtp;
\r
80 RadioButtonPS->Enabled = !b_rtp;
\r
82 if( b_udp || b_rtp )
\r
83 RadioButtonTS->Checked = true;
\r
87 //---------------------------------------------------------------------------
\r
88 void __fastcall TSoutDlg::ButtonOKClick( TObject *Sender )
\r
90 config_PutPsz( p_intf, "sout", EditMrl->Text.c_str() );
\r
92 //---------------------------------------------------------------------------
\r
95 /*****************************************************************************
\r
97 *****************************************************************************/
\r
98 void _fastcall TSoutDlg::RebuildMrl()
\r
100 AnsiString Mux, Mrl;
\r
102 if( RadioButtonPS->Checked )
\r
107 if( RadioButtonFile->Checked )
\r
108 Mrl = "file/" + Mux + "://" + EditFile->Text;
\r
109 else if( RadioButtonUDP->Checked )
\r
110 Mrl = "udp/" + Mux + "://" + EditAddress->Text + ":"
\r
111 + SpinEditPort->Value;
\r
113 Mrl = "rtp/" + Mux + "://" + EditAddress->Text + ":"
\r
114 + SpinEditPort->Value;
\r
116 EditMrl->Text = Mrl;
\r
118 //---------------------------------------------------------------------------
\r