# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include <vlc_aout.h>
#include <vlc_interface.h>
fLastUpdateTime( system_time() ),
fSettings( new BMessage( 'sett' ) )
{
- p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ p_playlist = pl_Hold( p_intf );
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, this );
- var_AddCallback( p_playlist, "item-append", PlaylistChanged, this );
- var_AddCallback( p_playlist, "item-deleted", PlaylistChanged, this );
- var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, this );
+ var_AddCallback( p_playlist, "playlist-item-append", PlaylistChanged, this );
+ var_AddCallback( p_playlist, "playlist-item-deleted", PlaylistChanged, this );
+ var_AddCallback( p_playlist, "item-current", PlaylistChanged, this );
char psz_tmp[1024];
#define ADD_ELLIPSIS( a ) \
case NAVIGATE_NEXT:
if( p_input )
{
- vlc_value_t val, val_list;
-
/* First try to go to next chapter */
if( !var_Get( p_input, "chapter", &val ) )
{
- var_Change( p_input, "chapter", VLC_VAR_GETCHOICES,
- &val_list, NULL );
- if( val_list.p_list->i_count > val.i_int )
+ int i_chapter_count = var_CountChoices( p_input, "chapter" );
+ if( i_chapter_count > val.i_int )
{
- var_Change( p_input, "chapter", VLC_VAR_FREELIST,
- &val_list, NULL );
var_SetVoid( p_input, "next-chapter" );
break;
}
- var_Change( p_input, "chapter", VLC_VAR_FREELIST,
- &val_list, NULL );
}
/* Try to go to next title */
if( !var_Get( p_input, "title", &val ) )
{
- var_Change( p_input, "title", VLC_VAR_GETCHOICES,
- &val_list, NULL );
- if( val_list.p_list->i_count > val.i_int )
+ int i_title_count = var_CountChoices( p_input, "title" );
+ if( i_title_count > val.i_int )
{
- var_Change( p_input, "title", VLC_VAR_FREELIST,
- &val_list, NULL );
var_SetVoid( p_input, "next-title" );
break;
}
- var_Change( p_input, "title", VLC_VAR_FREELIST,
- &val_list, NULL );
}
/* Try to go to next file */
{
/* Save the volume */
config_PutInt( p_intf, "volume", p_mediaControl->GetVolume() );
- config_SaveConfigFile( p_intf, "main" );
/* Save the windows positions */
if ( fSettings->ReplaceRect( "main frame", Frame() ) != B_OK )
}
AddItem( item );
}
- var_Change( p_input, psz_variable, VLC_VAR_FREELIST, &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
vlc_object_release( p_input );
AddItem( item );
}
- var_Change( p_input, "title", VLC_VAR_FREELIST,
- &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
}
vlc_object_release( p_input );
BMenu::AttachedToWindow();
AddItem( item );
}
- var_Change( p_input, "chapter", VLC_VAR_FREELIST,
- &val_list, &text_list );
+ var_FreeList( &val_list, &text_list );
}
vlc_object_release( p_input );
BMenu::AttachedToWindow();