void DialogsProvider::OnOpenFileSimple( wxCommandEvent& event )
{
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL )
{
return;
wxLocaleFree( psz_utf8 );
}
}
-
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
void DialogsProvider::OnOpenDirectory( wxCommandEvent& event )
{
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL )
{
return;
PLAYLIST_END, true, false );
wxLocaleFree( psz_utf8 );
}
-
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
void DialogsProvider::OnOpenFile( wxCommandEvent& event )
main_sizer->Add( main_panel, 1, wxEXPAND );
SetSizer( main_sizer );
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist )
{
/* Some global changes happened -> Rebuild all */
var_AddCallback( p_playlist, "playlist-current",
PlaylistChanged, this );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
}
BookmarksDialog::~BookmarksDialog()
{
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist )
{
var_DelCallback( p_playlist, "playlist-current",
PlaylistChanged, this );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
}
wxDefaultSize, wxDEFAULT_FRAME_STYLE )
{
p_intf = _p_intf;
- playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
- VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
+
b_stats = config_GetInt(p_intf, "stats");
/* Initializations */
SetIcon( *p_intf->p_sys->p_icon );
if( p_playlist )
{
var_AddCallback( p_playlist, "item-change", ItemChanged, this );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
last_update = 0L;
if( mdate() - last_update < 400000L ) return;
last_update = mdate();
- playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
- VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( !p_playlist ) return;
input_thread_t *p_input = p_playlist->p_input ;
-
if( !p_input || p_input->b_dead || !input_GetItem(p_input)->psz_name )
{
item_info->Clear();
advanced_info->Clear();
if( b_stats )
stats_info->Clear();
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
return;
}
+ pl_Release( p_playlist );
vlc_object_yield( p_input );
vlc_mutex_lock( &input_GetItem(p_input)->lock );
vlc_mutex_unlock( &input_GetItem(p_input)->lock );
vlc_object_release(p_input);
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
b_need_update = false;
panel_sizer->Layout();
}
/* Update the playlist */
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
for( int i = 0; i < (int)mrl.GetCount(); i++ )
playlist_AddInput( p_playlist, p_input,
PLAYLIST_APPEND | ( b_start ? PLAYLIST_GO : PLAYLIST_PREPARSE ),
PLAYLIST_END, true, false );
- vlc_gc_decref( p_input );
+ vlc_gc_decref( p_input );
}
-
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
Hide();
i_sort_mode = MODE_NONE;
b_need_update = false;
i_items_to_append = 0;
- p_playlist = (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
SetIcon( *p_intf->p_sys->p_icon );
var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this );
var_DelCallback( p_playlist, "item-append", ItemAppended, this );
var_DelCallback( p_playlist, "item-deleted", ItemDeleted, this );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
/**********************************************************************
openSizer->Fit(open_panel);
mainSizer->Add( open_panel );
- playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
- VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
-
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist )
{
if( !playlist_IsEmpty( p_playlist ) )
{
input_radios[1]->Disable();
}
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
else
{
if( i != -1 )
{
long data = listview->GetItemData( i );
- playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
- VLC_OBJECT_PLAYLIST, FIND_ANYWHERE);
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist )
{
- playlist_item_t * p_item = playlist_ItemGetById( p_playlist, (int)data, false );
+ playlist_item_t * p_item = playlist_ItemGetById( p_playlist, (int)data, false );
if( p_item )
{
const char *psz_uri = input_item_GetURI( p_item->p_input );
}
else
event.Veto();
+ pl_Release( p_playlist );
}
else
event.Veto();
free( psz_sap_option );
}
- playlist_t *p_playlist = (playlist_t *)vlc_object_find( p_intf,
- VLC_OBJECT_PLAYLIST, FIND_ANYWHERE);
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist )
{
input_item_t *p_input = input_ItemNew( p_playlist, mrl,
playlist_AddInput( p_playlist, p_input,
PLAYLIST_GO, PLAYLIST_END, true, false );
vlc_gc_decref( p_input );
- vlc_object_release(p_playlist);
+ pl_Release( p_playlist );
}
else
{
*****************************************************************************/
void InputManager::UpdateInput()
{
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist != NULL )
{
LockPlaylist( p_intf->p_sys, p_playlist );
if( p_intf->p_sys->p_input )
vlc_object_yield( p_intf->p_sys->p_input );
UnlockPlaylist( p_intf->p_sys, p_playlist );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
}
void Interface::PlayStream()
{
wxCommandEvent dummy;
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
if( !playlist_IsEmpty(p_playlist) )
{
/* No stream was playing, start one */
playlist_Play( p_playlist );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
input_manager->Update();
return;
}
var_Set( p_input, "state", state );
vlc_object_release( p_input );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
input_manager->Update();
}
else
{
/* If the playlist is empty, open a file requester instead */
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
OnShowDialog( dummy );
GetToolBar()->ToggleTool( PlayStream_Event, false );
}
}
void Interface::StopStream()
{
- playlist_t * p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t * p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL )
{
return;
}
playlist_Stop( p_playlist );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
input_manager->Update();
}
void Interface::PrevStream()
{
- playlist_t * p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t * p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL )
{
return;
}
playlist_Prev( p_playlist );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
void Interface::OnNextStream( wxCommandEvent& WXUNUSED(event) )
void Interface::NextStream()
{
- playlist_t * p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t * p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL )
{
return;
}
playlist_Next( p_playlist );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
void Interface::OnSlowStream( wxCommandEvent& WXUNUSED(event) )
const wxArrayString& filenames )
{
/* Add dropped files to the playlist */
-
- playlist_t *p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL )
{
return FALSE;
{
vlc_object_release( p_input );
wxDnDLocaleFree( psz_utf8 );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
return TRUE;
}
vlc_object_release( p_input );
wxDnDLocaleFree( psz_utf8 );
}
-
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
return TRUE;
}
unsigned int i_last_separator = 0; \
ArrayOfInts ai_objects; \
ArrayOfStrings as_varnames; \
- playlist_t *p_playlist = (playlist_t *) vlc_object_find( p_intf, \
- VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );\
+ playlist_t *p_playlist = pl_Yield( p_intf ); \
if( !p_playlist ) \
return; \
input_thread_t *p_input = p_playlist->p_input
popupmenu.InsertSeparator( 0 ); \
popupmenu.Insert( 0, Play_Event, wxU(_("Play")) ); \
} \
- if( p_playlist ) vlc_object_release( p_playlist ); \
+ if( p_playlist ) pl_Release( p_playlist ); \
} \
\
popupmenu.Append( MenuDummy_Event, wxU(_("Miscellaneous")), \
}
vlc_object_release( p_input );
}
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
CREATE_POPUP;
}
}
vlc_object_release( p_input );
}
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
CREATE_POPUP;
}
p_intf->p_sys->p_popup_menu = &popupmenu;
p_parent->PopupMenu( &popupmenu, pos.x, pos.y );
p_intf->p_sys->p_popup_menu = NULL;
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
void PopupMenu( intf_thread_t *p_intf, wxWindow *p_parent,
p_intf->p_sys->p_popup_menu = &popupmenu;
p_parent->PopupMenu( &popupmenu, pos.x, pos.y );
p_intf->p_sys->p_popup_menu = NULL;
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
/*****************************************************************************
if( event.GetId() >= Play_Event && event.GetId() <= Stop_Event )
{
input_thread_t *p_input;
- playlist_t * p_playlist =
- (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
+ playlist_t * p_playlist = pl_Yield( p_intf );
if( !p_playlist ) return;
switch( event.GetId() )
playlist_Next( p_playlist );
break;
}
-
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
return;
}
i_cached_item_id = -1;
i_update_counter = 0;
- p_playlist = (playlist_t *)
- vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
+ p_playlist = pl_Yield( p_intf );
if( p_playlist == NULL ) return;
var_Create( p_intf, "random", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this );
var_DelCallback( p_playlist, "item-append", ItemAppended, this );
var_DelCallback( p_playlist, "item-deleted", ItemDeleted, this );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
/*****************************************************************************
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 );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist != NULL )
{
var_AddCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
Start( 100 /*milliseconds*/, wxTIMER_CONTINUOUS );
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 );
+ playlist_t *p_playlist = pl_Yield( p_intf );
if( p_playlist != NULL )
{
var_DelCallback( p_playlist, "intf-popupmenu", PopupMenuCB, p_intf );
- vlc_object_release( p_playlist );
+ pl_Release( p_playlist );
}
}