1 /*****************************************************************************
2 * seekpoints.cpp : Chapters & Bookmarks (menu)
3 *****************************************************************************
4 * Copyright © 2011 the VideoLAN team
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * ( at your option ) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20 *****************************************************************************/
23 #include "recents.hpp"
24 #include "dialogs_provider.hpp"
27 #include "seekpoints.hpp"
30 #include "input_manager.hpp"
32 SeekPoints::SeekPoints( QObject *parent, intf_thread_t *p_intf_ ) :
33 QObject( parent ), p_intf( p_intf_ )
36 void SeekPoints::update()
38 input_title_t *p_title = NULL;
39 input_thread_t *p_input_thread = playlist_CurrentInput( THEPL );
41 if( !p_input_thread ) { pointsList.clear(); return; }
43 if ( input_Control( p_input_thread, INPUT_GET_TITLE_INFO, &p_title, &i_title_id )
46 vlc_object_release( p_input_thread );
51 vlc_object_release( p_input_thread );
53 /* lock here too, as update event is triggered by an external thread */
54 if ( !access() ) return;
56 for ( int i=0; i<p_title->i_seekpoint ; i++ )
57 pointsList << SeekPoint( p_title->seekpoint[i] );
59 vlc_input_title_Delete( p_title );
63 QList<SeekPoint> const SeekPoints::getPoints()
65 QList<SeekPoint> copy;