PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf,
playlist_t *p_playlist ) : QWidget( p ), p_intf(_p_intf)
{
- model = new PLModel( THEPL, THEPL->p_root_category, 1, this );
+ model = new PLModel( THEPL, p_intf, THEPL->p_root_category, 1, this );
view = new QTreeView( 0 );
view->setIconSize( QSize( 24,24 ) );
view->setAlternatingRowColors( true );
playlist_item_t *p_root ):
PLPanel( _parent, _p_intf )
{
- model = new PLModel( p_playlist, p_root, -1, this );
+ model = new PLModel( p_playlist, p_intf, p_root, -1, this );
view = new QVLCTreeView( 0 );
view->setModel(model);
view->setIconSize( QSize(20,20) );
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ ******************************************************************************/
#include <QTabWidget>
#include <QGridLayout>
vlc_value_t oldval, vlc_value_t newval, void *param );
MediaInfoDialog *MediaInfoDialog::instance = NULL;
-MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf ) :QVLCFrame( _p_intf )
+MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput ) :
+ QVLCFrame( _p_intf ), mainInput(_mainInput)
{
i_runs = 0;
p_input = NULL;
layout->addWidget(closeButton,1,2);
BUTTONACT( closeButton, close() );
- ON_TIMEOUT( update() );
- var_AddCallback( THEPL, "item-change", ItemChanged, this );
+ if( mainInput ) {
+ ON_TIMEOUT( update() );
+ var_AddCallback( THEPL, "item-change", ItemChanged, this );
+ }
readSettings( "mediainfo" , QSize( 500, 450 ) );
}
MediaInfoDialog::~MediaInfoDialog()
{
- var_DelCallback( THEPL, "item-change", ItemChanged, this );
+ if( mainInput ) {
+ var_DelCallback( THEPL, "item-change", ItemChanged, this );
+ }
writeSettings( "mediainfo" );
}
return VLC_SUCCESS;
}
+void MediaInfoDialog::setInput(input_item_t *p_input)
+{
+ IT->clear();
+ vlc_mutex_lock( &p_input->lock );
+ IT->update( p_input, true, true );
+ vlc_mutex_unlock( &p_input->lock );
+}
+
void MediaInfoDialog::update()
{
// Timer runs at 150 ms, dont' update more than 2 times per second
i_runs++;
if( i_runs % 3 != 0 ) return;
- input_thread_t *p_input = MainInputManager::getInstance( p_intf )->getInput();
+ input_thread_t *p_input =
+ MainInputManager::getInstance( p_intf )->getInput();
if( !p_input || p_input->b_dead )
{
IT->clear();
void MediaInfoDialog::close()
{
this->toggleVisible();
+
+ if( mainInput == false ) {
+ deleteLater();
+ }
}
{
Q_OBJECT;
public:
+ MediaInfoDialog( intf_thread_t *, bool mainInput = false );
static MediaInfoDialog * getInstance( intf_thread_t *p_intf )
{
if( !instance)
- instance = new MediaInfoDialog( p_intf);
+ instance = new MediaInfoDialog( p_intf, true);
return instance;
}
static void killInstance()
}
virtual ~MediaInfoDialog();
bool need_update;
+ void setInput( input_item_t * );
private:
- MediaInfoDialog( intf_thread_t * );
input_thread_t *p_input;
InfoTab *IT;
static MediaInfoDialog *instance;
int i_runs;
+ bool mainInput;
public slots:
void update();
void close();
#include "qt4.hpp"
#include "playlist_model.hpp"
+#include "dialogs/mediainfo.hpp"
#include <vlc_intf_strings.h>
#include "pixmaps/type_unknown.xpm"
* Playlist model implementation
*************************************************************************/
-PLModel::PLModel( playlist_t *_p_playlist,
+PLModel::PLModel( playlist_t *_p_playlist, intf_thread_t *_p_intf,
playlist_item_t * p_root, int _i_depth, QObject *parent)
: QAbstractItemModel(parent)
{
i_depth = _i_depth;
assert( i_depth == 1 || i_depth == -1 );
+ p_intf = _p_intf;
p_playlist= _p_playlist;
i_items_to_append = 0;
b_need_update = false;
void PLModel::popupInfo()
{
- fprintf( stderr, "Popup Info is NOT implemented\n" );
+ playlist_item_t *p_item = playlist_ItemGetById( p_playlist,
+ i_popup_item,VLC_TRUE );
+ if( p_item )
+ {
+ MediaInfoDialog *mid = new MediaInfoDialog( p_intf );
+ mid->setInput( p_item->p_input );
+ mid->show();
+ }
}
void PLModel::popupStream()
Q_OBJECT
public:
- PLModel( playlist_t *, playlist_item_t *, int, QObject *parent = 0);
+ PLModel( playlist_t *, intf_thread_t *,
+ playlist_item_t *, int, QObject *parent = 0);
~PLModel();
/* All types of lookups / QModel stuff */
PLItem *rootItem;
playlist_t *p_playlist;
+ intf_thread_t *p_intf;
int i_depth;
static QIcon icons[ITEM_TYPE_NUMBER];
else
{
p_access->psz_path = strdup( psz_path );
- p_access->psz_access =
- b_quick ? strdup( "file" ) : strdup( psz_access );
+ if( b_quick )
+ {
+ if( strstr( psz_path, "file://" ) )
+ p_access->psz_access = strdup( "" );
+ else
+ p_access->psz_access = strdup( "file" );
+ }
+ else
+ p_access->psz_access = strdup( psz_access );
+
p_access->psz_demux = strdup( psz_demux );
if( !b_quick )