+ bookmarks menu.
+ started work on bookmarks dialog.
+ started support for embeddable vout (via vout_RequestWindow()/vout_ReleaseWindow()).
+ new --wxwin-bookmarks and --wxwin-embed config options.
timer.cpp \
fileinfo.cpp \
subtitles.cpp \
+ bookmarks.cpp \
+ video.cpp \
v4l.cpp \
$(NULL)
--- /dev/null
+/*****************************************************************************
+ * bookmarks.cpp : wxWindows plugin for vlc
+ *****************************************************************************
+ * Copyright (C) 2000-2004 VideoLAN
+ * $Id: bookmarks.cpp 6961 2004-03-05 17:34:23Z sam $
+ *
+ * Authors: Gildas Bazin <gbazin@videolan.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <stdlib.h> /* malloc(), free() */
+#include <errno.h> /* ENOMEM */
+#include <string.h> /* strerror() */
+#include <stdio.h>
+
+#include <vlc/vlc.h>
+#include <vlc/intf.h>
+
+#include "wxwindows.h"
+
+/*****************************************************************************
+ * Event Table.
+ *****************************************************************************/
+
+/* IDs for the controls and the menu commands */
+enum
+{
+ /* menu items */
+ ButtonAdd_Event = wxID_HIGHEST + 1,
+ ButtonDel_Event
+};
+
+BEGIN_EVENT_TABLE(BookmarksDialog, wxFrame)
+ /* Hide the window when the user closes the window */
+ EVT_CLOSE(BookmarksDialog::OnClose )
+ EVT_BUTTON( ButtonAdd_Event, BookmarksDialog::OnAdd )
+ EVT_BUTTON( ButtonDel_Event, BookmarksDialog::OnDel )
+
+ EVT_LIST_ITEM_ACTIVATED( -1, BookmarksDialog::OnActivateItem )
+END_EVENT_TABLE()
+
+/*****************************************************************************
+ * Constructor.
+ *****************************************************************************/
+BookmarksDialog::BookmarksDialog( intf_thread_t *_p_intf, wxWindow *p_parent )
+ : wxFrame( p_parent->GetParent() ? p_parent->GetParent() : p_parent,
+ -1, wxU(_("Bookmarks")),
+ !p_parent->GetParent() ? wxDefaultPosition :
+ wxPoint( p_parent->GetParent()->GetRect().GetX(),
+ p_parent->GetParent()->GetRect().GetY() +
+ p_parent->GetParent()->GetRect().GetHeight() + 40 ),
+ !p_parent->GetParent() ? wxDefaultSize :
+ wxSize( p_parent->GetParent()->GetRect().GetWidth(), -1 ),
+ wxDEFAULT_FRAME_STYLE | wxFRAME_FLOAT_ON_PARENT )
+{
+ /* Initializations */
+ p_intf = _p_intf;
+
+ wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
+
+ wxPanel *panel = new wxPanel( this, -1 );
+ wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
+ wxButton *button_add =
+ new wxButton( panel, ButtonAdd_Event, wxU(_("Add")) );
+ wxButton *button_del =
+ new wxButton( panel, ButtonDel_Event, wxU(_("Remove")) );
+ panel_sizer->Add( button_add, 0, wxEXPAND );
+ panel_sizer->Add( button_del, 0, wxEXPAND );
+ panel->SetSizerAndFit( panel_sizer );
+
+ list_ctrl = new wxListView( this, -1, wxDefaultPosition, wxDefaultSize,
+ wxLC_REPORT | wxSUNKEN_BORDER |
+ wxLC_SINGLE_SEL );
+ list_ctrl->InsertColumn( 0, wxU(_("Description")) );
+ list_ctrl->SetColumnWidth( 0, 240 );
+ list_ctrl->InsertColumn( 1, wxU(_("Size offset")) );
+ list_ctrl->InsertColumn( 2, wxU(_("Time offset")) );
+
+ sizer->Add( panel, 0, wxEXPAND | wxALL, 5 );
+ sizer->Add( list_ctrl, 1, wxEXPAND | wxALL, 5 );
+ SetSizer( sizer );
+}
+
+BookmarksDialog::~BookmarksDialog()
+{
+}
+
+/*****************************************************************************
+ * Private methods.
+ *****************************************************************************/
+
+void BookmarksDialog::Update()
+{
+ input_thread_t *p_input =
+ (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
+ FIND_ANYWHERE );
+ if( !p_input ) return;
+
+ seekpoint_t **pp_bookmarks;
+ int i_bookmarks;
+
+ if( input_Control( p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks,
+ &i_bookmarks ) != VLC_SUCCESS )
+ {
+ vlc_object_release( p_input );
+ return;
+ }
+
+ list_ctrl->DeleteAllItems();
+ for( int i = 0; i < i_bookmarks; i++ )
+ {
+ list_ctrl->InsertItem( i, wxL2U( pp_bookmarks[i]->psz_name ) );
+ list_ctrl->SetItem( i, 1, wxString::Format(wxT("%i"),
+ pp_bookmarks[i]->i_byte_offset ) );
+ list_ctrl->SetItem( i, 2, wxString::Format(wxT("%i"),
+ pp_bookmarks[i]->i_time_offset/1000000 ) );
+ }
+
+ vlc_object_release( p_input );
+}
+
+bool BookmarksDialog::Show( bool show )
+{
+ Update();
+ return wxFrame::Show( show );
+}
+
+void BookmarksDialog::OnClose( wxCommandEvent& event )
+{
+ Hide();
+}
+
+void BookmarksDialog::OnAdd( wxCommandEvent& event )
+{
+ input_thread_t *p_input =
+ (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
+ FIND_ANYWHERE );
+ if( !p_input ) return;
+
+ seekpoint_t bookmark;
+ vlc_value_t pos;
+ var_Get( p_input, "position", &pos );
+ bookmark.psz_name = NULL;
+ bookmark.i_byte_offset =
+ (pos.f_float * p_input->stream.p_selected_area->i_size);
+ var_Get( p_input, "time", &pos );
+ bookmark.i_time_offset = pos.i_time;
+ input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
+
+ vlc_object_release( p_input );
+
+ Update();
+}
+
+void BookmarksDialog::OnDel( wxCommandEvent& event )
+{
+ input_thread_t *p_input =
+ (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
+ FIND_ANYWHERE );
+ if( !p_input ) return;
+
+ int i_focused = list_ctrl->GetFocusedItem();
+ if( i_focused >= 0 )
+ {
+ input_Control( p_input, INPUT_DEL_BOOKMARK, i_focused );
+ }
+
+ vlc_object_release( p_input );
+
+ Update();
+}
+
+void BookmarksDialog::OnActivateItem( wxListEvent& event )
+{
+ input_thread_t *p_input =
+ (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
+ FIND_ANYWHERE );
+ if( !p_input ) return;
+
+ input_Control( p_input, INPUT_SET_BOOKMARK, event.GetIndex() );
+
+ vlc_object_release( p_input );
+}
* dialogs.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
- * $Id: dialogs.cpp,v 1.16 2004/03/01 18:31:13 gbazin Exp $
+ * $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
DialogsProvider::OnStreamWizardDialog)
EVT_COMMAND(INTF_DIALOG_FILEINFO, wxEVT_DIALOG,
DialogsProvider::OnFileInfo)
+ EVT_COMMAND(INTF_DIALOG_BOOKMARKS, wxEVT_DIALOG,
+ DialogsProvider::OnBookmarks)
EVT_COMMAND(INTF_DIALOG_POPUPMENU, wxEVT_DIALOG,
DialogsProvider::OnPopupMenu)
EVT_COMMAND(INTF_DIALOG_EXIT, wxEVT_DIALOG,
p_prefs_dialog = NULL;
p_file_generic_dialog = NULL;
p_streamwizard_dialog = NULL;
+ p_bookmarks_dialog = NULL;
/* Give our interface a nice little icon */
p_intf->p_sys->p_icon = new wxIcon( vlc_xpm );
/* Create the messages dialog so it can begin storing logs */
p_messages_dialog = new Messages( p_intf, p_parent ? p_parent : this );
+ /* Check if user wants to show the bookmarks dialog by default */
+ wxCommandEvent dummy_event;
+ if( config_GetInt( p_intf, "wxwin-bookmarks" ) )
+ OnBookmarks( dummy_event );
+
/* Intercept all menu events in our custom event handler */
PushEventHandler( new MenuEvtHandler( p_intf, NULL ) );
}
if( p_fileinfo_dialog ) delete p_fileinfo_dialog;
if( p_file_generic_dialog ) delete p_file_generic_dialog;
if( p_streamwizard_dialog ) delete p_streamwizard_dialog;
+ if( p_bookmarks_dialog ) delete p_bookmarks_dialog;
if( p_intf->p_sys->p_icon ) delete p_intf->p_sys->p_icon;
}
}
+void DialogsProvider::OnBookmarks( wxCommandEvent& WXUNUSED(event) )
+{
+ /* Show/hide the open dialog */
+ if( !p_bookmarks_dialog )
+ p_bookmarks_dialog = new BookmarksDialog( p_intf, this );
+
+ if( p_bookmarks_dialog )
+ {
+ p_bookmarks_dialog->Show( !p_bookmarks_dialog->IsShown() );
+ }
+}
+
void DialogsProvider::OnOpenFileGeneric( wxCommandEvent& event )
{
intf_dialog_args_t *p_arg = (intf_dialog_args_t *)event.GetClientData();
* interface.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004, 2003 VideoLAN
- * $Id: interface.cpp,v 1.87 2004/03/01 18:31:13 gbazin Exp $
+ * $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
* Event Table.
*****************************************************************************/
+DEFINE_LOCAL_EVENT_TYPE( wxEVT_INTF );
+
/* IDs for the controls and the menu commands */
enum
{
FileInfo_Event,
Prefs_Event,
- Extra_Event,
+ Extended_Event,
+ Bookmarks_Event,
Skins_Event,
SliderScroll_Event,
EVT_MENU_OPEN(Interface::OnMenuOpen)
- EVT_MENU( Extra_Event, Interface::OnExtra)
- EVT_CHECKBOX( Adjust_Event, Interface::OnEnableAdjust)
+ EVT_MENU( Extended_Event, Interface::OnExtended)
+ EVT_MENU( Bookmarks_Event, Interface::OnShowDialog)
+ EVT_CHECKBOX( Adjust_Event, Interface::OnEnableAdjust)
EVT_TEXT( Ratio_Event, Interface::OnRatio)
EVT_CHECKBOX( Visual_Event, Interface::OnEnableVisual)
EVT_COMMAND_SCROLL(Saturation_Event, Interface::OnSaturationUpdate)
EVT_COMMAND_SCROLL(Gamma_Event, Interface::OnGammaUpdate)
+ /* Custom events */
+ EVT_COMMAND(0, wxEVT_INTF, Interface::UpdateSizeEvent)
+
END_EVENT_TABLE()
/*****************************************************************************
frame_sizer->Hide( slider_frame );
/* Create the extra panel */
- CreateOurExtraPanel();
+ CreateOurExtendedPanel();
frame_sizer->Add( extra_frame, 0, wxEXPAND , 0 );
frame_sizer->Hide( extra_frame );
/* Make sure we've got the right background colour */
SetBackgroundColour( slider_frame->GetBackgroundColour() );
+ /* Video window */
+ if( config_GetInt( p_intf, "wxwin-embed" ) )
+ {
+ VideoWindow( p_intf, this );
+ frame_sizer->Add( p_intf->p_sys->p_video_sizer, 1, wxEXPAND , 0 );
+ }
+
/* Layout everything */
frame_sizer->Layout();
frame_sizer->Fit(this);
delete timer;
}
+void Interface::UpdateSizeEvent( wxCommandEvent& event )
+{
+ frame_sizer->Layout();
+ frame_sizer->Fit(this);
+}
+
/*****************************************************************************
* Private methods.
*****************************************************************************/
void Interface::CreateOurMenuBar()
{
#define HELP_SIMPLE N_("Quick file open")
-#define HELP_ADV N_("Advanced open")
+#define HELP_ADV N_("Advanced open")
#define HELP_FILE N_("Open a file")
#define HELP_DISC N_("Open Disc Media")
#define HELP_NET N_("Open a network stream")
#define HELP_EXIT N_("Exit this program")
#define HELP_STREAMWIZARD N_("Open the streaming wizard")
-#define HELP_OTHER N_("Open other types of inputs")
#define HELP_PLAYLIST N_("Open the playlist")
#define HELP_LOGS N_("Show the program logs")
-#define HELP_FILEINFO N_("Show information about the file being played")
+#define HELP_FILEINFO N_("Show information about the file being played")
-#define HELP_PREFS N_("Go to the preferences menu")
-#define EXTRA_PREFS N_("Shows the extended GUI")
+#define HELP_PREFS N_("Go to the preferences menu")
+#define HELP_EXTENDED N_("Shows the extended GUI")
+#define HELP_BOOKMARKS N_("Shows the bookmarks window")
#define HELP_ABOUT N_("About this program")
}
-void Interface::CreateOurExtraPanel()
+void Interface::CreateOurExtendedPanel()
{
char *psz_filters;
p_settings_menu = SettingsMenu( p_intf, this );
/* Add static items */
- p_settings_menu->AppendCheckItem( Extra_Event,
- wxU(_("&Extended GUI") ), wxU(_(EXTRA_PREFS)) );
+ p_settings_menu->AppendCheckItem( Extended_Event,
+ wxU(_("&Extended GUI") ), wxU(_(HELP_EXTENDED)) );
+ p_settings_menu->AppendCheckItem( Bookmarks_Event,
+ wxU(_("&Bookmarks") ), wxU(_(HELP_BOOKMARKS)) );
p_settings_menu->Append( Prefs_Event, wxU(_("&Preferences...")),
wxU(_(HELP_PREFS)) );
#else
p_settings_menu = SettingsMenu( p_intf, this );
/* Add static items */
- p_settings_menu->AppendCheckItem( Extra_Event, wxU(_("&Extended GUI") ),
- wxU(_(EXTRA_PREFS)) );
+ p_settings_menu->AppendCheckItem( Extended_Event, wxU(_("&Extended GUI") ),
+ wxU(_(HELP_EXTENDED)) );
+ p_settings_menu->AppendCheckItem( Bookmarks_Event, wxU(_("&Bookmarks") ),
+ wxU(_(HELP_BOOKMARKS)) );
p_settings_menu->Append( Prefs_Event, wxU(_("&Preferences...")),
wxU(_(HELP_PREFS)) );
wxMenu *menu =
case StreamWizard_Event:
i_id = INTF_DIALOG_STREAMWIZARD;
break;
+ case Bookmarks_Event:
+ i_id = INTF_DIALOG_BOOKMARKS;
+ break;
default:
i_id = INTF_DIALOG_FILE;
break;
}
}
-void Interface::OnExtra(wxCommandEvent& event)
+void Interface::OnExtended(wxCommandEvent& event)
{
if( b_extra == VLC_FALSE)
{
* menus.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2004 VideoLAN
- * $Id: menus.cpp,v 1.33 2004/02/26 12:04:14 gbazin Exp $
+ * $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
FIND_ANYWHERE );
if( p_object != NULL )
{
+ ppsz_varnames[i] = "bookmark";
+ pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "title";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "chapter";
FIND_ANYWHERE );
if( p_object != NULL )
{
+ ppsz_varnames[i] = "bookmark";
+ pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "title";
pi_objects[i++] = p_object->i_object_id;
ppsz_varnames[i] = "chapter";
--- /dev/null
+/*****************************************************************************
+ * video.cpp : wxWindows plugin for vlc
+ *****************************************************************************
+ * Copyright (C) 2000-2004, 2003 VideoLAN
+ * $Id: interface.cpp 6961 2004-03-05 17:34:23Z sam $
+ *
+ * Authors: Gildas Bazin <gbazin@videolan.org>
+ *
+ * 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.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <vlc/vlc.h>
+#include <vlc/vout.h>
+#include <vlc/intf.h>
+#include "stream_control.h"
+
+#include "wxwindows.h"
+
+static void *GetWindow( intf_thread_t *p_intf, int *pi_x_hint, int *pi_y_hint,
+ unsigned int *pi_width_hint,
+ unsigned int *pi_height_hint );
+static void ReleaseWindow( intf_thread_t *p_intf, void *p_window );
+
+/* IDs for the controls and the menu commands */
+enum
+{
+ UpdateSize_Event = wxID_HIGHEST + 1,
+ UpdateHide_Event
+};
+
+class VideoWindow: public wxWindow
+{
+public:
+ /* Constructor */
+ VideoWindow( intf_thread_t *_p_intf, wxWindow *p_parent );
+ virtual ~VideoWindow();
+
+ void *GetWindow( int *, int *, unsigned int *, unsigned int * );
+ void ReleaseWindow( void * );
+
+private:
+ intf_thread_t *p_intf;
+ wxWindow *p_parent;
+ vlc_mutex_t lock;
+ vlc_bool_t b_in_use;
+
+ wxWindow *p_child_window;
+
+ void UpdateSize( wxSizeEvent & );
+ void UpdateHide( wxSizeEvent & );
+
+ DECLARE_EVENT_TABLE();
+};
+
+BEGIN_EVENT_TABLE(VideoWindow, wxWindow)
+ EVT_CUSTOM( wxEVT_SIZE, UpdateSize_Event, VideoWindow::UpdateSize )
+ EVT_CUSTOM( wxEVT_SIZE, UpdateHide_Event, VideoWindow::UpdateHide )
+END_EVENT_TABLE()
+
+/*****************************************************************************
+ * Public methods.
+ *****************************************************************************/
+wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent )
+{
+ return new VideoWindow::VideoWindow( p_intf, p_parent );
+}
+
+/*****************************************************************************
+ * Constructor.
+ *****************************************************************************/
+VideoWindow::VideoWindow( intf_thread_t *_p_intf, wxWindow *_p_parent ):
+ wxWindow( _p_parent, -1 )
+{
+ /* Initializations */
+ p_intf = _p_intf;
+ p_parent = _p_parent;
+
+ vlc_mutex_init( p_intf, &lock );
+ b_in_use = VLC_FALSE;
+
+ p_intf->pf_request_window = ::GetWindow;
+ p_intf->pf_release_window = ::ReleaseWindow;
+
+ p_intf->p_sys->p_video_window = this;
+ p_child_window = new wxWindow( this, -1, wxDefaultPosition, wxSize(0,0) );
+ p_child_window->Show();
+ Show();
+
+ p_intf->p_sys->p_video_sizer = new wxBoxSizer( wxHORIZONTAL );
+ p_intf->p_sys->p_video_sizer->Add( this, 1, wxEXPAND );
+
+ ReleaseWindow( NULL );
+}
+
+VideoWindow::~VideoWindow()
+{
+ vlc_mutex_destroy( &lock );
+}
+
+/*****************************************************************************
+ * Private methods.
+ *****************************************************************************/
+static void *GetWindow( intf_thread_t *p_intf, int *pi_x_hint, int *pi_y_hint,
+ unsigned int *pi_width_hint,
+ unsigned int *pi_height_hint )
+{
+ return p_intf->p_sys->p_video_window->GetWindow( pi_x_hint, pi_y_hint,
+ pi_width_hint,
+ pi_height_hint );
+}
+
+/* Part of the hack to get the X11 window handle from the GtkWidget */
+#ifdef __WXGTK__
+extern "C" {
+#ifdef __WXGTK20__
+ int gdk_x11_drawable_get_xid( void * );
+#endif
+ void *gtk_widget_get_parent_window( void * );
+}
+#endif
+
+void *VideoWindow::GetWindow( int *pi_x_hint, int *pi_y_hint,
+ unsigned int *pi_width_hint,
+ unsigned int *pi_height_hint )
+{
+#if defined(__WXGTK__) || defined(WIN32)
+ vlc_mutex_lock( &lock );
+
+ if( b_in_use )
+ {
+ msg_Dbg( p_intf, "Video window already in use" );
+ return NULL;
+ }
+
+ b_in_use = VLC_TRUE;
+
+ wxSizeEvent event( wxSize(*pi_width_hint, *pi_height_hint),
+ UpdateSize_Event );
+ AddPendingEvent( event );
+ vlc_mutex_unlock( &lock );
+
+#ifdef __WXGTK__
+ GtkWidget *p_widget = p_child_window->GetHandle();
+
+#ifdef __WXGTK20__
+ return (void *)gdk_x11_drawable_get_xid(
+ gtk_widget_get_parent_window( p_widget ) );
+#elif defined(__WXGTK__)
+ return (void *)( (char *)gtk_widget_get_parent_window( p_widget )
+ + 2 * sizeof(void *) );
+#endif
+
+#elif defined(WIN32)
+ return GetHandle();
+
+#endif
+
+#else // defined(__WXGTK__) || defined(WIN32)
+ return NULL;
+
+#endif
+}
+
+static void ReleaseWindow( intf_thread_t *p_intf, void *p_window )
+{
+ return p_intf->p_sys->p_video_window->ReleaseWindow( p_window );
+}
+
+void VideoWindow::ReleaseWindow( void *p_window )
+{
+ vlc_mutex_lock( &lock );
+
+ b_in_use = VLC_FALSE;
+
+#if defined(__WXGTK__) || defined(WIN32)
+ wxSizeEvent event( wxSize(0, 0), UpdateHide_Event );
+ AddPendingEvent( event );
+#endif
+
+ vlc_mutex_unlock( &lock );
+}
+
+void VideoWindow::UpdateSize( wxSizeEvent &event )
+{
+ if( !IsShown() )
+ {
+ p_intf->p_sys->p_video_sizer->Show( this, TRUE );
+ p_intf->p_sys->p_video_sizer->Layout();
+ SetFocus();
+ }
+ p_intf->p_sys->p_video_sizer->SetMinSize( event.GetSize() );
+
+ wxCommandEvent intf_event( wxEVT_INTF, 0 );
+ p_parent->AddPendingEvent( intf_event );
+}
+
+void VideoWindow::UpdateHide( wxSizeEvent &event )
+{
+ if( IsShown() )
+ {
+ p_intf->p_sys->p_video_sizer->Show( this, FALSE );
+ p_intf->p_sys->p_video_sizer->Layout();
+ }
+ p_intf->p_sys->p_video_sizer->SetMinSize( event.GetSize() );
+
+ wxCommandEvent intf_event( wxEVT_INTF, 0 );
+ p_parent->AddPendingEvent( intf_event );
+}
/*****************************************************************************
* Module descriptor
*****************************************************************************/
+#define EMBED_TEXT N_("Embed video in interface")
+#define EMBED_LONGTEXT N_("Embed the video window inside the interface. The "\
+ "default behaviour is to have video windows separate from the interface.")
+#define BOOKMARKS_TEXT N_("Show bookmarks dialog")
+#define BOOKMARKS_LONGTEXT N_("Show bookmarks dialog when the interface " \
+ "starts.")
+
vlc_module_begin();
#ifdef WIN32
int i_score = 150;
add_shortcut( "wx" );
set_program( "wxvlc" );
+ add_bool( "wxwin-embed", 0, NULL,
+ EMBED_TEXT, EMBED_LONGTEXT, VLC_FALSE );
+ add_bool( "wxwin-bookmarks", 0, NULL,
+ BOOKMARKS_TEXT, BOOKMARKS_LONGTEXT, VLC_FALSE );
+
add_submodule();
set_description( _("wxWindows dialogs provider") );
set_capability( "dialogs provider", 50 );
p_intf->p_sys->i_slider_pos = p_intf->p_sys->i_slider_oldpos = 0;
p_intf->p_sys->p_popup_menu = NULL;
+ p_intf->p_sys->p_video_window = NULL;
p_intf->pf_show_dialog = NULL;
* wxwindows.h: private wxWindows interface description
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
- * $Id: wxwindows.h,v 1.95 2004/03/01 18:31:13 gbazin Exp $
+ * $Id$
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
#endif
DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
+DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
class OpenDialog;
class Playlist;
class Messages;
class FileInfo;
+class VideoWindow;
#define SLIDER_MAX_POS 10000
/* Popup menu */
wxMenu *p_popup_menu;
+ VideoWindow *p_video_window;
+ wxBoxSizer *p_video_sizer;
};
/*****************************************************************************
void UpdateAcceleratorTable();
void CreateOurMenuBar();
void CreateOurToolBar();
- void CreateOurExtraPanel();
+ void CreateOurExtendedPanel();
void CreateOurSlider();
void Open( int i_access_method );
void OnOpenNet( wxCommandEvent& event );
void OnOpenSat( wxCommandEvent& event );
void OnOpenV4L( wxCommandEvent& event );
- void OnExtra( wxCommandEvent& event );
+ void OnExtended( wxCommandEvent& event );
+ void OnBookmarks( wxCommandEvent& event );
void OnShowDialog( wxCommandEvent& event );
void OnPlayStream( wxCommandEvent& event );
void OnStopStream( wxCommandEvent& event );
#endif
void OnContextMenu(wxMouseEvent& event);
+ void UpdateSizeEvent( wxCommandEvent& event );
+
DECLARE_EVENT_TABLE();
Timer *timer;
};
class StreamDialog;
+class BookmarksDialog;
/* Dialogs Provider */
class DialogsProvider: public wxFrame
void OnFileInfo( wxCommandEvent& event );
void OnPreferences( wxCommandEvent& event );
void OnStreamWizardDialog( wxCommandEvent& event );
+ void OnBookmarks( wxCommandEvent& event );
void OnOpenFileGeneric( wxCommandEvent& event );
void OnOpenFileSimple( wxCommandEvent& event );
FileInfo *p_fileinfo_dialog;
StreamDialog *p_streamwizard_dialog;
wxFrame *p_prefs_dialog;
+ BookmarksDialog *p_bookmarks_dialog;
wxFileDialog *p_file_generic_dialog;
};
int i_item_id;
};
+wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
+
+class BookmarksDialog: public wxFrame
+{
+public:
+ /* Constructor */
+ BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
+ virtual ~BookmarksDialog();
+
+ bool Show( bool );
+
+private:
+
+ void Update();
+
+ /* Event handlers (these functions should _not_ be virtual) */
+ void OnClose( wxCommandEvent& event );
+ void OnAdd( wxCommandEvent& event );
+ void OnDel( wxCommandEvent& event );
+ void OnActivateItem( wxListEvent& event );
+
+ DECLARE_EVENT_TABLE();
+
+ intf_thread_t *p_intf;
+ wxWindow *p_parent;
+
+ wxListView *list_ctrl;
+};
+
static inline int ConvertHotkeyModifiers( int i_hotkey )
{
int i_accel_flags = 0;