*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
p_main_interface = _p_main_interface;
b_init = 0;
+ var_AddCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
+
/* Register callback for the intf-popupmenu variable */
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if( p_playlist != NULL )
- {
- var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
- var_AddCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
- vlc_object_release( p_playlist );
- }
+ var_AddCallback( p_intf->p_libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
Start( 100 /*milliseconds*/, wxTIMER_CONTINUOUS );
}
Timer::~Timer()
{
+ var_DelCallback( p_intf->p_libvlc, "intf-show", IntfShowCB, p_intf );
+
/* Unregister callback */
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if( p_playlist != NULL )
- {
- var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
- var_DelCallback( p_playlist, "intf-show", IntfShowCB, p_intf );
- vlc_object_release( p_playlist );
- }
+ var_DelCallback( p_intf->p_libvlc, "intf-popupmenu", PopupMenuCB, p_intf );
}
/*****************************************************************************
if( !b_init )
{
p_main_interface->Init();
- b_init = VLC_TRUE;
+ b_init = true;
}
#endif
if( p_intf->p_sys->b_intf_show )
{
p_main_interface->Raise();
- p_intf->p_sys->b_intf_show = VLC_FALSE;
+ p_main_interface->Show();
+ p_intf->p_sys->b_intf_show = false;
}
- if( p_intf->b_die )
+ if( intf_ShouldDie( p_intf ) )
{
vlc_mutex_unlock( &p_intf->change_lock );
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
intf_thread_t *p_intf = (intf_thread_t *)param;
- p_intf->p_sys->b_intf_show = VLC_TRUE;
+ p_intf->p_sys->b_intf_show = true;
return VLC_SUCCESS;
}