Commit 831d6ca5 authored by Olivier Teulière's avatar Olivier Teulière

* Added a dialog box for subtitles selection

 * Cosmetic here and there
parent 4c31331e
......@@ -27,7 +27,7 @@
#include <vlc/intf.h>
#include "disc.h"
#include "misc.h";
#include "misc.h"
#include "win32_common.h"
//---------------------------------------------------------------------------
......
......@@ -37,6 +37,7 @@
#include "messages.h"
#include "playlist.h"
#include "sout.h"
#include "subtitles.h"
#include "misc.h"
#include "win32_common.h"
......@@ -178,6 +179,13 @@ void __fastcall TMainFrameDlg::NetworkStreamActionExecute( TObject *Sender )
p_network->Show();
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::AddSubtitlesActionsExecute( TObject *Sender )
{
TSubtitlesDlg *p_subtitles = new TSubtitlesDlg( this, p_intf );
p_subtitles->ShowModal();
delete p_subtitles;
}
//---------------------------------------------------------------------------
void __fastcall TMainFrameDlg::StreamOutputActionExecute( TObject *Sender )
{
TSoutDlg *p_sout = new TSoutDlg( this, p_intf );
......
......@@ -460,7 +460,12 @@ object MainFrameDlg: TMainFrameDlg
Action = NetworkStreamAction
Caption = '&Network stream...'
end
object Streamouput1: TMenuItem
object MenuAddSubtitles: TMenuItem
Tag = 3
Action = AddSubtitlesAction
end
object MenuStreamOuput: TMenuItem
Tag = 3
Action = StreamOutputAction
end
object N8: TMenuItem
......@@ -2595,6 +2600,13 @@ object MainFrameDlg: TMainFrameDlg
Hint = 'Open the stream output'
OnExecute = StreamOutputActionExecute
end
object AddSubtitlesAction: TAction
Tag = 3
Category = 'Menu'
Caption = '&Add subtitles...'
Hint = 'Add a subtitle file'
OnExecute = AddSubtitlesActionsExecute
end
object PlaylistAction: TAction
Tag = 3
Category = 'Menu'
......
......@@ -184,8 +184,10 @@ __published: // IDE-managed Components
TMenuItem *N2;
TMenuItem *N1;
TMenuItem *PopupVDevice;
TMenuItem *Streamouput1;
TMenuItem *MenuStreamOuput;
TAction *StreamOutputAction;
TMenuItem *MenuAddSubtitles;
TAction *AddSubtitlesAction;
void __fastcall TimerManageTimer( TObject *Sender );
void __fastcall TrackBarChange( TObject *Sender );
void __fastcall FormClose( TObject *Sender, TCloseAction &Action );
......@@ -220,6 +222,7 @@ __published: // IDE-managed Components
void __fastcall NextTitleActionExecute( TObject *Sender );
void __fastcall PrevChapterActionExecute( TObject *Sender );
void __fastcall NextChapterActionExecute( TObject *Sender );
void __fastcall AddSubtitlesActionsExecute(TObject *Sender);
private: // User declarations
intf_thread_t *p_intf;
/* drag and drop handling */
......
......@@ -2,7 +2,7 @@
* 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 $
* $Id: sout.cpp,v 1.2 2003/01/22 21:42:51 ipkiss Exp $
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
......
......@@ -2,7 +2,7 @@
* 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 $
* $Id: sout.h,v 1.2 2003/01/22 21:42:51 ipkiss Exp $
*
* Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
*
......
/*****************************************************************************
* subtitles.cpp: Dialog box for divx subtitle selection
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: subtitles.cpp,v 1.1 2003/01/22 21:42:51 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 "subtitles.h"
#include "misc.h"
#include "win32_common.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
__fastcall TSubtitlesDlg::TSubtitlesDlg( TComponent* Owner,
intf_thread_t *_p_intf ) : TForm( Owner )
{
p_intf = _p_intf;
Constraints->MinWidth = Width;
Constraints->MinHeight = Height;
Translate( this );
}
//---------------------------------------------------------------------------
void __fastcall TSubtitlesDlg::ButtonBrowseClick( TObject *Sender )
{
if( OpenDialog1->Execute() )
{
EditFile->Text = OpenDialog1->FileName;
}
}
//---------------------------------------------------------------------------
void __fastcall TSubtitlesDlg::BitBtnOKClick( TObject *Sender )
{
int delay = (int) (10 * atof( EditDelay->Text.c_str() ));
float fps = atof( EditFPS->Text.c_str() );
config_PutPsz( p_intf, "sub-file", EditFile->Text.c_str() );
config_PutInt( p_intf, "sub-delay", delay );
config_PutFloat( p_intf, "sub-fps", fps );
}
//---------------------------------------------------------------------------
object SubtitlesDlg: TSubtitlesDlg
Left = 397
Top = 333
Width = 432
Height = 134
Caption = 'Add subtitles'
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 GroupBoxSubtitles: TGroupBox
Left = 8
Top = 8
Width = 310
Height = 91
Anchors = [akLeft, akTop, akRight, akBottom]
Caption = 'Select a subtitles file'
TabOrder = 0
object LabelDelay: TLabel
Left = 48
Top = 64
Width = 30
Height = 13
Caption = 'Delay:'
end
object LabelFPS: TLabel
Left = 173
Top = 64
Width = 23
Height = 13
Anchors = [akTop, akRight]
Caption = 'FPS:'
end
object EditDelay: TEdit
Left = 88
Top = 60
Width = 57
Height = 21
Hint = 'Set the delay (in seconds)'
TabOrder = 0
Text = '0.0'
end
object EditFPS: TEdit
Left = 205
Top = 60
Width = 57
Height = 21
Hint = 'Set the number of Frames Per Second'
Anchors = [akTop, akRight]
TabOrder = 1
Text = '0.0'
end
object EditFile: TEdit
Left = 16
Top = 24
Width = 190
Height = 21
Anchors = [akLeft, akTop, akRight]
TabOrder = 2
end
object ButtonBrowse: TButton
Left = 219
Top = 22
Width = 75
Height = 25
Anchors = [akTop, akRight]
Caption = 'Browse...'
TabOrder = 3
OnClick = ButtonBrowseClick
end
end
object BitBtnOK: TBitBtn
Left = 333
Top = 22
Width = 81
Height = 25
Anchors = [akRight]
TabOrder = 1
OnClick = BitBtnOKClick
Kind = bkOK
end
object BitBtnCancel: TBitBtn
Left = 333
Top = 60
Width = 81
Height = 25
Anchors = [akRight]
TabOrder = 2
Kind = bkCancel
end
object OpenDialog1: TOpenDialog
Filter =
'Subtitles Files (*.txt, *.sub, *.srt, *.ssa)|*.txt;*.sub;*.srt;*' +
'.ssa|All Files (*.*)|*.*'
Left = 16
Top = 64
end
end
/*****************************************************************************
* subtitles.h: Dialog box for divx subtitle selection
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: subtitles.h,v 1.1 2003/01/22 21:42:51 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 subtitlesH
#define subtitlesH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Dialogs.hpp>
#include <Buttons.hpp>
//---------------------------------------------------------------------------
class TSubtitlesDlg : public TForm
{
__published: // IDE-managed Components
TOpenDialog *OpenDialog1;
TGroupBox *GroupBoxSubtitles;
TEdit *EditDelay;
TEdit *EditFPS;
TEdit *EditFile;
TButton *ButtonBrowse;
TBitBtn *BitBtnOK;
TBitBtn *BitBtnCancel;
TLabel *LabelDelay;
TLabel *LabelFPS;
void __fastcall ButtonBrowseClick( TObject *Sender );
void __fastcall BitBtnOKClick( TObject *Sender );
private: // User declarations
intf_thread_t *p_intf;
public: // User declarations
__fastcall TSubtitlesDlg( TComponent* Owner, intf_thread_t *p_intf );
};
//---------------------------------------------------------------------------
#endif
......@@ -11,6 +11,7 @@ USEFORM("messages.cpp", MessagesDlg);
USEUNIT("misc.cpp");
USEUNIT("dragdrop.cpp");
USEFORM("sout.cpp", SoutDlg);
USEFORM("subtitles.cpp", SubtitlesDlg);
//---------------------------------------------------------------------------
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 sout.obj"/>
disc.obj menu.obj messages.obj misc.obj dragdrop.obj sout.obj subtitles.obj"/>
<RESFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES) mainframe.dfm network.dfm playlist.dfm preferences.dfm
about.dfm disc.dfm messages.dfm sout.dfm"/>
about.dfm disc.dfm messages.dfm sout.dfm subtitles.dfm"/>
<LIBFILES value=""/>
<LIBRARIES value="VCLX50.lib bcbsmp50.lib VCL50.lib"/>
<SPARELIBS value="VCL50.lib bcbsmp50.lib VCLX50.lib"/>
......
......@@ -2,7 +2,7 @@
* win32.cpp : Win32 interface plugin for vlc
*****************************************************************************
* Copyright (C) 2002-2003 VideoLAN
* $Id: win32.cpp,v 1.9 2003/01/21 21:20:54 ipkiss Exp $
* $Id: win32.cpp,v 1.10 2003/01/22 21:42:51 ipkiss Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
*
......
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