Commit 0b9c1f07 authored by Olivier Teulière's avatar Olivier Teulière

* Added a dialog box for the stream output

parent 9d900426
......@@ -36,6 +36,7 @@
#include "preferences.h"
#include "messages.h"
#include "playlist.h"
#include "sout.h"
#include "misc.h"
#include "win32_common.h"
......@@ -147,7 +148,7 @@ void __fastcall TMainFrameDlg::OpenFileActionExecute( TObject *Sender )
if( OpenDialog1->Execute() )
{
/* add the new file to the interface playlist */
for ( int i = 0 ; i < OpenDialog1->Files->Count ; i++ )
for( int i = 0; i < OpenDialog1->Files->Count; i++ )
p_intf->p_sys->p_playwin->Add( OpenDialog1->Files->Strings[i],
PLAYLIST_APPEND
| ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 ),
......@@ -697,4 +698,11 @@ void __fastcall TMainFrameDlg::CreatePreferences( AnsiString Name )
Preferences->Show();
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::StreamOutputActionExecute( TObject *Sender )
{
TSoutDlg *p_sout = new TSoutDlg( this, p_intf );
p_sout->ShowModal();
delete p_sout;
}
//---------------------------------------------------------------------------
......@@ -304,7 +304,7 @@ object MainFrameDlg: TMainFrameDlg
Tag = 3
Left = 64
Top = 16
Width = 49
Width = 46
Height = 13
Caption = 'No server'
end
......@@ -460,6 +460,9 @@ object MainFrameDlg: TMainFrameDlg
Action = NetworkStreamAction
Caption = '&Network stream...'
end
object Streamouput1: TMenuItem
Action = StreamOutputAction
end
object N8: TMenuItem
Caption = '-'
Visible = False
......@@ -2585,6 +2588,13 @@ object MainFrameDlg: TMainFrameDlg
ImageIndex = 12
OnExecute = NextActionExecute
end
object StreamOutputAction: TAction
Tag = 3
Category = 'Menu'
Caption = '&Stream output...'
Hint = 'Open the stream output'
OnExecute = StreamOutputActionExecute
end
object PlaylistAction: TAction
Tag = 3
Category = 'Menu'
......
......@@ -184,6 +184,8 @@ __published: // IDE-managed Components
TMenuItem *N2;
TMenuItem *N1;
TMenuItem *PopupVDevice;
TMenuItem *Streamouput1;
TAction *StreamOutputAction;
void __fastcall TimerManageTimer( TObject *Sender );
void __fastcall TrackBarChange( TObject *Sender );
void __fastcall FormClose( TObject *Sender, TCloseAction &Action );
......@@ -217,6 +219,7 @@ __published: // IDE-managed Components
void __fastcall NextTitleActionExecute( TObject *Sender );
void __fastcall PrevChapterActionExecute( TObject *Sender );
void __fastcall NextChapterActionExecute( TObject *Sender );
void __fastcall StreamOutputActionExecute( TObject *Sender );
private: // User declarations
intf_thread_t *p_intf;
/* drag and drop handling */
......
/*****************************************************************************
* sout.cpp: the stream ouput dialog box
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: sout.cpp,v 1.1 2003/01/21 19:49:09 ipkiss Exp $
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
* 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.
*****************************************************************************/
#include <vcl.h>
#pragma hdrstop
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include "sout.h"
#include "misc.h"
#include "win32_common.h"
//---------------------------------------------------------------------------
#pragma link "CSPIN"
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
__fastcall TSoutDlg::TSoutDlg( TComponent* Owner, intf_thread_t *_p_intf )
: TForm( Owner )
{
p_intf = _p_intf;
PanelAccess->BevelOuter = bvNone;
PanelMux->BevelOuter = bvNone;
Translate( this );
}
//---------------------------------------------------------------------------
void __fastcall TSoutDlg::ButtonBrowseClick( TObject *Sender )
{
if( OpenDialog1->Execute() )
{
EditFile->Text = OpenDialog1->FileName;
RebuildMrl();
};
}
//---------------------------------------------------------------------------
void __fastcall TSoutDlg::CustomEditChange( TObject *Sender )
{
RebuildMrl();
}
//---------------------------------------------------------------------------
void __fastcall TSoutDlg::RadioButtonMuxClick( TObject *Sender )
{
RebuildMrl();
}
//---------------------------------------------------------------------------
void __fastcall TSoutDlg::RadioButtonAccessClick( TObject *Sender )
{
bool b_file = RadioButtonFile->Checked;
bool b_udp = RadioButtonUDP->Checked;
bool b_rtp = RadioButtonRTP->Checked;
EditFile->Enabled = b_file;
ButtonBrowse->Enabled = b_file;
LabelAddress->Enabled = b_udp | b_rtp;
EditAddress->Enabled = b_udp | b_rtp;
LabelPort->Enabled = b_udp | b_rtp;
SpinEditPort->Enabled = b_udp | b_rtp;
RadioButtonPS->Enabled = !b_rtp;
if( b_rtp )
RadioButtonTS->Checked = true;
RebuildMrl();
}
//---------------------------------------------------------------------------
void __fastcall TSoutDlg::BitBtnOKClick( TObject *Sender )
{
config_PutPsz( p_intf, "sout", EditMrl->Text.c_str() );
}
//---------------------------------------------------------------------------
/*****************************************************************************
* Private functions
*****************************************************************************/
void _fastcall TSoutDlg::RebuildMrl()
{
AnsiString Mux, Mrl;
if( RadioButtonPS->Checked )
Mux = "ps";
else
Mux = "ts";
if( RadioButtonFile->Checked )
Mrl = "file/" + Mux + "://" + EditFile->Text;
else if( RadioButtonUDP->Checked )
Mrl = "udp/" + Mux + "://" + EditAddress->Text + ":"
+ SpinEditPort->Value;
else
Mrl = "rtp/" + Mux + "://" + EditAddress->Text + ":"
+ SpinEditPort->Value;
EditMrl->Text = Mrl;
}
//---------------------------------------------------------------------------
object SoutDlg: TSoutDlg
Left = 500
Top = 325
Width = 394
Height = 244
Caption = 'Stream output'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object GroupBoxStreamOut: TGroupBox
Left = 8
Top = 8
Width = 369
Height = 161
Anchors = [akLeft, akTop, akRight]
Caption = 'Stream output MRL (Media Resource Locator)'
TabOrder = 0
object LabelPort: TLabel
Left = 264
Top = 98
Width = 22
Height = 13
Anchors = [akTop, akRight]
Caption = 'Port:'
Enabled = False
end
object LabelAddress: TLabel
Left = 96
Top = 98
Width = 41
Height = 13
Caption = 'Address:'
Enabled = False
end
object EditMrl: TEdit
Left = 16
Top = 24
Width = 337
Height = 21
Anchors = [akLeft, akTop, akRight]
TabOrder = 0
Text = 'file/ts://'
end
object PanelAccess: TPanel
Left = 16
Top = 56
Width = 73
Height = 97
TabOrder = 1
object RadioButtonFile: TRadioButton
Left = 8
Top = 8
Width = 49
Height = 17
Caption = 'File'
Checked = True
TabOrder = 0
TabStop = True
OnClick = RadioButtonAccessClick
end
object RadioButtonUDP: TRadioButton
Left = 8
Top = 40
Width = 49
Height = 17
Caption = 'UDP'
TabOrder = 1
OnClick = RadioButtonAccessClick
end
object RadioButtonRTP: TRadioButton
Left = 8
Top = 72
Width = 49
Height = 17
Caption = 'RTP'
TabOrder = 2
OnClick = RadioButtonAccessClick
end
end
object ButtonBrowse: TButton
Left = 278
Top = 60
Width = 75
Height = 25
Anchors = [akTop, akRight]
Caption = 'Browse...'
TabOrder = 2
OnClick = ButtonBrowseClick
end
object EditFile: TEdit
Left = 96
Top = 62
Width = 177
Height = 21
Anchors = [akLeft, akTop, akRight]
TabOrder = 3
OnChange = CustomEditChange
end
object SpinEditPort: TCSpinEdit
Left = 296
Top = 93
Width = 57
Height = 22
TabStop = True
Anchors = [akTop, akRight]
Enabled = False
MaxValue = 100000
ParentColor = False
TabOrder = 4
Value = 1234
OnChange = CustomEditChange
OnClick = CustomEditChange
end
object EditAddress: TEdit
Left = 144
Top = 94
Width = 113
Height = 21
Anchors = [akLeft, akTop, akRight]
Enabled = False
TabOrder = 5
Text = '239.239.0.1'
OnChange = CustomEditChange
end
object PanelMux: TPanel
Left = 184
Top = 124
Width = 89
Height = 25
Anchors = [akLeft, akTop, akRight]
TabOrder = 6
object RadioButtonPS: TRadioButton
Left = 3
Top = 4
Width = 41
Height = 17
Anchors = [akTop]
Caption = 'PS'
TabOrder = 0
OnClick = RadioButtonMuxClick
end
object RadioButtonTS: TRadioButton
Left = 40
Top = 4
Width = 41
Height = 17
Anchors = [akTop]
Caption = 'TS'
Checked = True
TabOrder = 1
TabStop = True
OnClick = RadioButtonMuxClick
end
end
end
object BitBtnOK: TBitBtn
Left = 31
Top = 184
Width = 138
Height = 25
TabOrder = 1
OnClick = BitBtnOKClick
Kind = bkOK
end
object BitBtnCancel: TBitBtn
Left = 216
Top = 184
Width = 136
Height = 25
TabOrder = 2
Kind = bkCancel
end
object OpenDialog1: TOpenDialog
Left = 120
Top = 128
end
end
/*****************************************************************************
* sout.h: the stream ouput dialog box
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: sout.h,v 1.1 2003/01/21 19:49:09 ipkiss Exp $
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
* 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.
*****************************************************************************/
#ifndef soutH
#define soutH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include "CSPIN.h"
#include <Dialogs.hpp>
#include <Buttons.hpp>
//---------------------------------------------------------------------------
class TSoutDlg : public TForm
{
__published: // IDE-managed Components
TGroupBox *GroupBoxStreamOut;
TEdit *EditMrl;
TPanel *PanelAccess;
TRadioButton *RadioButtonFile;
TRadioButton *RadioButtonUDP;
TRadioButton *RadioButtonRTP;
TOpenDialog *OpenDialog1;
TButton *ButtonBrowse;
TEdit *EditFile;
TCSpinEdit *SpinEditPort;
TEdit *EditAddress;
TLabel *LabelPort;
TLabel *LabelAddress;
TBitBtn *BitBtnOK;
TBitBtn *BitBtnCancel;
TPanel *PanelMux;
TRadioButton *RadioButtonPS;
TRadioButton *RadioButtonTS;
void __fastcall ButtonBrowseClick( TObject *Sender );
void __fastcall CustomEditChange( TObject *Sender );
void __fastcall RadioButtonMuxClick( TObject *Sender );
void __fastcall RadioButtonAccessClick( TObject *Sender );
void __fastcall BitBtnOKClick( TObject *Sender );
private: // User declarations
void __fastcall RebuildMrl();
intf_thread_t *p_intf;
public: // User declarations
__fastcall TSoutDlg( TComponent* Owner, intf_thread_t *_p_intf );
};
//---------------------------------------------------------------------------
#endif
......@@ -10,6 +10,7 @@ USEUNIT("menu.cpp");
USEFORM("messages.cpp", MessagesDlg);
USEUNIT("misc.cpp");
USEUNIT("dragdrop.cpp");
USEFORM("sout.cpp", SoutDlg);
//---------------------------------------------------------------------------
This file is used by the project manager only and should be treated like the project file
......
......@@ -5,11 +5,11 @@
<VERSION value="BCB.05.03"/>
<PROJECT value="libwin32_plugin.dll"/>
<OBJFILES value="win32.obj mainframe.obj network.obj playlist.obj preferences.obj about.obj
disc.obj menu.obj messages.obj misc.obj dragdrop.obj"/>
disc.obj menu.obj messages.obj misc.obj dragdrop.obj sout.obj"/>
<RESFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES) mainframe.dfm network.dfm playlist.dfm preferences.dfm
about.dfm disc.dfm messages.dfm"/>
about.dfm disc.dfm messages.dfm sout.dfm"/>
<LIBFILES value=""/>
<LIBRARIES value="VCLX50.lib bcbsmp50.lib VCL50.lib"/>
<SPARELIBS value="VCL50.lib bcbsmp50.lib VCLX50.lib"/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment