return new VideoWindow( p_intf, p_parent );
}
+void UpdateVideoWindow( intf_thread_t *p_intf, wxWindow *p_window )
+{
+#if (wxCHECK_VERSION(2,5,0))
+ if( p_window && p_intf->p_sys->p_video_sizer && p_window->IsShown() )
+ p_intf->p_sys->p_video_sizer->SetMinSize( p_window->GetSize() );
+#endif
+}
+
/*****************************************************************************
* Constructor.
*****************************************************************************/
vlc_mutex_init( p_intf, &lock );
- b_auto_size = config_GetInt( p_intf, "wxwin-size-to-video" );
+ b_auto_size = config_GetInt( p_intf, "wxwin-autosize" );
p_vout = NULL;
wxSize child_size = wxSize(0,0);
if( !b_auto_size )
{
+ WindowSettings *ws = p_intf->p_sys->p_window_settings;
+ wxPoint p; bool b_shown;
+
// Maybe this size should be an option
child_size = wxSize( wxSystemSettings::GetMetric(wxSYS_SCREEN_X) / 2,
wxSystemSettings::GetMetric(wxSYS_SCREEN_Y) / 2 );
+ ws->GetSettings( WindowSettings::ID_VIDEO, b_shown, p, child_size );
SetSize( child_size );
}
p_child_window = new wxWindow( this, -1, wxDefaultPosition, child_size );
+ if( !b_auto_size )
+ {
+ SetBackgroundColour( *wxBLACK );
+ p_child_window->SetBackgroundColour( *wxBLACK );
+ }
+
p_child_window->Show();
Show();
b_shown = VLC_TRUE;
- p_child_window->SetBackgroundColour( *wxBLACK );
- SetBackgroundColour( *wxBLACK );
-
p_intf->p_sys->p_video_sizer = new wxBoxSizer( wxHORIZONTAL );
+#if (wxCHECK_VERSION(2,5,3))
+ p_intf->p_sys->p_video_sizer->Add( this, 1, wxEXPAND|wxFIXED_MINSIZE );
+#else
p_intf->p_sys->p_video_sizer->Add( this, 1, wxEXPAND );
+#endif
ReleaseWindow( NULL );
}
p_intf->pf_control_window = NULL;
vlc_mutex_unlock( &lock );
+ if( !b_auto_size )
+ {
+ WindowSettings *ws = p_intf->p_sys->p_window_settings;
+ ws->SetSettings( WindowSettings::ID_VIDEO, true,
+ GetPosition(), GetSize() );
+ }
+
vlc_mutex_destroy( &lock );
}
void VideoWindow::ReleaseWindow( void *p_window )
{
- if( !b_auto_size ) return;
-
vlc_mutex_lock( &lock );
-
p_vout = NULL;
+ vlc_mutex_unlock( &lock );
+
+ if( !b_auto_size ) return;
#if defined(__WXGTK__) || defined(WIN32)
wxSizeEvent event( wxSize(0, 0), UpdateHide_Event );
AddPendingEvent( event );
#endif
-
- vlc_mutex_unlock( &lock );
}
void VideoWindow::UpdateSize( wxEvent &_event )
void VideoWindow::UpdateHide( wxEvent &_event )
{
- if( b_auto_size) m_hide_timer.Start( 200, wxTIMER_ONE_SHOT );
+ if( b_auto_size ) m_hide_timer.Start( 200, 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 );
+ SetSize( 0, 0 );
p_intf->p_sys->p_video_sizer->Layout();
b_shown = VLC_FALSE;
-
- SetSize(0,0);
- Hide();
}
- //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 );