]> git.sesse.net Git - vlc/blob - modules/gui/win32/sout.cpp
freetype.c: basic YUY2 rendering (Y only)
[vlc] / modules / gui / win32 / sout.cpp
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
6  *\r
7  * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>\r
8  *\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
13  *\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
18  *\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
23 \r
24 #include <vcl.h>\r
25 #pragma hdrstop\r
26 \r
27 #include <vlc/vlc.h>\r
28 #include <vlc/intf.h>\r
29 \r
30 #include "sout.h"\r
31 #include "misc.h"\r
32 #include "win32_common.h"\r
33 \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
39     : TForm( Owner )\r
40 {\r
41     p_intf = _p_intf;\r
42 \r
43     PanelAccess->BevelOuter = bvNone;\r
44     PanelMux->BevelOuter = bvNone;\r
45 \r
46     Translate( this );\r
47 }\r
48 //---------------------------------------------------------------------------\r
49 void __fastcall TSoutDlg::ButtonBrowseClick( TObject *Sender )\r
50 {\r
51     if( OpenDialog1->Execute() )\r
52     {\r
53         EditFile->Text = OpenDialog1->FileName;\r
54         RebuildMrl();\r
55     };\r
56 }\r
57 //---------------------------------------------------------------------------\r
58 void __fastcall TSoutDlg::CustomEditChange( TObject *Sender )\r
59 {\r
60     RebuildMrl();\r
61 }\r
62 //---------------------------------------------------------------------------\r
63 void __fastcall TSoutDlg::RadioButtonMuxClick( TObject *Sender )\r
64 {\r
65     RebuildMrl();\r
66 }\r
67 //---------------------------------------------------------------------------\r
68 void __fastcall TSoutDlg::RadioButtonAccessClick( TObject *Sender )\r
69 {\r
70     bool b_file = RadioButtonFile->Checked;\r
71     bool b_udp  = RadioButtonUDP->Checked;\r
72     bool b_rtp  = RadioButtonRTP->Checked;\r
73 \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
81 \r
82     if( b_udp || b_rtp )\r
83         RadioButtonTS->Checked = true;\r
84 \r
85     RebuildMrl();\r
86 }\r
87 //---------------------------------------------------------------------------\r
88 void __fastcall TSoutDlg::ButtonOKClick( TObject *Sender )\r
89 {\r
90     config_PutPsz( p_intf, "sout", EditMrl->Text.c_str() );\r
91 }\r
92 //---------------------------------------------------------------------------\r
93 \r
94 \r
95 /*****************************************************************************\r
96  * Private functions\r
97  *****************************************************************************/\r
98 void _fastcall TSoutDlg::RebuildMrl()\r
99 {\r
100     AnsiString Mux, Mrl;\r
101 \r
102     if( RadioButtonPS->Checked )\r
103         Mux = "ps";\r
104     else\r
105         Mux = "ts";\r
106 \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
112     else\r
113         Mrl = "rtp/" + Mux + "://" + EditAddress->Text + ":"\r
114               + SpinEditPort->Value;\r
115 \r
116     EditMrl->Text = Mrl;\r
117 }\r
118 //---------------------------------------------------------------------------\r
119 \r