# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
#include <vlc_input.h>
#include <vlc_demux.h>
#include <vlc_playlist.h>
+#include <vlc_window.h>
#include "dialogs.hpp"
#include "os_factory.hpp"
// Allocate instance and initialize some members
p_intf->p_sys = (intf_sys_t *) malloc( sizeof( intf_sys_t ) );
if( p_intf->p_sys == NULL )
- {
- msg_Err( p_intf, "out of memory" );
return( VLC_ENOMEM );
- };
p_intf->pf_run = Run;
// Suscribe to messages bank
- p_intf->p_sys->p_sub = msg_Subscribe( p_intf, MSG_QUEUE_NORMAL );
+#if 0
+ p_intf->p_sys->p_sub = msg_Subscribe( p_intf );
+#endif
p_intf->p_sys->p_input = NULL;
- p_intf->p_sys->p_playlist = (playlist_t *)vlc_object_find( p_intf,
- VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
- if( p_intf->p_sys->p_playlist == NULL )
- {
- msg_Err( p_intf, "No playlist object found" );
- msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
- return VLC_EGENERIC;
- }
+ p_intf->p_sys->p_playlist = pl_Hold( p_intf );
// Initialize "singleton" objects
p_intf->p_sys->p_logger = NULL;
{
msg_Err( p_intf, "cannot initialize OSFactory" );
vlc_object_release( p_intf->p_sys->p_playlist );
+#if 0
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
+#endif
return VLC_EGENERIC;
}
if( AsyncQueue::instance( p_intf ) == NULL )
{
msg_Err( p_intf, "cannot initialize AsyncQueue" );
vlc_object_release( p_intf->p_sys->p_playlist );
+#if 0
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
+#endif
return VLC_EGENERIC;
}
if( Interpreter::instance( p_intf ) == NULL )
{
msg_Err( p_intf, "cannot instanciate Interpreter" );
vlc_object_release( p_intf->p_sys->p_playlist );
+#if 0
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
+#endif
return VLC_EGENERIC;
}
if( VarManager::instance( p_intf ) == NULL )
{
msg_Err( p_intf, "cannot instanciate VarManager" );
vlc_object_release( p_intf->p_sys->p_playlist );
+#if 0
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
+#endif
return VLC_EGENERIC;
}
if( VlcProc::instance( p_intf ) == NULL )
{
msg_Err( p_intf, "cannot initialize VLCProc" );
vlc_object_release( p_intf->p_sys->p_playlist );
+#if 0
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
+#endif
return VLC_EGENERIC;
}
Dialogs::instance( p_intf );
ThemeRepository::instance( p_intf );
- // We support play on start
- p_intf->b_play = VLC_TRUE;
+#ifdef WIN32
+ p_intf->b_should_run_on_first_thread = true;
+#endif
return( VLC_SUCCESS );
}
}
// Unsubscribe from messages bank
+#if 0
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
+#endif
// Destroy structure
free( p_intf->p_sys );
//---------------------------------------------------------------------------
static void Run( intf_thread_t *p_intf )
{
+ int canc = vlc_savecancel();
// Load a theme
ThemeLoader *pLoader = new ThemeLoader( p_intf );
char *skin_last = config_GetPsz( p_intf, "skins2-last" );
}
delete pLoader;
- if( skin_last )
- {
- free( skin_last );
- }
+ free( skin_last );
// Get the instance of OSLoop
OSLoop *loop = OSFactory::instance( p_intf )->getOSLoop();
- // Check if we need to start playing
- if( p_intf->b_play )
- {
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if( p_playlist )
- {
- playlist_Control( p_playlist, PLAYLIST_AUTOPLAY, VLC_FALSE );
- vlc_object_release( p_playlist );
- }
- }
-
// Enter the main event loop
loop->run();
delete p_intf->p_sys->p_theme;
p_intf->p_sys->p_theme = NULL;
}
+ vlc_restorecancel(canc);
}
+// Callbacks for vout requests
+static int WindowOpen( vlc_object_t *p_this )
+{
+ vout_window_t *pWnd = (vout_window_t *)p_this;
+ intf_thread_t *pIntf = (intf_thread_t *)
+ vlc_object_find_name( p_this, "skins2", FIND_ANYWHERE );
+
+ if( pIntf == NULL )
+ return VLC_EGENERIC;
+
+ /* FIXME: most probably not thread-safe,
+ * albeit no worse than ever before */
+ pWnd->handle = VlcProc::getWindow( pIntf, pWnd->vout,
+ &pWnd->pos_x, &pWnd->pos_y,
+ &pWnd->width, &pWnd->height );
+ pWnd->p_private = pIntf;
+ pWnd->control = &VlcProc::controlWindow;
+ return VLC_SUCCESS;
+}
+
+
+static void WindowClose( vlc_object_t *p_this )
+{
+ vout_window_t *pWnd = (vout_window_t *)p_this;
+ intf_thread_t *pIntf = (intf_thread_t *)p_this->p_private;
+
+ VlcProc::releaseWindow( pIntf, pWnd->handle );
+}
+
//---------------------------------------------------------------------------
// DemuxOpen: initialize demux
//---------------------------------------------------------------------------
// Do nothing is skins2 is not the main interface
if( var_Type( p_intf, "skin-to-load" ) == VLC_VAR_STRING )
{
- playlist_t *p_playlist =
- (playlist_t *) vlc_object_find( p_this, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if( p_playlist != NULL )
- {
- // Make sure the item is deleted afterwards
- /// \bug does not always work
- p_playlist->status.p_item->i_flags |= PLAYLIST_REMOVE_FLAG;
- vlc_object_release( p_playlist );
- }
+ playlist_t *p_playlist = pl_Hold( p_this );
+ // Make sure the item is deleted afterwards
+ /// \bug does not always work
+ playlist_CurrentPlayingItem( p_playlist )->i_flags |= PLAYLIST_REMOVE_FLAG;
+ vlc_object_release( p_playlist );
vlc_value_t val;
val.psz_string = p_demux->psz_path;
//---------------------------------------------------------------------------
static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
{
- return demux2_vaControlHelper( p_demux->s, 0, 0, 0, 1, i_query, args );
+ return demux_vaControlHelper( p_demux->s, 0, 0, 0, 1, i_query, args );
}
#define SKINS2_PLAYLIST N_("Use a skinned playlist")
#define SKINS2_PLAYLIST_LONG N_("Use a skinned playlist")
-vlc_module_begin();
- set_category( CAT_INTERFACE );
- set_subcategory( SUBCAT_INTERFACE_MAIN );
+vlc_module_begin ()
+ set_category( CAT_INTERFACE )
+ set_subcategory( SUBCAT_INTERFACE_MAIN )
add_file( "skins2-last", "", NULL, SKINS2_LAST, SKINS2_LAST_LONG,
- VLC_TRUE );
- change_autosave();
+ true );
+ change_autosave ()
add_string( "skins2-config", "", NULL, SKINS2_CONFIG, SKINS2_CONFIG_LONG,
- VLC_TRUE );
- change_autosave();
- change_internal();
+ true );
+ change_autosave ()
+ change_internal ()
#ifdef WIN32
- add_bool( "skins2-systray", VLC_FALSE, onSystrayChange, SKINS2_SYSTRAY,
- SKINS2_SYSTRAY_LONG, VLC_FALSE );
- add_bool( "skins2-taskbar", VLC_TRUE, onTaskBarChange, SKINS2_TASKBAR,
- SKINS2_TASKBAR_LONG, VLC_FALSE );
- add_bool( "skins2-transparency", VLC_FALSE, NULL, SKINS2_TRANSPARENCY,
- SKINS2_TRANSPARENCY_LONG, VLC_FALSE );
+ add_bool( "skins2-systray", false, onSystrayChange, SKINS2_SYSTRAY,
+ SKINS2_SYSTRAY_LONG, false );
+ add_bool( "skins2-taskbar", true, onTaskBarChange, SKINS2_TASKBAR,
+ SKINS2_TASKBAR_LONG, false );
+ add_bool( "skins2-transparency", false, NULL, SKINS2_TRANSPARENCY,
+ SKINS2_TRANSPARENCY_LONG, false );
#endif
- add_bool( "skinned-playlist", VLC_TRUE, NULL, SKINS2_PLAYLIST,
- SKINS2_PLAYLIST_LONG, VLC_FALSE );
- set_shortname( _("Skins"));
- set_description( _("Skinnable Interface") );
- set_capability( "interface", 30 );
- set_callbacks( Open, Close );
- add_shortcut( "skins" );
+ add_bool( "skinned-playlist", true, NULL, SKINS2_PLAYLIST,
+ SKINS2_PLAYLIST_LONG, false );
+ set_shortname( N_("Skins"))
+ set_description( N_("Skinnable Interface") )
+ set_capability( "interface", 30 )
+ set_callbacks( Open, Close )
+ add_shortcut( "skins" )
+
+ add_submodule ()
+ set_capability( "vout_window", 51 )
+ set_callbacks( WindowOpen, WindowClose )
- add_submodule();
- set_description( _("Skins loader demux") );
- set_capability( "demux2", 5 );
- set_callbacks( DemuxOpen, NULL );
+ add_submodule ()
+ set_description( N_("Skins loader demux") )
+ set_capability( "demux", 5 )
+ set_callbacks( DemuxOpen, NULL )
-vlc_module_end();
+vlc_module_end ()