Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
05d26437
Commit
05d26437
authored
Jun 02, 2007
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - MediaInfo, move the tabWidget to the Dialog class and remove it from components.
parent
bad8f53f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
77 deletions
+61
-77
modules/gui/qt4/components/infopanels.cpp
modules/gui/qt4/components/infopanels.cpp
+0
-46
modules/gui/qt4/components/infopanels.hpp
modules/gui/qt4/components/infopanels.hpp
+0
-19
modules/gui/qt4/dialogs/mediainfo.cpp
modules/gui/qt4/dialogs/mediainfo.cpp
+49
-9
modules/gui/qt4/dialogs/mediainfo.hpp
modules/gui/qt4/dialogs/mediainfo.hpp
+12
-3
No files found.
modules/gui/qt4/components/infopanels.cpp
View file @
05d26437
...
...
@@ -366,49 +366,3 @@ void InfoPanel::clear()
InfoTree
->
clear
();
}
/***************************************************************************
* Tab widget
***************************************************************************/
InfoTab
::
InfoTab
(
QWidget
*
parent
,
intf_thread_t
*
_p_intf
,
bool
_stats
)
:
QTabWidget
(
parent
),
stats
(
_stats
),
p_intf
(
_p_intf
)
{
MP
=
new
MetaPanel
(
NULL
,
p_intf
);
addTab
(
MP
,
qtr
(
"&General"
)
);
EMP
=
new
ExtraMetaPanel
(
NULL
,
p_intf
);
addTab
(
EMP
,
qtr
(
"&Extra Metadata"
)
);
IP
=
new
InfoPanel
(
NULL
,
p_intf
);
addTab
(
IP
,
qtr
(
"&Codec Details"
));
if
(
stats
)
{
ISP
=
new
InputStatsPanel
(
NULL
,
p_intf
);
addTab
(
ISP
,
qtr
(
"&Stats"
));
}
}
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
);
EMP
->
update
(
p_item
);
if
(
stats
)
ISP
->
update
(
p_item
);
}
void
InfoTab
::
clear
()
{
IP
->
clear
();
MP
->
clear
();
EMP
->
clear
();
if
(
stats
)
ISP
->
clear
();
}
modules/gui/qt4/components/infopanels.hpp
View file @
05d26437
...
...
@@ -138,23 +138,4 @@ public slots:
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
;
ExtraMetaPanel
*
EMP
;
int
i_runs
;
};
#endif
modules/gui/qt4/dialogs/mediainfo.cpp
View file @
05d26437
...
...
@@ -37,8 +37,10 @@ static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
);
MediaInfoDialog
*
MediaInfoDialog
::
instance
=
NULL
;
MediaInfoDialog
::
MediaInfoDialog
(
intf_thread_t
*
_p_intf
,
bool
_mainInput
)
:
QVLCFrame
(
_p_intf
),
mainInput
(
_mainInput
)
MediaInfoDialog
::
MediaInfoDialog
(
intf_thread_t
*
_p_intf
,
bool
_mainInput
,
bool
_stats
)
:
QVLCFrame
(
_p_intf
),
mainInput
(
_mainInput
),
stats
(
_stats
)
{
i_runs
=
0
;
p_input
=
NULL
;
...
...
@@ -47,17 +49,30 @@ MediaInfoDialog::MediaInfoDialog( intf_thread_t *_p_intf, bool _mainInput ) :
resize
(
600
,
450
);
QGridLayout
*
layout
=
new
QGridLayout
(
this
);
IT
=
new
InfoTab
(
this
,
p_intf
,
true
)
;
IT
=
new
QTabWidget
;
MP
=
new
MetaPanel
(
IT
,
p_intf
);
IT
->
addTab
(
MP
,
qtr
(
"&General"
)
);
EMP
=
new
ExtraMetaPanel
(
IT
,
p_intf
);
IT
->
addTab
(
EMP
,
qtr
(
"&Extra Metadata"
)
);
IP
=
new
InfoPanel
(
IT
,
p_intf
);
IT
->
addTab
(
IP
,
qtr
(
"&Codec Details"
));
if
(
stats
)
{
ISP
=
new
InputStatsPanel
(
IT
,
p_intf
);
IT
->
addTab
(
ISP
,
qtr
(
"&Stats"
));
}
QPushButton
*
closeButton
=
new
QPushButton
(
qtr
(
"&Close"
));
closeButton
->
setDefault
(
true
);
layout
->
addWidget
(
IT
,
0
,
0
,
1
,
3
);
layout
->
addWidget
(
IT
,
0
,
0
,
1
,
3
);
layout
->
addWidget
(
closeButton
,
1
,
2
);
BUTTONACT
(
closeButton
,
close
()
);
ON_TIMEOUT
(
update
()
);
if
(
mainInput
)
{
ON_TIMEOUT
(
update
()
);
var_AddCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
this
);
}
}
...
...
@@ -86,36 +101,61 @@ static int ItemChanged( vlc_object_t *p_this, const char *psz_var,
void
MediaInfoDialog
::
setInput
(
input_item_t
*
p_input
)
{
IT
->
clear
();
clear
();
vlc_mutex_lock
(
&
p_input
->
lock
);
IT
->
update
(
p_input
,
true
,
true
);
update
(
p_input
,
true
,
true
);
vlc_mutex_unlock
(
&
p_input
->
lock
);
}
void
MediaInfoDialog
::
update
()
{
msg_Dbg
(
p_intf
,
"updating"
);
/* Timer runs at 150 ms, dont' update more than 2 times per second */
if
(
i_runs
%
3
!=
0
)
return
;
i_runs
++
;
/* Get Input and clear if non-existant */
input_thread_t
*
p_input
=
MainInputManager
::
getInstance
(
p_intf
)
->
getInput
();
if
(
!
p_input
||
p_input
->
b_dead
)
{
IT
->
clear
();
clear
();
return
;
}
vlc_object_yield
(
p_input
);
vlc_mutex_lock
(
&
input_GetItem
(
p_input
)
->
lock
);
IT
->
update
(
input_GetItem
(
p_input
),
need_update
,
need_update
);
update
(
input_GetItem
(
p_input
),
need_update
,
need_update
);
need_update
=
false
;
vlc_mutex_unlock
(
&
input_GetItem
(
p_input
)
->
lock
);
vlc_object_release
(
p_input
);
}
void
MediaInfoDialog
::
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
);
EMP
->
update
(
p_item
);
}
if
(
stats
)
ISP
->
update
(
p_item
);
}
void
MediaInfoDialog
::
clear
()
{
IP
->
clear
();
MP
->
clear
();
EMP
->
clear
();
if
(
stats
)
ISP
->
clear
();
}
void
MediaInfoDialog
::
close
()
{
this
->
toggleVisible
();
...
...
modules/gui/qt4/dialogs/mediainfo.hpp
View file @
05d26437
...
...
@@ -26,6 +26,7 @@
#define _MEDIAINFO_DIALOG_H_
#include "util/qvlcframe.hpp"
#include "components/infopanels.hpp"
class
QTabWidget
;
class
InfoTab
;
...
...
@@ -34,11 +35,12 @@ class MediaInfoDialog : public QVLCFrame
{
Q_OBJECT
;
public:
MediaInfoDialog
(
intf_thread_t
*
,
bool
mainInput
=
false
);
MediaInfoDialog
(
intf_thread_t
*
,
bool
stats
=
true
,
bool
mainInput
=
false
);
static
MediaInfoDialog
*
getInstance
(
intf_thread_t
*
p_intf
)
{
if
(
!
instance
)
instance
=
new
MediaInfoDialog
(
p_intf
,
true
);
instance
=
new
MediaInfoDialog
(
p_intf
,
true
,
true
);
return
instance
;
}
static
void
killInstance
()
...
...
@@ -53,13 +55,20 @@ public:
void
setInput
(
input_item_t
*
);
private:
input_thread_t
*
p_input
;
InfoTab
*
IT
;
QTabWidget
*
IT
;
static
MediaInfoDialog
*
instance
;
int
i_runs
;
bool
mainInput
;
bool
stats
;
InputStatsPanel
*
ISP
;
MetaPanel
*
MP
;
InfoPanel
*
IP
;
ExtraMetaPanel
*
EMP
;
public
slots
:
void
update
();
void
update
(
input_item_t
*
,
bool
,
bool
);
void
close
();
void
clear
();
};
#endif
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