Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
7db11385
Commit
7db11385
authored
Sep 20, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bit of cleanup in the info stuff
parent
4b94daab
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
126 additions
and
81 deletions
+126
-81
modules/gui/qt4/components/infopanels.cpp
modules/gui/qt4/components/infopanels.cpp
+62
-12
modules/gui/qt4/components/infopanels.hpp
modules/gui/qt4/components/infopanels.hpp
+26
-10
modules/gui/qt4/dialogs/streaminfo.cpp
modules/gui/qt4/dialogs/streaminfo.cpp
+31
-33
modules/gui/qt4/dialogs/streaminfo.hpp
modules/gui/qt4/dialogs/streaminfo.hpp
+6
-25
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.cpp
+1
-1
No files found.
modules/gui/qt4/components/infopanels.cpp
View file @
7db11385
...
...
@@ -5,6 +5,7 @@
* $Id$
*
* Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
...
...
@@ -29,6 +30,10 @@
#include <QHeaderView>
#include <QList>
/************************************************************************
* Single panels
************************************************************************/
InputStatsPanel
::
InputStatsPanel
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
)
:
QWidget
(
parent
),
p_intf
(
_p_intf
)
{
...
...
@@ -39,9 +44,8 @@ InputStatsPanel::~InputStatsPanel()
{
}
void
InputStatsPanel
::
U
pdate
(
input_item_t
*
p_item
)
void
InputStatsPanel
::
u
pdate
(
input_item_t
*
p_item
)
{
vlc_mutex_lock
(
&
p_item
->
p_stats
->
lock
);
#define UPDATE( widget,format, calc... ) \
...
...
@@ -75,7 +79,7 @@ void InputStatsPanel::Update( input_item_t *p_item )
vlc_mutex_unlock
(
&
p_item
->
p_stats
->
lock
);
}
void
InputStatsPanel
::
C
lear
()
void
InputStatsPanel
::
c
lear
()
{
}
...
...
@@ -87,29 +91,30 @@ MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
MetaPanel
::~
MetaPanel
()
{
}
void
MetaPanel
::
Update
(
input_item_t
*
p_item
)
void
MetaPanel
::
update
(
input_item_t
*
p_item
)
{
}
void
MetaPanel
::
C
lear
()
void
MetaPanel
::
c
lear
()
{
}
char
*
MetaPanel
::
G
etURI
()
char
*
MetaPanel
::
g
etURI
()
{
char
*
URI
;
return
URI
;
}
char
*
MetaPanel
::
G
etName
()
char
*
MetaPanel
::
g
etName
()
{
char
*
Name
;
return
Name
;
}
InfoPanel
::
InfoPanel
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
)
:
QWidget
(
parent
),
p_intf
(
_p_intf
)
{
resize
(
400
,
500
);
//
resize(400, 500);
QGridLayout
*
layout
=
new
QGridLayout
(
this
);
InfoTree
=
new
QTreeWidget
(
this
);
QList
<
QTreeWidgetItem
*>
items
;
...
...
@@ -117,15 +122,14 @@ InfoPanel::InfoPanel( QWidget *parent, intf_thread_t *_p_intf ) :
layout
->
addWidget
(
InfoTree
,
0
,
0
);
InfoTree
->
setColumnCount
(
1
);
InfoTree
->
header
()
->
hide
();
InfoTree
->
resize
(
400
,
400
);
// InfoTree->resize(400, 400);
}
InfoPanel
::~
InfoPanel
()
{
}
void
InfoPanel
::
U
pdate
(
input_item_t
*
p_item
)
void
InfoPanel
::
u
pdate
(
input_item_t
*
p_item
)
{
InfoTree
->
clear
();
QTreeWidgetItem
*
current_item
=
NULL
;
...
...
@@ -151,7 +155,53 @@ void InfoPanel::Update( input_item_t *p_item)
}
}
void
InfoPanel
::
C
lear
()
void
InfoPanel
::
c
lear
()
{
InfoTree
->
clear
();
}
/***************************************************************************
* Tab widget
***************************************************************************/
InfoTab
::
InfoTab
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
,
bool
_stats
)
:
QTabWidget
(
parent
),
stats
(
_stats
),
p_intf
(
_p_intf
)
{
// setGeometry(0, 0, 400, 500);
MP
=
new
MetaPanel
(
NULL
,
p_intf
);
addTab
(
MP
,
qtr
(
"&Meta"
));
if
(
stats
)
{
ISP
=
new
InputStatsPanel
(
NULL
,
p_intf
);
addTab
(
ISP
,
qtr
(
"&Stats"
));
}
IP
=
new
InfoPanel
(
NULL
,
p_intf
);
addTab
(
IP
,
qtr
(
"&Info"
));
}
InfoTab
::~
InfoTab
()
{
}
/* This function should be called approximately twice a second.
* p_item should be locked
* Stats will always be updated */
void
InfoTab
::
update
(
input_item_t
*
p_item
,
bool
update_info
,
bool
update_meta
)
{
if
(
update_info
)
IP
->
update
(
p_item
);
if
(
update_meta
)
MP
->
update
(
p_item
);
if
(
stats
)
ISP
->
update
(
p_item
);
}
void
InfoTab
::
clear
()
{
IP
->
clear
();
MP
->
clear
();
if
(
stats
)
ISP
->
clear
();
}
modules/gui/qt4/components/infopanels.hpp
View file @
7db11385
...
...
@@ -28,7 +28,7 @@
#include <vlc_meta.h>
#include <QWidget>
#include <QTabWidget>
#include "ui/input_stats.h"
...
...
@@ -44,10 +44,9 @@ public:
private:
intf_thread_t
*
p_intf
;
Ui
::
InputStats
ui
;
public
slots
:
void
U
pdate
(
input_item_t
*
);
void
C
lear
();
void
u
pdate
(
input_item_t
*
);
void
c
lear
();
};
class
MetaPanel
:
public
QWidget
...
...
@@ -60,11 +59,11 @@ private:
intf_thread_t
*
p_intf
;
public
slots
:
void
U
pdate
(
input_item_t
*
);
void
C
lear
();
void
u
pdate
(
input_item_t
*
);
void
c
lear
();
char
*
G
etURI
();
char
*
G
etName
();
char
*
g
etURI
();
char
*
g
etName
();
};
class
InfoPanel
:
public
QWidget
...
...
@@ -78,8 +77,25 @@ private:
QTreeWidget
*
InfoTree
;
public
slots
:
void
Update
(
input_item_t
*
);
void
Clear
();
void
update
(
input_item_t
*
);
void
clear
();
};
class
InfoTab
:
public
QTabWidget
{
Q_OBJECT
;
public:
InfoTab
(
QWidget
*
,
intf_thread_t
*
,
bool
);
virtual
~
InfoTab
();
void
update
(
input_item_t
*
,
bool
,
bool
);
void
clear
();
private:
bool
stats
;
intf_thread_t
*
p_intf
;
InputStatsPanel
*
ISP
;
MetaPanel
*
MP
;
InfoPanel
*
IP
;
int
i_runs
;
};
#endif
modules/gui/qt4/dialogs/streaminfo.cpp
View file @
7db11385
...
...
@@ -30,17 +30,18 @@
#include "components/infopanels.hpp"
#include "qt4.hpp"
/* This is the dialog Windows */
static
int
ItemChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
);
StreamInfoDialog
*
StreamInfoDialog
::
instance
=
NULL
;
StreamInfoDialog
::
StreamInfoDialog
(
intf_thread_t
*
_p_intf
,
bool
_main_input
)
:
QVLCFrame
(
_p_intf
),
main_input
(
_main_input
)
StreamInfoDialog
::
StreamInfoDialog
(
intf_thread_t
*
_p_intf
)
:
QVLCFrame
(
_p_intf
)
{
i_runs
=
0
;
setWindowTitle
(
_
(
"Stream information"
)
);
QGridLayout
*
layout
=
new
QGridLayout
(
this
);
setGeometry
(
0
,
0
,
470
,
550
);
IT
=
new
InfoTab
(
this
,
p_intf
)
;
IT
=
new
InfoTab
(
this
,
p_intf
,
true
)
;
QPushButton
*
closeButton
=
new
QPushButton
(
qtr
(
"&Close"
));
layout
->
addWidget
(
IT
,
0
,
0
,
1
,
3
);
layout
->
addWidget
(
closeButton
,
1
,
2
);
...
...
@@ -48,50 +49,47 @@ StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf, bool _main_input ) :
BUTTONACT
(
closeButton
,
close
()
);
ON_TIMEOUT
(
update
()
);
p_input
=
NULL
;
}
void
StreamInfoDialog
::
update
()
{
IT
->
update
();
var_AddCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
this
);
}
StreamInfoDialog
::~
StreamInfoDialog
()
{
var_DelCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
this
);
}
void
StreamInfoDialog
::
close
()
static
int
ItemChanged
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
this
->
toggleVisible
();
StreamInfoDialog
*
p_d
=
(
StreamInfoDialog
*
)
param
;
p_d
->
need_update
=
VLC_TRUE
;
return
VLC_SUCCESS
;
}
/* This is the tab Widget Inside the windows*/
InfoTab
::
InfoTab
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
)
:
QTabWidget
(
parent
),
p_intf
(
_p_intf
)
void
StreamInfoDialog
::
update
()
{
setGeometry
(
0
,
0
,
400
,
500
);
// 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
();
if
(
!
p_input
||
p_input
->
b_dead
)
{
IT
->
clear
();
return
;
}
ISP
=
new
InputStatsPanel
(
NULL
,
p_intf
);
MP
=
new
MetaPanel
(
NULL
,
p_intf
);
IP
=
new
InfoPanel
(
NULL
,
p_intf
);
vlc_object_yield
(
p_input
);
vlc_mutex_lock
(
&
p_input
->
input
.
p_item
->
lock
);
addTab
(
MP
,
qtr
(
"&Meta"
));
addTab
(
ISP
,
qtr
(
"&Stats"
));
addTab
(
IP
,
qtr
(
"&Info"
));
}
IT
->
update
(
p_input
->
input
.
p_item
,
need_update
,
need_update
);
need_update
=
false
;
InfoTab
::~
InfoTab
()
{
vlc_mutex_unlock
(
&
p_input
->
input
.
p_item
->
lock
);
vlc_object_release
(
p_input
);
}
void
InfoTab
::
updat
e
()
void
StreamInfoDialog
::
clos
e
()
{
if
(
p_intf
)
p_input
=
MainInputManager
::
getInstance
(
p_intf
)
->
getInput
();
if
(
p_input
&&
!
p_input
->
b_dead
)
{
ISP
->
Update
(
p_input
->
input
.
p_item
);
// FIXME should not be updated here
IP
->
Update
(
p_input
->
input
.
p_item
);
}
this
->
toggleVisible
();
}
modules/gui/qt4/dialogs/streaminfo.hpp
View file @
7db11385
...
...
@@ -27,45 +27,26 @@
#include <QTabWidget>
#include <QBoxLayout>
class
InputStatsPanel
;
class
MetaPanel
;
class
InfoPanel
;
class
InfoTab
:
public
QTabWidget
{
Q_OBJECT
;
public:
InfoTab
(
QWidget
*
,
intf_thread_t
*
);
virtual
~
InfoTab
();
private:
intf_thread_t
*
p_intf
;
input_thread_t
*
p_input
;
InputStatsPanel
*
ISP
;
MetaPanel
*
MP
;
InfoPanel
*
IP
;
public
slots
:
void
update
();
};
class
InfoTab
;
class
StreamInfoDialog
:
public
QVLCFrame
{
Q_OBJECT
;
public:
static
StreamInfoDialog
*
getInstance
(
intf_thread_t
*
p_intf
,
bool
a
)
static
StreamInfoDialog
*
getInstance
(
intf_thread_t
*
p_intf
)
{
if
(
!
instance
)
instance
=
new
StreamInfoDialog
(
p_intf
,
a
);
instance
=
new
StreamInfoDialog
(
p_intf
);
return
instance
;
}
virtual
~
StreamInfoDialog
();
bool
need_update
;
private:
StreamInfoDialog
(
intf_thread_t
*
,
bool
);
StreamInfoDialog
(
intf_thread_t
*
);
input_thread_t
*
p_input
;
InfoTab
*
IT
;
bool
main_input
;
static
StreamInfoDialog
*
instance
;
int
i_runs
;
public
slots
:
void
update
();
void
close
();
...
...
modules/gui/qt4/dialogs_provider.cpp
View file @
7db11385
...
...
@@ -154,7 +154,7 @@ void DialogsProvider::quit()
void
DialogsProvider
::
streaminfoDialog
()
{
StreamInfoDialog
::
getInstance
(
p_intf
,
true
)
->
toggleVisible
();
StreamInfoDialog
::
getInstance
(
p_intf
)
->
toggleVisible
();
}
void
DialogsProvider
::
streamingDialog
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment