Commit 788c882a authored by Olivier Teulière's avatar Olivier Teulière

* All: Removed the win32 plugin; wxwindows rulez :)

parent 41e4d5d7
dnl Autoconf settings for vlc dnl Autoconf settings for vlc
dnl $Id: configure.ac,v 1.42 2003/07/25 11:33:24 gbazin Exp $ dnl $Id: configure.ac,v 1.43 2003/07/27 12:31:50 ipkiss Exp $
AC_INIT(vlc,0.6.1-test1) AC_INIT(vlc,0.6.1-test1)
...@@ -3296,7 +3296,6 @@ AC_OUTPUT([ ...@@ -3296,7 +3296,6 @@ AC_OUTPUT([
modules/gui/qnx/Makefile modules/gui/qnx/Makefile
modules/gui/qt/Makefile modules/gui/qt/Makefile
modules/gui/skins/Makefile modules/gui/skins/Makefile
modules/gui/win32/Makefile
modules/gui/wxwindows/Makefile modules/gui/wxwindows/Makefile
modules/misc/Makefile modules/misc/Makefile
modules/misc/dummy/Makefile modules/misc/dummy/Makefile
......
.deps
.dirstamp
*.lo
*.la
*.dll
*.dylib
*.sl
*.so
Makefile.am
Makefile.in
Makefile
#
# Borland C++ project
# This module is only available as a plugin. Don't try to fiddle with it!
#
EXTRA_DIST += $(BORLAND_win32)
# We have private rules! We do whatever we want! Don't mess with us!
SOURCES_win32 = PRIVATE
libwin32_plugin.dll: $(BORLAND_win32)
cd && \
rm -f win32.mak && \
$(BPR2MAK) win32.bpr -s | \
sed -e 's@^LIBPATH = .*@&;$$(RELEASELIBPATH)@' \
-e 's@^USERDEFINES = .*@& -DMODULE_NAME=win32@' \
> win32.mak && \
$(BCMAKE) -f win32.mak -b
BORLAND_win32 = \
win32.bpr \
win32.bpf \
\
about.cpp \
disc.cpp \
dragdrop.cpp \
mainframe.cpp \
menu.cpp \
messages.cpp \
network.cpp \
playlist.cpp \
preferences.cpp \
win32.cpp \
misc.cpp \
sout.cpp \
subtitles.cpp \
\
about.dfm \
disc.dfm \
mainframe.dfm \
messages.dfm \
network.dfm \
playlist.dfm \
preferences.dfm \
sout.dfm \
subtitles.dfm \
\
about.h \
disc.h \
dragdrop.h \
mainframe.h \
menu.h \
messages.h \
network.h \
playlist.h \
preferences.h \
win32_common.h \
misc.h \
sout.h \
subtitles.h \
$(NULL)
/*****************************************************************************
* about.cpp: The "About" dialog box
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 "about.h"
#include "misc.h"
#include "win32_common.h"
//---------------------------------------------------------------------------
//#pragma package(smart_init)
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
__fastcall TAboutDlg::TAboutDlg( TComponent* Owner, intf_thread_t *_p_intf )
: TForm( Owner )
{
p_intf = _p_intf;
Image1->Picture->Icon = p_intf->p_sys->p_window->Icon;
LabelVersion->Caption = "Version " VERSION;
Translate( this );
}
//---------------------------------------------------------------------------
This diff is collapsed.
/*****************************************************************************
* about.h: The "About" dialog box
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 aboutH
#define aboutH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
//---------------------------------------------------------------------------
class TAboutDlg : public TForm
{
__published: // IDE-managed Components
TLabel *Label1;
TLabel *Label2;
TLabel *Label4;
TLabel *Label3;
TImage *Image1;
TLabel *Label5;
TLabel *LabelVersion;
TButton *ButtonOK;
private: // User declarations
intf_thread_t *p_intf;
public: // User declarations
__fastcall TAboutDlg( TComponent* Owner, intf_thread_t *_p_intf );
};
//---------------------------------------------------------------------------
#endif
/*****************************************************************************
* disc.cpp: "Open disc" dialog box.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 "disc.h"
#include "misc.h"
#include "win32_common.h"
//---------------------------------------------------------------------------
//#pragma package(smart_init)
#pragma link "CSPIN"
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
__fastcall TDiscDlg::TDiscDlg( TComponent* Owner, intf_thread_t *_p_intf )
: TForm( Owner )
{
p_intf = _p_intf;
/* Simulate a click to get the correct device name */
RadioGroupTypeClick( RadioGroupType );
Translate( this );
}
//---------------------------------------------------------------------------
void __fastcall TDiscDlg::FormShow( TObject *Sender )
{
p_intf->p_sys->p_window->OpenDiscAction->Checked = true;
}
//---------------------------------------------------------------------------
void __fastcall TDiscDlg::FormHide( TObject *Sender )
{
p_intf->p_sys->p_window->OpenDiscAction->Checked = false;
}
//---------------------------------------------------------------------------
void __fastcall TDiscDlg::ButtonCancelClick( TObject *Sender )
{
Hide();
}
//---------------------------------------------------------------------------
void __fastcall TDiscDlg::ButtonOkClick( TObject *Sender )
{
AnsiString Device, Source;
Hide();
Device = EditDevice->Text;
/* Build source name and add it to playlist */
if ( CheckBoxMenus->Checked && RadioGroupType->ItemIndex == 0 )
{
Source = "dvdplay://" + Device;
}
else
{
AnsiString Method, Title, Chapter;
/* Select title and chapter */
Title.sprintf( "%d", SpinEditTitle->Value );
Chapter.sprintf( "%d", SpinEditChapter->Value );
/* Select access method */
if( RadioGroupType->ItemIndex == 0 )
Method = "dvdold";
else
Method = "vcd";
/* build the MRL */
Source = Method + "://" + Device + "@" + Title + "," + Chapter;
}
msg_Dbg (p_intf , Source.c_str());
p_intf->p_sys->p_playwin->Add( Source, PLAYLIST_APPEND
| ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 ),
PLAYLIST_END );
}
//---------------------------------------------------------------------------
void __fastcall TDiscDlg::RadioGroupTypeClick( TObject *Sender )
{
TRadioGroup *RadioGroupType = (TRadioGroup *)Sender;
char *psz_device;
if( RadioGroupType->ItemIndex == 0 )
{
psz_device = config_GetPsz( p_intf, "dvd" );
CheckBoxMenus->Enabled = true;
DisableTitles( CheckBoxMenus->Checked );
}
else
{
psz_device = config_GetPsz( p_intf, "vcd" );
CheckBoxMenus->Enabled = false;
/* We don't support menus for vcds, so we use titles and chapters */
DisableTitles( false );
}
if( psz_device )
{
EditDevice->Text = psz_device;
free( psz_device );
}
}
//---------------------------------------------------------------------------
void __fastcall TDiscDlg::CheckBoxMenusClick( TObject *Sender )
{
DisableTitles( CheckBoxMenus->Checked );
}
//---------------------------------------------------------------------------
void __fastcall TDiscDlg::DisableTitles( Boolean disable )
{
if( disable )
{
GroupBoxPosition->Enabled = false;
LabelTitle->Enabled = false;
LabelChapter->Enabled = false;
SpinEditTitle->Enabled = false;
SpinEditTitle->Color = clBtnFace;
SpinEditChapter->Enabled = false;
SpinEditChapter->Color = clBtnFace;
}
else
{
GroupBoxPosition->Enabled = true;
LabelTitle->Enabled = true;
LabelChapter->Enabled = true;
SpinEditTitle->Enabled = true;
SpinEditTitle->Color = clWindow;
SpinEditChapter->Enabled = true;
SpinEditChapter->Color = clWindow;
}
}
//---------------------------------------------------------------------------
object DiscDlg: TDiscDlg
Tag = 3
Left = 465
Top = 337
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsDialog
Caption = 'Open Disc'
ClientHeight = 173
ClientWidth = 248
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnHide = FormHide
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object LabelDevice: TLabel
Tag = 3
Left = 8
Top = 117
Width = 66
Height = 13
Caption = 'Device &name:'
end
object CheckBoxMenus: TCheckBox
Left = 96
Top = 8
Width = 97
Height = 17
Caption = '&Menus'
TabOrder = 1
OnClick = CheckBoxMenusClick
end
object GroupBoxPosition: TGroupBox
Tag = 3
Left = 96
Top = 33
Width = 144
Height = 72
Caption = 'Starting position'
TabOrder = 2
object LabelTitle: TLabel
Tag = 3
Left = 8
Top = 19
Width = 23
Height = 13
Caption = '&Title:'
end
object LabelChapter: TLabel
Tag = 3
Left = 8
Top = 47
Width = 40
Height = 13
Caption = '&Chapter:'
end
object SpinEditTitle: TCSpinEdit
Left = 56
Top = 14
Width = 80
Height = 22
TabStop = True
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
MaxValue = 65535
MinValue = 1
ParentColor = False
ParentFont = False
TabOrder = 1
Value = 1
end
object SpinEditChapter: TCSpinEdit
Left = 56
Top = 42
Width = 80
Height = 22
TabStop = True
MaxValue = 65535
MinValue = 1
ParentColor = False
TabOrder = 0
Value = 1
end
end
object RadioGroupType: TRadioGroup
Tag = 3
Left = 8
Top = 8
Width = 80
Height = 97
Caption = 'Disc type'
ItemIndex = 0
Items.Strings = (
'&DVD'
'&VCD')
TabOrder = 0
OnClick = RadioGroupTypeClick
end
object ButtonOk: TButton
Tag = 3
Left = 82
Top = 142
Width = 75
Height = 23
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 4
OnClick = ButtonOkClick
end
object ButtonCancel: TButton
Tag = 3
Left = 165
Top = 142
Width = 75
Height = 23
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 5
OnClick = ButtonCancelClick
end
object EditDevice: TEdit
Tag = 5
Left = 96
Top = 113
Width = 144
Height = 21
TabOrder = 3
Text = 'F:\'
end
end
/*****************************************************************************
* disc.h: "Open disc" dialog box.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 discH
#define discH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include "CSPIN.h"
//---------------------------------------------------------------------------
class TDiscDlg : public TForm
{
__published: // IDE-managed Components
TLabel *LabelDevice;
TGroupBox *GroupBoxPosition;
TLabel *LabelTitle;
TLabel *LabelChapter;
TRadioGroup *RadioGroupType;
TButton *ButtonOk;
TButton *ButtonCancel;
TEdit *EditDevice;
TCSpinEdit *SpinEditTitle;
TCSpinEdit *SpinEditChapter;
TCheckBox *CheckBoxMenus;
void __fastcall FormShow( TObject *Sender );
void __fastcall FormHide( TObject *Sender );
void __fastcall ButtonCancelClick( TObject *Sender );
void __fastcall ButtonOkClick( TObject *Sender);
void __fastcall RadioGroupTypeClick( TObject *Sender );
void __fastcall CheckBoxMenusClick( TObject *Sender );
private: // User declarations
intf_thread_t *p_intf;
void __fastcall DisableTitles( Boolean disable );
public: // User declarations
__fastcall TDiscDlg( TComponent* Owner, intf_thread_t *_p_intf );
};
//---------------------------------------------------------------------------
#endif
/*****************************************************************************
* dragdrop.cpp: drag and drop management
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 "dragdrop.h"
//---------------------------------------------------------------------------
__fastcall TDropTarget::TDropTarget( HWND HForm ) : IDropTarget()
{
FormHandle = HForm;
References = 1;
}
//---------------------------------------------------------------------------
__fastcall TDropTarget::~TDropTarget()
{
}
//---------------------------------------------------------------------------
/* helper routine to notify Form of drop on target */
void __fastcall TDropTarget::HandleDrop( HDROP HDrop )
{
SendMessage( FormHandle, WM_OLEDROP, (WPARAM)HDrop, 0 );
}
//---------------------------------------------------------------------------
STDMETHODIMP TDropTarget::QueryInterface( REFIID iid, void FAR* FAR* ppv )
{
/* tell other objects about our capabilities */
if( iid == IID_IUnknown || iid == IID_IDropTarget )
{
*ppv = this;
AddRef();
return S_OK;
}
*ppv = NULL;
return ResultFromScode( E_NOINTERFACE );
}
//---------------------------------------------------------------------------
STDMETHODIMP_(ULONG) TDropTarget::AddRef()
{
return ++References;
}
//---------------------------------------------------------------------------
STDMETHODIMP_(ULONG) TDropTarget::Release()
{
if( --References == 0 )
{
delete this;
return 0;
}
return References;
}
//---------------------------------------------------------------------------
/* Indicates whether a drop can be accepted, and, if so,
* the effect of the drop */
STDMETHODIMP TDropTarget::DragEnter( LPDATAOBJECT pDataObj, DWORD grfKeyState,
POINTL pt, DWORD *pdwEffect )
{
FORMATETC fmtetc;
fmtetc.cfFormat = CF_HDROP;
fmtetc.ptd = NULL;
fmtetc.dwAspect = DVASPECT_CONTENT;
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_HGLOBAL;
/* Check that the drag source provides CF_HDROP,
* which is the only format we accept */
if( pDataObj->QueryGetData( &fmtetc ) == S_OK )
*pdwEffect = DROPEFFECT_COPY;
else
*pdwEffect = DROPEFFECT_NONE;
return S_OK;
}
//---------------------------------------------------------------------------
/* for visual feedback */
STDMETHODIMP TDropTarget::DragOver( DWORD grfKeyState, POINTL pt,
DWORD *pdwEffect )
{
return S_OK;
}
//---------------------------------------------------------------------------
/* remove visual feedback */
STDMETHODIMP TDropTarget::DragLeave()
{
return S_OK;
}
//---------------------------------------------------------------------------
/* something has been dropped */
STDMETHODIMP TDropTarget::Drop( LPDATAOBJECT pDataObj, DWORD grfKeyState,
POINTL pt, DWORD *pdwEffect )
{
/* user has dropped on us -- get the CF_HDROP data from drag source */
FORMATETC fmtetc;
fmtetc.cfFormat = CF_HDROP;
fmtetc.ptd = NULL;
fmtetc.dwAspect = DVASPECT_CONTENT;
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_HGLOBAL;
STGMEDIUM medium;
HRESULT hr = pDataObj->GetData( &fmtetc, &medium );
if( !FAILED(hr) )
{
/* grab a pointer to the data */
HGLOBAL HFiles = medium.hGlobal;
HDROP HDrop = (HDROP)GlobalLock( HFiles );
/* call the helper routine which will notify the Form of the drop */
HandleDrop( HDrop );
/* release the pointer to the memory */
GlobalUnlock( HFiles );
ReleaseStgMedium( &medium );
}
else
{
*pdwEffect = DROPEFFECT_NONE;
return hr;
}
return S_OK;
}
/*****************************************************************************
* dragdrop.h: drag and drop management
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 dragdropH
#define dragdropH
//---------------------------------------------------------------------------
#include <ole2.h>
#define WM_OLEDROP WM_USER + 1
//---------------------------------------------------------------------------
class TDropTarget : public IDropTarget
{
public:
__fastcall TDropTarget( HWND HForm );
__fastcall ~TDropTarget();
protected:
/* IUnknown methods */
STDMETHOD(QueryInterface)( REFIID riid, void FAR* FAR* ppvObj );
STDMETHOD_(ULONG, AddRef)();
STDMETHOD_(ULONG, Release)();
/* IDropTarget methods */
STDMETHOD(DragEnter)( LPDATAOBJECT pDataObj, DWORD grfKeyState,
POINTL pt, DWORD *pdwEffect );
STDMETHOD(DragOver)( DWORD grfKeyState, POINTL pt, DWORD *pdwEffect );
STDMETHOD(DragLeave)();
STDMETHOD(Drop)( LPDATAOBJECT pDataObj, DWORD grfKeyState,
POINTL pt, DWORD *pdwEffect );
private:
unsigned long References;
HWND FormHandle;
/* helper function */
void __fastcall HandleDrop( HDROP HDrop );
};
//---------------------------------------------------------------------------
#endif
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*****************************************************************************
* mainframe.h: Prototype for main window
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 mainframeH
#define mainframeH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <Dialogs.hpp>
#include <ImgList.hpp>
#include <Menus.hpp>
#include <ToolWin.hpp>
#include <AppEvnts.hpp>
#include <ExtCtrls.hpp>
#include "CSPIN.h"
#include <ActnList.hpp>
#include <oleidl.h> /* for drag and drop */
/*****************************************************************************
* This message is sent to the controls registered as drop targets
*****************************************************************************/
#define WM_OLEDROP WM_USER + 1
//---------------------------------------------------------------------------
class TMainFrameDlg : public TForm
{
__published: // IDE-managed Components
TToolBar *ToolBar;
TToolButton *ToolButtonFile;
TToolButton *ToolButtonDisc;
TToolButton *ToolButtonNet;
TToolButton *ToolButtonSep1;
TToolButton *ToolButtonStop;
TToolButton *ToolButtonPlay;
TToolButton *ToolButtonPause;
TToolButton *ToolButtonSep2;
TToolButton *ToolButtonSlow;
TToolButton *ToolButtonFast;
TToolButton *ToolButtonSep3;
TToolButton *ToolButtonPlaylist;
TToolButton *ToolButtonPrev;
TToolButton *ToolButtonNext;
TMainMenu *MainMenu1;
TMenuItem *MenuFile;
TMenuItem *MenuOpenFile;
TMenuItem *MenuOpenDisc;
TMenuItem *MenuNetworkStream;
TMenuItem *MenuExit;
TMenuItem *MenuView;
TMenuItem *MenuHideinterface;
TMenuItem *MenuTitle;
TMenuItem *MenuChapter;
TMenuItem *MenuAngle;
TMenuItem *N3;
TMenuItem *MenuPlaylist;
TMenuItem *MenuMessages;
TMenuItem *MenuControls;
TMenuItem *MenuLanguage;
TMenuItem *MenuSubtitles;
TMenuItem *MenuPreferences;
TMenuItem *MenuHelp;
TMenuItem *MenuAbout;
TOpenDialog *OpenDialog1;
TImageList *ImageListToolbar;
TPopupMenu *PopupMenuMain;
TMenuItem *PopupPlay;
TMenuItem *PopupPause;
TMenuItem *PopupStop;
TMenuItem *PopupBack;
TMenuItem *PopupSlow;
TMenuItem *PopupFast;
TMenuItem *PopupToggleInterface;
TMenuItem *PopupNext;
TMenuItem *PopupPrev;
TMenuItem *PopupJump;
TMenuItem *PopupNavigation;
TMenuItem *PopupProgram;
TMenuItem *PopupLanguage;
TMenuItem *PopupSubtitles;
TMenuItem *PopupFile;
TMenuItem *PopupPlaylist;
TMenuItem *PopupPreferences;
TMenuItem *N7;
TMenuItem *PopupExit;
TStatusBar *StatusBar;
TGroupBox *GroupBoxFile;
TLabel *LabelFileName;
TGroupBox *GroupBoxNetwork;
TLabel *LabelChannel;
TLabel *LabelServer;
TGroupBox *GroupBoxDisc;
TMenuItem *N8;
TMenuItem *MenuProgram;
TLabel *LabelDisc;
TLabel *LabelTitle;
TButton *ButtonTitlePrev;
TButton *ButtonTitleNext;
TButton *ButtonChapterPrev;
TButton *ButtonChapterNext;
TLabel *LabelChapter;
TLabel *LabelTitleCurrent;
TLabel *LabelChapterCurrent;
TButton *ButtonGo;
TGroupBox *GroupBoxSlider;
TTrackBar *TrackBar;
TTimer *TimerManage;
TMenuItem *PopupOpenFile;
TMenuItem *PopupOpenDisc;
TMenuItem *PopupNetworkStream;
TMenuItem *PopupClose;
TMenuItem *N9;
TCSpinEdit *SpinEditChannel;
TActionList *ActionList1;
TAction *OpenFileAction;
TAction *OpenDiscAction;
TAction *NetworkStreamAction;
TAction *PlayAction;
TAction *PauseAction;
TAction *StopAction;
TAction *EjectAction;
TAction *SlowAction;
TAction *FastAction;
TAction *PreviousAction;
TAction *NextAction;
TAction *BackAction;
TAction *PlaylistAction;
TAction *ExitAction;
TAction *FullscreenAction;
TAction *PreferencesAction;
TAction *MessagesAction;
TAction *AboutAction;
TAction *PrevTitleAction;
TAction *NextTitleAction;
TAction *PrevChapterAction;
TAction *NextChapterAction;
TAction *VolumeUpAction;
TAction *VolumeDownAction;
TAction *MuteAction;
TAction *StreamOutputAction;
TAction *AddSubtitlesAction;
TMenuItem *Control1;
TMenuItem *N5;
TMenuItem *N10;
TMenuItem *N11;
TMenuItem *MenuChannel;
TMenuItem *PopupChannel;
TMenuItem *MenuVolumeUp;
TMenuItem *MenuVolumeDown;
TMenuItem *MenuMute;
TMenuItem *MenuADevice;
TMenuItem *PopupAudioSettings;
TMenuItem *PopupADevice;
TMenuItem *VolumeDown1;
TMenuItem *VolumeUp1;
TMenuItem *Mute1;
TMenuItem *MenuVDevice;
TMenuItem *N1;
TMenuItem *PopupVDevice;
TMenuItem *MenuStreamOuput;
TMenuItem *MenuAddSubtitles;
TMenuItem *N4;
TMenuItem *MenuAddInterface;
TAction *OnTopAction;
TMenuItem *MenuFullscreen;
TMenuItem *MenuOnTop;
TMenuItem *PopupFullscreen;
TMenuItem *Videosettings1;
TMenuItem *PopupOnTop;
TMenuItem *N2;
TMenuItem *MenuEjectDisc;
void __fastcall TimerManageTimer( TObject *Sender );
void __fastcall TrackBarChange( TObject *Sender );
void __fastcall FormClose( TObject *Sender, TCloseAction &Action );
void __fastcall MenuHideinterfaceClick( TObject *Sender );
void __fastcall PopupCloseClick( TObject *Sender );
void __fastcall PopupToggleInterfaceClick( TObject *Sender );
void __fastcall PopupJumpClick( TObject *Sender );
void __fastcall ButtonGoClick( TObject *Sender );
void __fastcall OpenFileActionExecute( TObject *Sender );
void __fastcall OpenDiscActionExecute( TObject *Sender );
void __fastcall NetworkStreamActionExecute( TObject *Sender );
void __fastcall StreamOutputActionExecute( TObject *Sender );
void __fastcall ExitActionExecute( TObject *Sender );
void __fastcall PlaylistActionExecute( TObject *Sender );
void __fastcall MessagesActionExecute( TObject *Sender );
void __fastcall AboutActionExecute( TObject *Sender );
void __fastcall BackActionExecute( TObject *Sender );
void __fastcall PlayActionExecute( TObject *Sender );
void __fastcall PauseActionExecute( TObject *Sender );
void __fastcall StopActionExecute( TObject *Sender );
void __fastcall SlowActionExecute( TObject *Sender );
void __fastcall FastActionExecute( TObject *Sender );
void __fastcall PreviousActionExecute( TObject *Sender );
void __fastcall NextActionExecute( TObject *Sender );
void __fastcall EjectActionExecute( TObject *Sender );
void __fastcall VolumeUpActionExecute( TObject *Sender );
void __fastcall VolumeDownActionExecute( TObject *Sender );
void __fastcall MuteActionExecute( TObject *Sender );
void __fastcall FullscreenActionExecute( TObject *Sender );
void __fastcall PreferencesActionExecute( TObject *Sender );
void __fastcall PrevTitleActionExecute( TObject *Sender );
void __fastcall NextTitleActionExecute( TObject *Sender );
void __fastcall PrevChapterActionExecute( TObject *Sender );
void __fastcall NextChapterActionExecute( TObject *Sender );
void __fastcall AddSubtitlesActionsExecute( TObject *Sender );
void __fastcall OnTopActionExecute( TObject *Sender );
private: // User declarations
intf_thread_t *p_intf;
/* drag and drop handling */
LPDROPTARGET lpDropTarget;
BEGIN_MESSAGE_MAP
MESSAGE_HANDLER( WM_OLEDROP, TMessage, OnDrop )
END_MESSAGE_MAP( TForm )
public: // User declarations
TStringList *StringListPref; /* stores config dialogs */
__fastcall TMainFrameDlg( TComponent* Owner, intf_thread_t *_p_intf );
virtual __fastcall ~TMainFrameDlg();
void __fastcall DisplayHint( TObject *Sender );
void __fastcall ModeManage();
void __fastcall CreatePreferences( AnsiString Name );
void __fastcall MenuProgramClick( TObject *Sender );
void __fastcall MenuAudioClick( TObject *Sender );
void __fastcall MenuSubtitleClick( TObject *Sender );
void __fastcall MenuTitleClick( TObject *Sender );
void __fastcall MenuChapterClick( TObject *Sender );
void __fastcall PopupProgramClick( TObject *Sender );
void __fastcall PopupAudioClick( TObject *Sender );
void __fastcall PopupSubtitleClick( TObject *Sender );
void __fastcall PopupNavigationClick( TObject *Sender );
void __fastcall OnDrop( TMessage &Msg );
};
//---------------------------------------------------------------------------
#endif
This diff is collapsed.
/*****************************************************************************
* menu.h: prototypes for menu functions
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: menu.h,v 1.5 2003/02/12 02:11:58 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 menuH
#define menuH
//----------------------------------------------------------------------------
class TMenusGen : public TObject
{
private:
intf_thread_t *p_intf;
/* local pointers to main window menu items */
TMenuItem *MenuChannel;
TMenuItem *PopupChannel;
TMenuItem *MenuADevice;
TMenuItem *PopupADevice;
TMenuItem *MenuVDevice;
TMenuItem *PopupVDevice;
TMenuItem *MenuLanguage;
TMenuItem *PopupLanguage;
TMenuItem *MenuSubtitles;
TMenuItem *PopupSubtitles;
TMenuItem *MenuProgram;
TMenuItem *PopupProgram;
TMenuItem *MenuTitle;
TMenuItem *MenuChapter;
TMenuItem *PopupNavigation;
TMenuItem *MenuAddInterface;
/* Language information */
es_descriptor_t * p_audio_es_old;
es_descriptor_t * p_spu_es_old;
/* Helpful functions */
int Item2Index( TMenuItem *Root, TMenuItem *Item );
TMenuItem *Index2Item( TMenuItem *Root, int i_index, bool SingleColumn );
int __fastcall Data2Title( int data );
int __fastcall Data2Chapter( int data );
int __fastcall Pos2Data( int title, int chapter );
AnsiString __fastcall TMenusGen::CleanCaption( AnsiString Caption );
void __fastcall VarChange( vlc_object_t *, const char *, TMenuItem *,
TMenuItem *, TMenuItem * );
void __fastcall LangChange( TMenuItem *, TMenuItem *, TMenuItem *, int );
void __fastcall ProgramChange( TMenuItem *, TMenuItem * );
void __fastcall SetupVarMenu( vlc_object_t *, const char *, TMenuItem *,
TNotifyEvent );
void __fastcall SetupModuleMenu( const char *, TMenuItem *, TNotifyEvent );
void __fastcall ProgramMenu( TMenuItem *, pgrm_descriptor_t *,
TNotifyEvent );
void __fastcall RadioMenu( TMenuItem *, AnsiString, int, int,
TNotifyEvent );
void __fastcall LanguageMenu( TMenuItem *, es_descriptor_t *, int,
TNotifyEvent );
void __fastcall NavigationMenu( TMenuItem *, TNotifyEvent );
public:
__fastcall TMenusGen( intf_thread_t *_p_intf );
/* menu generation */
void __fastcall SetupMenus();
/* callbacks for menuitems */
void __fastcall AoutVarClick( TObject *Sender );
void __fastcall VoutVarClick( TObject *Sender );
void __fastcall InterfaceModuleClick( TObject *Sender );
void __fastcall MenuLanguageClick( TObject *Sender );
void __fastcall PopupLanguageClick( TObject *Sender );
void __fastcall MenuSubtitleClick( TObject *Sender );
void __fastcall PopupSubtitleClick( TObject *Sender );
void __fastcall MenuProgramClick( TObject *Sender );
void __fastcall PopupProgramClick( TObject *Sender );
void __fastcall MenuTitleClick( TObject *Sender );
void __fastcall MenuChapterClick( TObject *Sender );
void __fastcall PopupNavigationClick( TObject *Sender );
};
//----------------------------------------------------------------------------
#endif
/*****************************************************************************
* messages.cpp: log window.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 "messages.h"
#include "misc.h"
#include "win32_common.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
__fastcall TMessagesDlg::TMessagesDlg(
TComponent* Owner, intf_thread_t *_p_intf ) : TForm( Owner )
{
p_intf = _p_intf;
Icon = p_intf->p_sys->p_window->Icon;
Translate( this );
}
//---------------------------------------------------------------------------
void __fastcall TMessagesDlg::ButtonOKClick( TObject *Sender )
{
Hide();
}
//---------------------------------------------------------------------------
void __fastcall TMessagesDlg::FormHide( TObject *Sender )
{
p_intf->p_sys->p_window->MessagesAction->Checked = false;
}
//---------------------------------------------------------------------------
void __fastcall TMessagesDlg::FormShow( TObject *Sender )
{
p_intf->p_sys->p_window->MessagesAction->Checked = true;
}
//---------------------------------------------------------------------------
void __fastcall TMessagesDlg::UpdateLog()
{
msg_subscription_t *p_sub = p_intf->p_sys->p_sub;
int i_start, i_stop, i_del, i_count;
int i_max_lines;
vlc_mutex_lock( p_sub->p_lock );
i_stop = *p_sub->pi_stop;
vlc_mutex_unlock( p_sub->p_lock );
if( p_sub->i_start != i_stop )
{
for( i_start = p_sub->i_start;
i_start != i_stop;
i_start = (i_start+1) % VLC_MSG_QSIZE )
{
/* Append all messages to log window */
switch( p_sub->p_msg[i_start].i_type )
{
case VLC_MSG_ERR:
RichEditMessages->SelAttributes->Color = clRed;
break;
case VLC_MSG_WARN:
RichEditMessages->SelAttributes->Color = clBlue;
break;
default:
RichEditMessages->SelAttributes->Color = clBlack;
break;
}
/* Limit log size */
i_count = RichEditMessages->Lines->Count;
i_max_lines = config_GetInt( p_intf, "intfwin-max-lines" );
if( i_max_lines > 0 )
{
for( i_del = 0; i_del <= i_count - i_max_lines; i_del++ )
{
RichEditMessages->Lines->Delete( 0 );
}
}
/* Add message */
if( i_max_lines )
{
/* We don't use RichEditMessages->Lines->Add(), because with
* some versions of rich32.dll it can trigger the
* "RichEdit line insertion error" bug... */
RichEditMessages->SelStart = RichEditMessages->GetTextLen();
RichEditMessages->SelText = p_sub->p_msg[i_start].psz_msg;
RichEditMessages->SelText = RichEditMessages->SelText + "\r\n";
}
}
vlc_mutex_lock( p_sub->p_lock );
p_sub->i_start = i_start;
vlc_mutex_unlock( p_sub->p_lock );
}
}
//---------------------------------------------------------------------------
void __fastcall TMessagesDlg::PopupCopyTextClick( TObject *Sender )
{
/* If nothinf is selected, select everything */
if( RichEditMessages->SelLength == 0 )
{
RichEditMessages->SelStart = 0;
RichEditMessages->SelLength = RichEditMessages->GetTextLen();
}
/* Copy selected text to clipboard */
RichEditMessages->CopyToClipboard();
}
//---------------------------------------------------------------------------
object MessagesDlg: TMessagesDlg
Tag = 3
Left = 325
Top = 160
Width = 440
Height = 502
Caption = 'Messages'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clPurple
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnHide = FormHide
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object RichEditMessages: TRichEdit
Left = 0
Top = 0
Width = 432
Height = 424
Align = alTop
Anchors = [akLeft, akTop, akRight, akBottom]
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
PopupMenu = PopupMenu1
ReadOnly = True
ScrollBars = ssBoth
TabOrder = 0
WantReturns = False
end
object ButtonOK: TButton
Tag = 3
Left = 144
Top = 437
Width = 145
Height = 25
Anchors = [akBottom]
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 1
OnClick = ButtonOKClick
end
object PopupMenu1: TPopupMenu
Left = 304
Top = 432
object PopupCopyText: TMenuItem
Caption = '&Copy text'
ShortCut = 16451
OnClick = PopupCopyTextClick
end
end
end
/*****************************************************************************
* messages.h: log window
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 messagesH
#define messagesH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hpp>
#include <Menus.hpp>
//---------------------------------------------------------------------------
class TMessagesDlg : public TForm
{
__published: // IDE-managed Components
TRichEdit *RichEditMessages;
TButton *ButtonOK;
TPopupMenu *PopupMenu1;
TMenuItem *PopupCopyText;
void __fastcall ButtonOKClick( TObject *Sender );
void __fastcall FormHide( TObject *Sender );
void __fastcall FormShow( TObject *Sender );
void __fastcall PopupCopyTextClick( TObject *Sender );
private: // User declarations
intf_thread_t *p_intf;
public: // User declarations
__fastcall TMessagesDlg( TComponent* Owner, intf_thread_t *_p_intf );
void __fastcall UpdateLog();
};
//---------------------------------------------------------------------------
#endif
/*****************************************************************************
* misc.cpp: miscellaneous functions.
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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>
#include <comctrls.hpp>
#pragma hdrstop
#include <vlc/vlc.h>
#include "misc.h"
/****************************************************************************
* This function replaces "Hint", "Caption" and "Text" properties of each
* component of the form by the appropriate translation.
****************************************************************************/
void __fastcall Translate( TForm *Form )
{
// We must test the string because we don't want to get the default one
if( Form->Hint != "" )
{
Form->Hint = _( Form->Hint.c_str() );
}
if( Form->Caption != "" )
{
Form->Caption = _( Form->Caption.c_str() );
}
for( int i = 0; i < Form->ComponentCount; i++ )
{
// Does this component need a translation ?
if( Form->Components[i]->Tag > 0 )
{
TComponent *Component = Form->Components[i];
// Note: the Text property isn't translated, because we don't want
// to modify the content of TEdit or TComboBox objects, which
// may have default values
// Hint property
if( Component->Tag & 1 )
{
if( Component->InheritsFrom( __classid( TControl ) ) )
{
TControl *Object = (TControl *) Component;
if( Object->Hint != "" )
{
Object->Hint = _( Object->Hint.c_str() );
}
}
else if( Component->InheritsFrom( __classid( TMenuItem ) ) )
{
TMenuItem *Object = (TMenuItem *) Component;
if( Object->Hint != "" )
{
Object->Hint = _( Object->Hint.c_str() );
}
}
}
// Caption property
if( Component->Tag & 2 )
{
if( Component->InheritsFrom( __classid( TMenuItem ) ) )
{
TMenuItem *Object = (TMenuItem *) Component;
if( Object->Caption != "" )
{
Object->Caption = _( Object->Caption.c_str() );
}
}
else if( Component->InheritsFrom( __classid( TLabel ) ) )
{
TLabel *Object = (TLabel *) Component;
if( Object->Caption != "" )
{
Object->Caption = _( Object->Caption.c_str() );
}
}
else if( Component->InheritsFrom( __classid( TButton ) ) )
{
TButton *Object = (TButton *) Component;
if( Object->Caption != "" )
{
Object->Caption = _( Object->Caption.c_str() );
}
}
else if( Component->InheritsFrom( __classid( TRadioButton ) ) )
{
TRadioButton *Object = (TRadioButton *) Component;
if( Object->Caption != "" )
{
Object->Caption = _( Object->Caption.c_str() );
}
}
else if( Component->InheritsFrom( __classid( TCheckBox ) ) )
{
TCheckBox *Object = (TCheckBox *) Component;
if( Object->Caption != "" )
{
Object->Caption = _( Object->Caption.c_str() );
}
}
else if( Component->InheritsFrom( __classid( TRadioGroup ) ) )
{
TRadioGroup *Object = (TRadioGroup *) Component;
if( Object->Caption != "" )
{
Object->Caption = _( Object->Caption.c_str() );
}
}
else if( Component->InheritsFrom( __classid( TGroupBox ) ) )
{
TGroupBox *Object = (TGroupBox *) Component;
if( Object->Caption != "" )
{
Object->Caption = _( Object->Caption.c_str() );
}
}
else if( Component->InheritsFrom( __classid( TToolButton ) ) )
{
TToolButton *Object = (TToolButton *) Component;
if( Object->Caption != "" )
{
Object->Caption = _( Object->Caption.c_str() );
}
}
else if( Component->InheritsFrom( __classid( TListView ) ) )
{
TListView *ListView = (TListView *) Component;
for( int iCol = 0; iCol < ListView->Columns->Count; iCol++ )
{
TListColumn *Object = ListView->Columns->Items[iCol];
if( Object->Caption != "" )
{
Object->Caption = _( Object->Caption.c_str() );
}
}
}
}
}
}
}
/*****************************************************************************
* misc.h: Prototype for main window
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 miscH
#define miscH
void __fastcall Translate( TForm *Form );
#endif
/*****************************************************************************
* network.cpp: the "network" dialog box
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 "network.h"
#include "misc.h"
#include "win32_common.h"
//---------------------------------------------------------------------------
//#pragma package(smart_init)
#pragma link "CSPIN"
#pragma resource "*.dfm"
//---------------------------------------------------------------------------
__fastcall TNetworkDlg::TNetworkDlg( TComponent* Owner, intf_thread_t *_p_intf )
: TForm( Owner )
{
p_intf = _p_intf;
char *psz_channel_server;
OldRadioValue = 0;
/* server port */
SpinEditUDPPort->Value = config_GetInt( p_intf, "server-port" );
SpinEditMulticastPort->Value = config_GetInt( p_intf, "server-port" );
/* channel server */
if( config_GetInt( p_intf, "network-channel" ) )
{
RadioButtonCS->Checked = true;
RadioButtonCSEnter( RadioButtonCS );
}
psz_channel_server = config_GetPsz( p_intf, "channel-server" );
if( psz_channel_server )
{
ComboBoxCSAddress->Text = psz_channel_server;
free( psz_channel_server );
}
SpinEditCSPort->Value = config_GetInt( p_intf, "channel-port" );
Translate( this );
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::FormShow( TObject *Sender )
{
p_intf->p_sys->p_window->NetworkStreamAction->Checked = true;
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::FormHide( TObject *Sender )
{
p_intf->p_sys->p_window->NetworkStreamAction->Checked = false;
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::ButtonCancelClick( TObject *Sender )
{
Hide();
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::ButtonOkClick( TObject *Sender )
{
AnsiString Source, Address;
AnsiString Channel = ComboBoxCSAddress->Text;
unsigned int i_channel_port = SpinEditCSPort->Value;
unsigned int i_port;
Hide();
/* Check which option was chosen */
switch( OldRadioValue )
{
/* UDP */
case 0:
config_PutInt( p_intf, "network-channel", FALSE );
i_port = SpinEditUDPPort->Value;
/* Build source name */
Source = "udp:@:" + IntToStr( i_port );
p_intf->p_sys->p_playwin->Add( Source,
PLAYLIST_APPEND
| ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 )
, PLAYLIST_END );
break;
/* UDP Multicast */
case 1:
config_PutInt( p_intf, "network-channel", FALSE );
Address = ComboBoxMulticastAddress->Text;
i_port = SpinEditMulticastPort->Value;
/* Build source name */
Source = "udp:@" + Address + ":" + IntToStr( i_port );
p_intf->p_sys->p_playwin->Add( Source,
PLAYLIST_APPEND
| ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 )
, PLAYLIST_END );
/* HTTP */
case 3:
config_PutInt( p_intf, "network-channel", FALSE );
Address = EditHTTPURL->Text;
/* Build source name with a basic test;
* http is the default protocol */
if( Address.SubString( 1, 7 ) == "http://" ||
Address.SubString( 1, 6 ) == "ftp://" ||
Address.SubString( 1, 6 ) == "mms://" )
{
Source = Address;
}
else
{
Source = "http://" + Address;
}
p_intf->p_sys->p_playwin->Add( Source,
PLAYLIST_APPEND
| ( p_intf->p_sys->b_play_when_adding ? PLAYLIST_GO : 0 )
, PLAYLIST_END );
break;
}
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::ChangeEnabled( int i_selected )
{
switch( i_selected )
{
case 0:
LabelUDPPort->Enabled = NOT( LabelUDPPort->Enabled );
SpinEditUDPPort->Enabled = NOT( SpinEditUDPPort->Enabled );
break;
case 1:
LabelMulticastAddress->Enabled =
NOT( LabelMulticastAddress->Enabled );
ComboBoxMulticastAddress->Enabled =
NOT( ComboBoxMulticastAddress->Enabled );
LabelMulticastPort->Enabled = NOT( LabelMulticastPort->Enabled );
SpinEditMulticastPort->Enabled = NOT( SpinEditMulticastPort->Enabled );
break;
case 2:
LabelCSAddress->Enabled = NOT( LabelCSAddress->Enabled );
ComboBoxCSAddress->Enabled = NOT( ComboBoxCSAddress->Enabled );
LabelCSPort->Enabled = NOT( LabelCSPort->Enabled );
SpinEditCSPort->Enabled = NOT( SpinEditCSPort->Enabled );
break;
case 3:
LabelHTTPURL->Enabled = NOT( LabelHTTPURL->Enabled );
EditHTTPURL->Enabled = NOT( EditHTTPURL->Enabled );
break;
}
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::RadioButtonUDPEnter( TObject *Sender )
{
ChangeEnabled( OldRadioValue );
OldRadioValue = 0;
ChangeEnabled( OldRadioValue );
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::RadioButtonMulticastEnter( TObject *Sender )
{
ChangeEnabled( OldRadioValue );
OldRadioValue = 1;
ChangeEnabled( OldRadioValue );
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::RadioButtonCSEnter( TObject *Sender )
{
ChangeEnabled( OldRadioValue );
OldRadioValue = 2;
ChangeEnabled( OldRadioValue );
}
//---------------------------------------------------------------------------
void __fastcall TNetworkDlg::RadioButtonHTTPEnter( TObject *Sender )
{
ChangeEnabled( OldRadioValue );
OldRadioValue = 3;
ChangeEnabled( OldRadioValue );
}
//---------------------------------------------------------------------------
This diff is collapsed.
/*****************************************************************************
* network.h: the "network" dialog box
*****************************************************************************
* Copyright (C) 2002 VideoLAN
*
* 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 networkH
#define networkH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Buttons.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include "CSPIN.h"
//---------------------------------------------------------------------------
#define NOT( var ) ( (var) ? false : true )
class TNetworkDlg : public TForm
{
__published: // IDE-managed Components
TGroupBox *GroupBoxMode;
TRadioButton *RadioButtonUDP;
TRadioButton *RadioButtonMulticast;
TRadioButton *RadioButtonCS;
TRadioButton *RadioButtonHTTP;
TLabel *LabelUDPPort;
TLabel *LabelMulticastPort;
TLabel *LabelCSPort;
TLabel *LabelMulticastAddress;
TComboBox *ComboBoxMulticastAddress;
TLabel *LabelCSAddress;
TComboBox *ComboBoxCSAddress;
TEdit *EditHTTPURL;
TLabel *LabelHTTPURL;
TCSpinEdit *SpinEditUDPPort;
TCSpinEdit *SpinEditMulticastPort;
TCSpinEdit *SpinEditCSPort;
TButton *ButtonOK;
TButton *ButtonCancel;
void __fastcall FormShow( TObject *Sender );
void __fastcall FormHide( TObject *Sender );
void __fastcall ButtonCancelClick( TObject *Sender );
void __fastcall ButtonOkClick( TObject *Sender );
void __fastcall RadioButtonUDPEnter( TObject *Sender );
void __fastcall RadioButtonMulticastEnter( TObject *Sender );
void __fastcall RadioButtonCSEnter( TObject *Sender );
void __fastcall RadioButtonHTTPEnter( TObject *Sender );
private: // User declarations
int OldRadioValue;
void __fastcall ChangeEnabled( int i_selected );
intf_thread_t *p_intf;
public: // User declarations
__fastcall TNetworkDlg( TComponent* Owner, intf_thread_t *_p_intf );
};
//---------------------------------------------------------------------------
#endif
This diff is collapsed.
object PlaylistDlg: TPlaylistDlg
Tag = 3
Left = 470
Top = 197
Width = 335
Height = 435
Caption = 'Playlist'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
Menu = MainMenuPlaylist
OldCreateOrder = False
OnHide = FormHide
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object ListViewPlaylist: TListView
Tag = 3
Left = 11
Top = 10
Width = 305
Height = 330
Anchors = [akLeft, akTop, akRight, akBottom]
Columns = <
item
Caption = 'Filename'
Width = 200
end
item
Alignment = taCenter
Caption = 'Duration'
Width = 100
end>
HideSelection = False
MultiSelect = True
ReadOnly = True
RowSelect = True
PopupMenu = PopupMenuPlaylist
TabOrder = 1
ViewStyle = vsReport
OnCustomDrawItem = ListViewPlaylistCustomDrawItem
OnDblClick = PlayStreamActionExecute
OnKeyDown = ListViewPlaylistKeyDown
end
object ButtonOK: TButton
Tag = 3
Left = 75
Top = 352
Width = 177
Height = 25
Anchors = [akLeft, akRight, akBottom]
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 0
OnClick = ButtonOkClick
end
object MainMenuPlaylist: TMainMenu
Left = 8
Top = 8
object MenuAdd: TMenuItem
Tag = 3
Caption = '&Add'
object MenuAddFile: TMenuItem
Tag = 3
Caption = '&File...'
OnClick = MenuAddFileClick
end
object MenuAddDisc: TMenuItem
Tag = 3
Caption = '&Disc...'
OnClick = MenuAddDiscClick
end
object MenuAddNet: TMenuItem
Tag = 3
Caption = '&Network...'
OnClick = MenuAddNetClick
end
object MenuAddUrl: TMenuItem
Tag = 3
Caption = '&Url'
Enabled = False
OnClick = MenuAddUrlClick
end
end
object MenuDelete: TMenuItem
Tag = 3
Caption = '&Delete'
object MenuDeleteAll: TMenuItem
Tag = 3
Action = DeleteAllAction
end
object MenuDeleteSelected: TMenuItem
Tag = 3
Action = DeleteSelectionAction
Caption = '&Selection'
end
end
object MenuSelection: TMenuItem
Tag = 3
Caption = '&Selection'
object MenuSelectionCrop: TMenuItem
Tag = 3
Action = CropSelectionAction
end
object MenuSelectionInvert: TMenuItem
Tag = 3
Action = InvertSelectionAction
end
end
end
object PopupMenuPlaylist: TPopupMenu
Left = 40
Top = 8
object PopupPlay: TMenuItem
Tag = 3
Action = PlayStreamAction
end
object N1: TMenuItem
Caption = '-'
end
object PopupInvertSelection: TMenuItem
Tag = 3
Action = InvertSelectionAction
Caption = '&Invert selection'
end
object PopupCropSelection: TMenuItem
Tag = 3
Action = CropSelectionAction
Caption = '&Crop selection'
end
object N2: TMenuItem
Caption = '-'
end
object PopupDeleteSelected: TMenuItem
Tag = 3
Action = DeleteSelectionAction
Caption = '&Delete selection'
end
object PopupDeleteAll: TMenuItem
Tag = 3
Action = DeleteAllAction
Caption = 'Delete &all'
end
end
object ActionList1: TActionList
Left = 72
Top = 8
object InvertSelectionAction: TAction
Tag = 3
Caption = 'Invert'
Hint = 'Invert selection'
OnExecute = InvertSelectionActionExecute
end
object CropSelectionAction: TAction
Tag = 3
Caption = 'Crop'
Hint = 'Crop selection'
OnExecute = CropSelectionActionExecute
end
object DeleteSelectionAction: TAction
Tag = 3
Caption = 'Delete'
Hint = 'Delete selection'
OnExecute = DeleteSelectionActionExecute
end
object DeleteAllAction: TAction
Tag = 3
Caption = 'All'
Hint = 'Delete all items'
OnExecute = DeleteAllActionExecute
end
object PlayStreamAction: TAction
Tag = 3
Caption = 'Play'
Hint = 'Play the selected stream'
OnExecute = PlayStreamActionExecute
end
end
object PlaylistOpenDlg: TOpenDialog
Filter = 'All files(*.*)|*.*'
Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist, ofEnableSizing]
Left = 136
Top = 8
end
object PlaylistSaveDlg: TSaveDialog
Filter = 'All files(*.*)|*.*'
Options = [ofOverwritePrompt, ofHideReadOnly, ofPathMustExist, ofEnableSizing]
Left = 104
Top = 8
end
end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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