* skin-main.cpp: skins plugin for VLC
*****************************************************************************
* Copyright (C) 2003 VideoLAN
- * $Id: skin_main.cpp,v 1.7 2003/04/13 17:46:23 asmax Exp $
+ * $Id: skin_main.cpp,v 1.15 2003/04/21 02:50:49 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
* USA.
*****************************************************************************/
+//--- GENERAL ---------------------------------------------------------------
+#include <wx/wx.h>
//--- VLC -------------------------------------------------------------------
#include <vlc/vlc.h>
#include <vlc/aout.h>
//--- SKIN ------------------------------------------------------------------
-#include "os_api.h"
+#include "../os_api.h"
#include "event.h"
-#include "dialog.h"
-#include "os_dialog.h"
#include "banks.h"
#include "window.h"
#include "theme.h"
-#include "os_theme.h"
+#include "../os_theme.h"
#include "themeloader.h"
#include "vlcproc.h"
#include "skin_common.h"
+#include "wxdialogs.h"
//---------------------------------------------------------------------------
p_intf->p_sys->p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ // Initialize conditions
+ vlc_mutex_init( p_intf, &p_intf->p_sys->init_lock);
+ vlc_cond_init( p_intf, &p_intf->p_sys->init_cond);
+
p_intf->p_sys->p_theme = (Theme *)new OSTheme( p_intf );
return( 0 );
// Unsuscribe to messages bank
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
-
-
+ // Destroy conditions
+ vlc_cond_destroy( &p_intf->p_sys->init_cond);
+ vlc_mutex_destroy( &p_intf->p_sys->init_lock);
+
// Destroy structure
free( p_intf->p_sys );
}
DIRECTORY_SEPARATOR + "theme.xml";
#else
// FIXME: find VLC directory
- string default_dir = (string)"/home/cyril/videolan/vlc/share" +
+ string default_dir = (string)"./share" +
DIRECTORY_SEPARATOR + "skins" +
DIRECTORY_SEPARATOR + "default" +
DIRECTORY_SEPARATOR + "theme.xml";
#endif
{
// Last chance: the user can select a new theme file
+ wxFileDialog dialog( NULL, _("Open a skin file"), "", "",
+ "Skin files (*.vlt)|*.vlt|Skin files (*.xml)|*.xml|"
+ "All files|*.*", wxOPEN );
- // Initialize file structure
- OpenFileDialog *OpenFile;
- OpenFile = (OpenFileDialog *)new OSOpenFileDialog( NULL,
- _("Open skin"), false );
- OpenFile->AddFilter( _("Skin files"), "*.vlt" );
- OpenFile->AddFilter( _("Skin files"), "*.xml" );
- OpenFile->AddFilter( _("All files"), "*.*" );
-
- // Open dialog box
- if( OpenFile->Open() )
+ if( dialog.ShowModal() == wxID_OK )
{
// try to load selected file
- if( ! Loader->Load( OpenFile->FileList.front() ) )
+ if( ! Loader->Load( dialog.GetPath().c_str() ) )
{
// He, he, what the hell is he doing ?
- delete OpenFile;
delete Loader;
return;
}
}
else
{
- delete OpenFile;
delete Loader;
return;
}
-
- delete OpenFile;
}
}
// Refresh the whole interface
OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (int)true );
- // Run interface message loop
OSRun( p_intf );
}
OSAPI_PostMessage( NULL, VLC_INTF_REFRESH, 0, (long)false );
// Update the log window
- //p_intf->p_sys->p_theme->UpdateLog( p_intf->p_sys->p_sub );
+ p_intf->p_sys->MessagesDlg->UpdateLog();
+
+ // Update the file info window
+ p_intf->p_sys->InfoDlg->UpdateFileInfo();
//-------------------------------------------------------------------------
if( p_intf->p_sys->p_input != NULL && !p_intf->p_sys->p_input->b_die )
// Refresh slider
- //if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
- //{
+ // if( p_input->stream.b_seekable && p_intf->p_sys->b_playing )
+ if( p_input->stream.b_seekable )
+ {
#define p_area p_input->stream.p_selected_area
// Set value of sliders
delete[] text;
#undef p_area
- //}
+ }
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
//-------------------------------------------------------------------------
return( VLC_TRUE );
}
-//---------------------------------------------------------------------------