Carlo Calabrò <murray at via.ecp.fr> - Italian localization
Carsten Gottbehüt <gottbehuet at active-elements dot de> - v4l hotplug fix
Christof Baumgaertner - dbox web intf
+Christophe Mutricy <xtophe at nxtelevision dot com>- many fixes (preferences, M3U, ...)
Christopher Johnson <cjohnson at mint.net> - Qt fix in vlc.spec
Colin Simmonds <colin_simmonds at Mac.lover.org> - compile fix for Mac OS X
Damian Ivereigh <damian at cisco.com> - ac3dec uninitialized data structure fix
Felix Kühne <fkuehne at users.sf.net> - German translation
Frank Chao <frank0624 at gmail.com> - Chinese Traditional translation
Fumio Nakayama <endymion at ca2.so-net.ne.jp> - Japanese translation
+Gregory Hazel <ghazel et gmail dot com> - wxWidgets fixes and improvements
Goetz Waschk <waschk at informatik.uni-rostock dot de> - Mandrake packages
Haakon Meland Eriksen - Norwegian translation
Hans-Peter Jansen <hpj at urpla.net> - patch for module options handling
/* Custom events */
EVT_COMMAND(0, wxEVT_INTF, Interface::OnControlEvent)
EVT_COMMAND(1, wxEVT_INTF, Interface::OnControlEvent)
+
+ EVT_TIMER(ID_CONTROLS_TIMER, Interface::OnControlsTimer)
END_EVENT_TABLE()
/*****************************************************************************
SetupHotkeys();
+ m_controls_timer.SetOwner(this, ID_CONTROLS_TIMER);
+
/* Start timer */
timer = new Timer( p_intf, this );
switch( event.GetId() )
{
case 0:
+ {
+ int size_to_video = config_GetInt( p_intf, "wxwin-size-to-video" );
+
+ if (size_to_video)
+ {
frame_sizer->Layout();
frame_sizer->Fit(this);
+ }
+ }
break;
case 1:
* Event Handlers.
*****************************************************************************/
+void Interface::OnControlsTimer(wxTimerEvent& WXUNUSED(event))
+{
+ int size_to_video = config_GetInt( p_intf, "wxwin-size-to-video" );
+
+ /* Hide slider and Disc Buttons */
+ disc_frame->Hide();
+ slider_sizer->Hide( disc_frame );
+ slider_sizer->Layout();
+ if (size_to_video)
+ {
+ slider_sizer->Fit( slider_frame );
+ }
+
+ slider_frame->Hide();
+ frame_sizer->Hide( slider_frame );
+ frame_sizer->Layout();
+ if (size_to_video)
+ {
+ frame_sizer->Fit( this );
+ }
+}
+
void Interface::OnMenuOpen(wxMenuEvent& event)
{
#if defined( __WXMSW__ )
fprintf(stderr,"Creating window\n");
extra_frame->Hide();
frame_sizer->Hide( extra_frame );
+#if (wxCHECK_VERSION(2,5,0))
frame_sizer->Detach( extra_frame );
+#else
+ frame_sizer->Remove( extra_frame );
+#endif
frame_sizer->Layout();
frame_sizer->Fit(this);
extra_window = new ExtraWindow( p_intf, this, extra_frame );
fprintf(stderr,"Creating window\n");
extra_frame->Hide();
frame_sizer->Hide( extra_frame );
+#if (wxCHECK_VERSION(2,5,0))
frame_sizer->Detach( extra_frame );
+#else
+ frame_sizer->Remove( extra_frame );
+#endif
frame_sizer->Layout();
frame_sizer->Fit(this);
extra_window = new ExtraWindow( p_intf, this, extra_frame );
/* Create notebook */
notebook = new wxNotebook( panel, Notebook_Event );
-//#if (!wxCHECK_VERSION(2,5,0))
+#if (!wxCHECK_VERSION(2,5,0))
wxNotebookSizer *notebook_sizer = new wxNotebookSizer( notebook );
-//#endif
+#endif
notebook->AddPage( FilePanel( notebook ), wxU(_("File")),
i_access_method == FILE_ACCESS );
wxBoxSizer *panel_sizer = new wxBoxSizer( wxVERTICAL );
panel_sizer->Add( mrl_sizer_sizer, 0, wxEXPAND, 5 );
panel_sizer->Add( label, 0, wxEXPAND | wxALL, 5 );
-//#if (!wxCHECK_VERSION(2,5,0))
+#if (!wxCHECK_VERSION(2,5,0))
panel_sizer->Add( notebook_sizer, 1, wxEXPAND | wxALL, 5 );
-//#endif
+#endif
panel_sizer->Add( common_opt_sizer, 0, wxALIGN_LEFT | wxALL, 5 );
panel_sizer->Add( static_line, 0, wxEXPAND | wxALL, 5 );
panel_sizer->Add( button_sizer, 0, wxALIGN_LEFT | wxALL, 5 );
char *psz_desc;
char *psz_filter;
char *psz_module;
- } formats[] = {{ _("M3U file"), "*.m3u", "export-m3u" },
- { _("PLS file"), "*.pls", "export-pls" }};
+ } formats[] = {{ _("M3U file"), "*.m3u", "export-m3u" }};
wxString filter = wxT("");
if( config_data )
{
config_data->panel->Hide();
-#if (wxMAJOR_VERSION >= 2) && (wxMINOR_VERSION < 5 )
- p_sizer->Remove( config_data->panel );
-#else
+#if (wxCHECK_VERSION(2,5,0))
p_sizer->Detach( config_data->panel );
+#else
+ p_sizer->Remove( config_data->panel );
#endif
}
if( config_data && config_data->panel )
{
config_data->panel->Hide();
-#if (wxMAJOR_VERSION >= 2) && (xwMINOR_VERSION < 5 )
- p_sizer->Remove( config_data->panel );
-#else
+#if (wxCHECK_VERSION(2,5,0))
p_sizer->Detach( config_data->panel );
+#else
+ p_sizer->Remove( config_data->panel );
#endif
}
if( config_data )
{
config_data->panel->Hide();
-
-#if (wxMAJOR_VERSION >= 2) && (xwMINOR_VERSION < 5 )
- p_sizer->Remove( config_data->panel );
-#else
+#if (wxCHECK_VERSION(2,5,0))
p_sizer->Detach( config_data->panel );
+#else
+ p_sizer->Remove( config_data->panel );
#endif
}
if( p_intf->p_sys->p_input )
{
p_main_interface->slider->SetValue( 0 );
- b_old_seekable = VLC_FALSE;
+ b_slider_shown = VLC_FALSE;
b_disc_shown = VLC_FALSE;
char *psz_now_playing = vlc_input_item_GetInfo(
}
else if( p_intf->p_sys->p_input->b_dead )
{
- /* Hide slider and Disc Buttons */
- p_main_interface->disc_frame->Hide();
- p_main_interface->slider_sizer->Hide(
- p_main_interface->disc_frame );
- p_main_interface->slider_sizer->Layout();
- p_main_interface->slider_sizer->Fit( p_main_interface->slider_frame );
-
- p_main_interface->slider_frame->Hide();
- p_main_interface->frame_sizer->Hide(
- p_main_interface->slider_frame );
- p_main_interface->frame_sizer->Layout();
- p_main_interface->frame_sizer->Fit( p_main_interface );
+ int size_to_video = config_GetInt( p_intf, "wxwin-size-to-video" );
+
+ //controls auto-hide after a timer
+ p_main_interface->m_controls_timer.Start(1000, wxTIMER_ONE_SHOT);
p_main_interface->TogglePlayButton( PAUSE_S );
i_old_playing_status = PAUSE_S;
if( p_intf->p_sys->p_input )
{
+ int size_to_video = config_GetInt( p_intf, "wxwin-size-to-video" );
input_thread_t *p_input = p_intf->p_sys->p_input;
vlc_value_t val;
{
vlc_value_t pos;
+ //prevent the controls from auto-hiding
+ p_main_interface->m_controls_timer.Stop();
+
/* New input or stream map change */
p_intf->p_sys->b_playing = 1;
free( psz_now_playing );
/* Manage the slider */
- /* FIXME --fenrir */
- /* Change the name of b_old_seekable into b_show_bar or something like that */
var_Get( p_input, "position", &pos );
var_Change( p_input, "title", VLC_VAR_CHOICESCOUNT, &val, NULL );
p_main_interface->disc_sizer->Layout();
p_main_interface->disc_sizer->Fit(
p_main_interface->disc_frame );
-
p_main_interface->disc_menu_button->SetToolTip(
wxU(_( HELP_MENU ) ) );
p_main_interface->disc_prev_button->SetToolTip(
p_main_interface->disc_frame );
}
- if( ! b_old_seekable )
- {
if( pos.f_float > 0.0 )
{
/* Done like this, as it's the only way to know if the */
/* slider has to be displayed */
- b_old_seekable = VLC_TRUE;
+
+ if( !b_slider_shown )
+ {
+ b_slider_shown = VLC_TRUE;
p_main_interface->slider_frame->Show();
p_main_interface->frame_sizer->Show(
p_main_interface->slider_frame );
+
p_main_interface->frame_sizer->Layout();
+ if (size_to_video)
+ {
p_main_interface->frame_sizer->Fit( p_main_interface );
}
}
+ }
+ else
+ {
+ if( b_slider_shown )
+ {
+ p_main_interface->slider_frame->Hide();
+ p_main_interface->frame_sizer->Hide(
+ p_main_interface->slider_frame );
+
+ p_main_interface->frame_sizer->Layout();
+ if (size_to_video)
+ {
+ p_main_interface->frame_sizer->Fit( p_main_interface );
+ }
+ }
+ }
- if( p_intf->p_sys->b_playing && b_old_seekable )
+ if( p_intf->p_sys->b_playing && b_slider_shown )
{
/* Update the slider if the user isn't dragging it. */
if( p_intf->p_sys->b_slider_free )
}
#if 0
vlc_mutex_lock( &p_input->stream.stream_lock );
- if( p_intf->p_sys->p_input->stream.b_seekable && !b_old_seekable )
+ if( p_intf->p_sys->p_input->stream.b_seekable && !b_slider_shown )
{
/* Done like this because b_seekable is set slightly after
* the new input object is available. */
- b_old_seekable = VLC_TRUE;
+ b_slider_shown = VLC_TRUE;
p_main_interface->slider_frame->Show();
p_main_interface->frame_sizer->Show(
p_main_interface->slider_frame );
i_old_rate = val.i_int;
}
}
-
}
else if( p_intf->p_sys->b_playing && !p_intf->b_die )
{
return VLC_SUCCESS;
}
+
/*****************************************************************************
* IntfShowCB: callback triggered by the intf-show playlist variable.
*****************************************************************************/
UpdateSize_Event = wxID_HIGHEST + 1,
UpdateHide_Event,
SetStayOnTop_Event,
+ ID_HIDE_TIMER
};
class VideoWindow: public wxWindow
wxWindow *p_child_window;
- void UpdateSize( wxEvent & );
- void UpdateHide( wxEvent & );
- void OnControlEvent( wxCommandEvent & );
+ wxTimer m_hide_timer;
+
+ void UpdateSize( wxEvent& event );
+ void UpdateHide( wxEvent& event );
+ void OnControlEvent( wxCommandEvent& event );
+ void OnHideTimer( wxTimerEvent& WXUNUSED(event));
DECLARE_EVENT_TABLE();
};
EVT_CUSTOM( wxEVT_SIZE, UpdateHide_Event, VideoWindow::UpdateHide )
EVT_COMMAND( SetStayOnTop_Event, wxEVT_VLC_VIDEO,
VideoWindow::OnControlEvent )
+ EVT_TIMER( ID_HIDE_TIMER, VideoWindow::OnHideTimer )
END_EVENT_TABLE()
/*****************************************************************************
vlc_mutex_init( p_intf, &lock );
+ int size_to_video = config_GetInt( p_intf, "wxwin-size-to-video" );
+
p_vout = NULL;
+ m_hide_timer.SetOwner(this, ID_HIDE_TIMER);
+
p_intf->pf_request_window = ::GetWindow;
p_intf->pf_release_window = ::ReleaseWindow;
p_intf->pf_control_window = ::ControlWindow;
p_intf->p_sys->p_video_window = this;
- p_child_window = new wxWindow( this, -1, wxDefaultPosition, wxSize(0,0) );
+
+ wxSize child_size = wxSize(0,0);
+ if (!size_to_video)
+ {
+ //maybe this size should be an option
+ child_size = wxSize( wxSystemSettings::GetMetric( wxSYS_SCREEN_X ) / 2,
+ wxSystemSettings::GetMetric( wxSYS_SCREEN_Y ) / 2);
+
+ SetSize(child_size);
+ }
+
+ p_child_window = new wxWindow( this, -1, wxDefaultPosition, child_size );
+
+
+ if (!size_to_video)
+ {
+ //show the window so we can see the background where the video will be
p_child_window->Show();
Show();
b_shown = VLC_TRUE;
+ }
+ else
+ {
+ //othewise the video window is shown when a video starts
+ //but hide it now, so we can set the background color without it showing
+ p_child_window->Hide();
+ Hide();
+ b_shown = VLC_FALSE;
+ }
+
+ p_child_window->SetBackgroundColour(*wxBLACK);
+ SetBackgroundColour(*wxBLACK);
p_intf->p_sys->p_video_sizer = new wxBoxSizer( wxHORIZONTAL );
p_intf->p_sys->p_video_sizer->Add( this, 1, wxEXPAND );
p_vout = NULL;
+ int size_to_video = config_GetInt( p_intf, "wxwin-size-to-video" );
+
+ if (size_to_video)
+ {
#if defined(__WXGTK__) || defined(WIN32)
wxSizeEvent event( wxSize(0, 0), UpdateHide_Event );
AddPendingEvent( event );
#endif
+ }
vlc_mutex_unlock( &lock );
}
void VideoWindow::UpdateSize( wxEvent &_event )
{
+ int size_to_video = config_GetInt( p_intf, "wxwin-size-to-video" );
+
+ m_hide_timer.Stop();
+
+ if (size_to_video)
+ {
wxSizeEvent * event = (wxSizeEvent*)(&_event);
if( !b_shown )
{
wxCommandEvent intf_event( wxEVT_INTF, 0 );
p_parent->AddPendingEvent( intf_event );
}
+ else
+ {
+ //this is a very hackish way to show in case the user switched
+ //size-to-video off while no video was playing, which would leave
+ //the window hidden and of 0 size
+ if( !b_shown )
+ {
+ p_intf->p_sys->p_video_sizer->Show( this, TRUE );
+ SetFocus();
+ b_shown = VLC_TRUE;
+
+ wxSize child_size = wxSize( wxSystemSettings::GetMetric( wxSYS_SCREEN_X ) / 2,
+ wxSystemSettings::GetMetric( wxSYS_SCREEN_Y ) / 2);
+
+ SetSize(child_size);
+ p_child_window->SetSize(child_size);
+
+ Interface * intf = (Interface *)p_parent;
+ intf->frame_sizer->Layout();
+ intf->frame_sizer->Fit(intf);
+ }
+ }
+}
void VideoWindow::UpdateHide( wxEvent &_event )
{
- wxSizeEvent * event = (wxSizeEvent*)(&_event);
+ int size_to_video = config_GetInt( p_intf, "wxwin-size-to-video" );
+
+ if (size_to_video)
+ {
+ m_hide_timer.Start(1000, wxTIMER_ONE_SHOT);
+ }
+}
+
+void VideoWindow::OnHideTimer( wxTimerEvent& WXUNUSED(event))
+{
+ //wxSizeEvent * event = (wxSizeEvent*)(&_event);
if( b_shown )
{
p_intf->p_sys->p_video_sizer->Show( this, FALSE );
b_shown = VLC_FALSE;
SetSize(0,0);
- Show();
+ Hide();
}
- p_intf->p_sys->p_video_sizer->SetMinSize( event->GetSize() );
+ //ok I cheat here, but is it ever not 0,0?
+ p_intf->p_sys->p_video_sizer->SetMinSize( wxSize(0,0) );
wxCommandEvent intf_event( wxEVT_INTF, 0 );
p_parent->AddPendingEvent( intf_event );
{
case VOUT_SET_ZOOM:
{
+ int size_to_video = config_GetInt( p_intf, "wxwin-size-to-video" );
+
+ if (size_to_video)
+ {
double f_arg = va_arg( args, double );
/* Update dimensions */
wxSizeEvent event( wxSize((int)(p_vout->i_window_width * f_arg),
(int)(p_vout->i_window_height * f_arg)),
UpdateSize_Event );
+
+
AddPendingEvent( event );
+ }
i_ret = VLC_SUCCESS;
}
#define TASKBAR_LONGTEXT N_("Show taskbar entry")
#define MINIMAL_TEXT N_("Minimal interface")
#define MINIMAL_LONGTEXT N_("Use minimal interface, no toolbar, few menus")
+#define SIZE_TO_VIDEO_TEXT N_("Size to video")
+#define SIZE_TO_VIDEO_LONGTEXT N_("Resize VLC to match the video resolution")
#define SYSTRAY_TEXT N_("Show systray icon")
#define SYSTRAY_LONGTEXT N_("Show systray icon")
TASKBAR_TEXT, TASKBAR_LONGTEXT, VLC_FALSE );
add_bool( "wxwin-minimal", 0, NULL,
MINIMAL_TEXT, MINIMAL_LONGTEXT, VLC_TRUE );
+ add_bool( "wxwin-size-to-video", 1, NULL,
+ SIZE_TO_VIDEO_TEXT, SIZE_TO_VIDEO_LONGTEXT, VLC_TRUE );
#ifdef wxHAS_TASK_BAR_ICON
add_bool( "wxwin-systray", 0, NULL,
SYSTRAY_TEXT, SYSTRAY_LONGTEXT, VLC_FALSE );
#include <wx/taskbar.h>
#include "vlc_keys.h"
-//PITA
#if (!wxCHECK_VERSION(2,5,0))
typedef long wxTreeItemIdValue;
#endif
-
DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
#define MODE_AUTHOR 2
#define MODE_TITLE 3
+enum{
+ ID_CONTROLS_TIMER,
+};
+
class DialogsProvider;
class PrefsTreeCtrl;
class AutoBuiltPanel;
vlc_bool_t b_init;
int i_old_playing_status;
int i_old_rate;
- vlc_bool_t b_old_seekable;
+ vlc_bool_t b_slider_shown;
vlc_bool_t b_disc_shown;
};
Systray *p_systray;
#endif
+ wxTimer m_controls_timer;
+
private:
void SetupHotkeys();
void CreateOurMenuBar();
void Open( int i_access_method );
/* Event handlers (these functions should _not_ be virtual) */
+ void OnControlsTimer(wxTimerEvent& WXUNUSED(event));
+
void OnExit( wxCommandEvent& event );
void OnAbout( wxCommandEvent& event );
{
char *psz_author =
vlc_input_item_GetInfo( &p_playlist->pp_items[i]->input,
- _("General"), _("Author") );
-
- fprintf( p_export->p_file, "#EXTINF:%i,%s,%s\n",
+ _("Meta-information"), _("Artist") );
+ if( psz_author && *psz_author )
+ {
+ fprintf( p_export->p_file, "#EXTINF:%i,%s - %s\n",
(int)(p_playlist->pp_items[i]->input.i_duration/1000000),
- psz_author ? psz_author : "",
- p_playlist->pp_items[i]->input.psz_name );
+ psz_author, p_playlist->pp_items[i]->input.psz_name );
+ }
+ else
+ {
+ fprintf( p_export->p_file, "#EXTINF:%i,%s\n",
+ (int)(p_playlist->pp_items[i]->input.i_duration/1000000),
+ p_playlist->pp_items[i]->input.psz_name );
+ }
+ free(psz_author);
}
/* VLC specific options */