📄 skin_main.cpp
字号:
} } delete pLoader; if( 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_LockControl( p_playlist, PLAYLIST_AUTOPLAY ); vlc_object_release( p_playlist ); } } // Enter the main event loop loop->run(); // Delete the theme and save the configuration of the windows if( p_intf->p_sys->p_theme ) { p_intf->p_sys->p_theme->saveConfig(); delete p_intf->p_sys->p_theme; p_intf->p_sys->p_theme = NULL; }}//---------------------------------------------------------------------------// DemuxOpen: initialize demux//---------------------------------------------------------------------------static int DemuxOpen( vlc_object_t *p_this ){ demux_t *p_demux = (demux_t*)p_this; intf_thread_t *p_intf; char *ext; // Needed callbacks p_demux->pf_demux = Demux; p_demux->pf_control = DemuxControl; // Test that we have a valid .vlt or .wsz file, based on the extension // TODO: an actual check of the contents would be better... if( ( ext = strchr( p_demux->psz_path, '.' ) ) == NULL || ( strcasecmp( ext, ".vlt" ) && strcasecmp( ext, ".wsz" ) ) ) { return VLC_EGENERIC; } p_intf = (intf_thread_t *)vlc_object_find( p_this, VLC_OBJECT_INTF, FIND_ANYWHERE ); if( p_intf != NULL ) { // 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 p_playlist->pp_items[p_playlist->i_index]->b_autodeletion = VLC_TRUE; vlc_object_release( p_playlist ); } vlc_value_t val; val.psz_string = p_demux->psz_path; var_Set( p_intf, "skin-to-load", val ); } else { msg_Warn( p_this, "skin could not be loaded (not using skins2 intf)" ); } vlc_object_release( p_intf ); } return VLC_SUCCESS;}//---------------------------------------------------------------------------// Demux: return EOF//---------------------------------------------------------------------------static int Demux( demux_t *p_demux ){ return 0;}//---------------------------------------------------------------------------// DemuxControl//---------------------------------------------------------------------------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 );}//---------------------------------------------------------------------------// Callbacks//---------------------------------------------------------------------------#ifdef WIN32/// Callback for the systray configuration optionstatic int onSystrayChange( vlc_object_t *pObj, const char *pVariable, vlc_value_t oldVal, vlc_value_t newVal, void *pParam ){ intf_thread_t *pIntf = (intf_thread_t*)vlc_object_find( pObj, VLC_OBJECT_INTF, FIND_ANYWHERE ); if( pIntf == NULL ) { return VLC_EGENERIC; } // Check that we found the correct interface (same check as for the demux) if( var_Type( pIntf, "skin-to-load" ) == VLC_VAR_STRING ) { AsyncQueue *pQueue = AsyncQueue::instance( pIntf ); if( newVal.b_bool ) { CmdAddInTray *pCmd = new CmdAddInTray( pIntf ); pQueue->push( CmdGenericPtr( pCmd ) ); } else { CmdRemoveFromTray *pCmd = new CmdRemoveFromTray( pIntf ); pQueue->push( CmdGenericPtr( pCmd ) ); } } vlc_object_release( pIntf ); return VLC_SUCCESS;}/// Callback for the systray configuration optionstatic int onTaskBarChange( vlc_object_t *pObj, const char *pVariable, vlc_value_t oldVal, vlc_value_t newVal, void *pParam ){ intf_thread_t *pIntf = (intf_thread_t*)vlc_object_find( pObj, VLC_OBJECT_INTF, FIND_ANYWHERE ); if( pIntf == NULL ) { return VLC_EGENERIC; } // Check that we found the correct interface (same check as for the demux) if( var_Type( pIntf, "skin-to-load" ) == VLC_VAR_STRING ) { AsyncQueue *pQueue = AsyncQueue::instance( pIntf ); if( newVal.b_bool ) { CmdAddInTaskBar *pCmd = new CmdAddInTaskBar( pIntf ); pQueue->push( CmdGenericPtr( pCmd ) ); } else { CmdRemoveFromTaskBar *pCmd = new CmdRemoveFromTaskBar( pIntf ); pQueue->push( CmdGenericPtr( pCmd ) ); } } vlc_object_release( pIntf ); return VLC_SUCCESS;}#endif//---------------------------------------------------------------------------// Module descriptor//---------------------------------------------------------------------------#define SKINS2_LAST N_("Skin to use")#define SKINS2_LAST_LONG N_("Path to the skin to use.")#define SKINS2_CONFIG N_("Config of last used skin")#define SKINS2_CONFIG_LONG N_("Windows configuration of the last skin used. " \ "This option is updated automatically, do not touch it." )#define SKINS2_SYSTRAY N_("Systray icon")#define SKINS2_SYSTRAY_LONG N_("Show a systray icon for VLC")#define SKINS2_TASKBAR N_("Show VLC on the taskbar")#define SKINS2_TASKBAR_LONG N_("Show VLC on the taskbar")#define SKINS2_TRANSPARENCY N_("Enable transparency effects")#define SKINS2_TRANSPARENCY_LONG N_("You can disable all transparency effects"\ " if you want. This is mainly useful when moving windows does not behave" \ " correctly.")#define SKINS2_PLAYLIST N_("Enable skinned playlist")#define SKINS2_PLAYLIST_LONG N_("You can choose whether the playlist window"\ " is rendered using the skin or the default GUI.")vlc_module_begin(); set_category( CAT_INTERFACE ); set_subcategory( SUBCAT_INTERFACE_MAIN ); add_string( "skins2-last", "", NULL, SKINS2_LAST, SKINS2_LAST_LONG, VLC_TRUE ); change_autosave(); add_string( "skins2-config", "", NULL, SKINS2_CONFIG, SKINS2_CONFIG_LONG, VLC_TRUE ); change_autosave();#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 );#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" ); set_program( "svlc" ); add_submodule(); set_description( _("Skins loader demux") ); set_capability( "demux2", 5 ); set_callbacks( DemuxOpen, NULL );vlc_module_end();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -