Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
197dcf82
Commit
197dcf82
authored
Aug 31, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preliminary work for better audio visualization handling
parent
c9f5dbcf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
6 deletions
+89
-6
modules/gui/qt4/components/video_widget.cpp
modules/gui/qt4/components/video_widget.cpp
+38
-1
modules/gui/qt4/components/video_widget.hpp
modules/gui/qt4/components/video_widget.hpp
+2
-0
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+45
-5
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+4
-0
No files found.
modules/gui/qt4/components/video_widget.cpp
View file @
197dcf82
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "qt4.hpp"
#include "qt4.hpp"
#include "components/video_widget.hpp"
#include "components/video_widget.hpp"
#include "main_interface.hpp"
#include "main_interface.hpp"
#include "input_manager.hpp"
#include <QHBoxLayout>
#include <QHBoxLayout>
#define ICON_SIZE 128
#define ICON_SIZE 128
...
@@ -57,6 +58,10 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i, bool _always ) : QFrame( NULL ),
...
@@ -57,6 +58,10 @@ VideoWidget::VideoWidget( intf_thread_t *_p_i, bool _always ) : QFrame( NULL ),
if
(
always
)
if
(
always
)
{
{
DrawBackground
();
DrawBackground
();
connect
(
THEMIM
->
getIM
(),
SIGNAL
(
audioStarted
()
),
this
,
SLOT
(
hasAudio
()
)
);
connect
(
THEMIM
->
getIM
(),
SIGNAL
(
audioStarted
()
),
this
,
SLOT
(
hasVideo
()
)
);
}
}
need_update
=
false
;
need_update
=
false
;
}
}
...
@@ -117,7 +122,20 @@ void *VideoWidget::Request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
...
@@ -117,7 +122,20 @@ void *VideoWidget::Request( vout_thread_t *p_nvout, int *pi_x, int *pi_y,
}
}
p_vout
=
p_nvout
;
p_vout
=
p_nvout
;
setMinimumSize
(
1
,
1
);
// if( THEMIM->getIM()->b_has_video )
// {
// We are really running a video
// Close the existing vout
// Set visual to disabled
// }
// else
// {
// We are getting a request for visual
// Just go on.
// }
// Check THEMIM->b_has_audio. If true, hide audio.
setMinimumSize
(
1
,
1
);
p_intf
->
p_sys
->
p_mi
->
videoSize
=
QSize
(
*
pi_width
,
*
pi_height
);
p_intf
->
p_sys
->
p_mi
->
videoSize
=
QSize
(
*
pi_width
,
*
pi_height
);
updateGeometry
();
updateGeometry
();
need_update
=
true
;
need_update
=
true
;
...
@@ -149,6 +167,25 @@ void VideoWidget::Release( void *p_win )
...
@@ -149,6 +167,25 @@ void VideoWidget::Release( void *p_win )
}
}
}
}
void
VideoWidget
::
hasAudio
()
{
/* We have video already, do nothing */
if
(
THEMIM
->
getIM
()
->
b_has_video
)
{
}
else
{
/* Show the panel to the user */
fprintf
(
stderr
,
"Showing panel
\n
"
);
}
}
void
VideoWidget
::
hasVideo
()
{
// if panel is shown, hide it
}
static
int
DoControl
(
intf_thread_t
*
p_intf
,
void
*
p_win
,
int
i_q
,
va_list
a
)
static
int
DoControl
(
intf_thread_t
*
p_intf
,
void
*
p_win
,
int
i_q
,
va_list
a
)
{
{
return
p_intf
->
p_sys
->
p_video
->
Control
(
p_win
,
i_q
,
a
);
return
p_intf
->
p_sys
->
p_video
->
Control
(
p_win
,
i_q
,
a
);
...
...
modules/gui/qt4/components/video_widget.hpp
View file @
197dcf82
...
@@ -64,6 +64,8 @@ private:
...
@@ -64,6 +64,8 @@ private:
vlc_mutex_t
lock
;
vlc_mutex_t
lock
;
private
slots
:
private
slots
:
void
update
();
void
update
();
void
hasAudio
();
void
hasVideo
();
};
};
#endif
#endif
modules/gui/qt4/input_manager.cpp
View file @
197dcf82
...
@@ -27,6 +27,11 @@
...
@@ -27,6 +27,11 @@
#include "dialogs_provider.hpp"
#include "dialogs_provider.hpp"
#include "qt4.hpp"
#include "qt4.hpp"
static
int
ChangeVideo
(
vlc_object_t
*
p_this
,
const
char
*
var
,
vlc_value_t
o
,
vlc_value_t
n
,
void
*
param
);
static
int
ChangeAudio
(
vlc_object_t
*
p_this
,
const
char
*
var
,
vlc_value_t
o
,
vlc_value_t
n
,
void
*
param
);
/**********************************************************************
/**********************************************************************
* InputManager implementation
* InputManager implementation
**********************************************************************/
**********************************************************************/
...
@@ -48,6 +53,21 @@ void InputManager::setInput( input_thread_t *_p_input )
...
@@ -48,6 +53,21 @@ void InputManager::setInput( input_thread_t *_p_input )
{
{
p_input
=
_p_input
;
p_input
=
_p_input
;
emit
positionUpdated
(
0.0
,
0
,
0
);
emit
positionUpdated
(
0.0
,
0
,
0
);
b_had_audio
=
b_had_video
=
b_has_audio
=
b_has_video
=
false
;
if
(
p_input
)
{
var_AddCallback
(
p_input
,
"audio-es"
,
ChangeAudio
,
this
);
var_AddCallback
(
p_input
,
"video-es"
,
ChangeVideo
,
this
);
}
}
void
InputManager
::
delInput
()
{
if
(
p_input
)
{
var_DelCallback
(
p_input
,
"audio-es"
,
ChangeAudio
,
this
);
var_DelCallback
(
p_input
,
"video-es"
,
ChangeVideo
,
this
);
}
}
}
void
InputManager
::
update
()
void
InputManager
::
update
()
...
@@ -62,6 +82,11 @@ void InputManager::update()
...
@@ -62,6 +82,11 @@ void InputManager::update()
emit
statusChanged
(
0
);
// 0 = STOPPED, 1 = PLAY, 2 = PAUSE
emit
statusChanged
(
0
);
// 0 = STOPPED, 1 = PLAY, 2 = PAUSE
}
}
if
(
!
b_had_audio
&&
b_has_audio
)
emit
audioStarted
();
if
(
!
b_had_video
&&
b_has_video
)
emit
videoStarted
();
/* Update position */
/* Update position */
mtime_t
i_length
,
i_time
;
mtime_t
i_length
,
i_time
;
float
f_pos
;
float
f_pos
;
...
@@ -77,10 +102,10 @@ void InputManager::update()
...
@@ -77,10 +102,10 @@ void InputManager::update()
{
{
vlc_value_t
val
;
vlc_value_t
val
;
var_Change
(
p_input
,
"chapter"
,
VLC_VAR_CHOICESCOUNT
,
&
val
,
NULL
);
var_Change
(
p_input
,
"chapter"
,
VLC_VAR_CHOICESCOUNT
,
&
val
,
NULL
);
if
(
val
.
i_int
>
0
)
if
(
val
.
i_int
>
0
)
emit
navigationChanged
(
1
);
// 1 = chapter, 2 = title, 3
= NO
emit
navigationChanged
(
1
);
// 1 = chapter, 2 = title, 0
= NO
else
else
emit
navigationChanged
(
2
);
emit
navigationChanged
(
2
);
}
}
else
else
{
{
...
@@ -115,7 +140,7 @@ void InputManager::update()
...
@@ -115,7 +140,7 @@ void InputManager::update()
void
InputManager
::
sliderUpdate
(
float
new_pos
)
void
InputManager
::
sliderUpdate
(
float
new_pos
)
{
{
if
(
p_input
&&
!
p_input
->
b_die
&&
!
p_input
->
b_dead
)
if
(
p_input
&&
!
p_input
->
b_die
&&
!
p_input
->
b_dead
)
var_SetFloat
(
p_input
,
"position"
,
new_pos
);
var_SetFloat
(
p_input
,
"position"
,
new_pos
);
}
}
...
@@ -167,6 +192,7 @@ void MainInputManager::updateInput()
...
@@ -167,6 +192,7 @@ void MainInputManager::updateInput()
if
(
p_input
&&
p_input
->
b_dead
)
if
(
p_input
&&
p_input
->
b_dead
)
{
{
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
getIM
()
->
delInput
();
p_input
=
NULL
;
p_input
=
NULL
;
emit
inputChanged
(
NULL
);
emit
inputChanged
(
NULL
);
}
}
...
@@ -198,3 +224,17 @@ void MainInputManager::togglePlayPause()
...
@@ -198,3 +224,17 @@ void MainInputManager::togglePlayPause()
}
}
getIM
()
->
togglePlayPause
();
getIM
()
->
togglePlayPause
();
}
}
static
int
ChangeAudio
(
vlc_object_t
*
p_this
,
const
char
*
var
,
vlc_value_t
o
,
vlc_value_t
n
,
void
*
param
)
{
InputManager
*
im
=
(
InputManager
*
)
param
;
im
->
b_has_audio
=
true
;
}
static
int
ChangeVideo
(
vlc_object_t
*
p_this
,
const
char
*
var
,
vlc_value_t
o
,
vlc_value_t
n
,
void
*
param
)
{
InputManager
*
im
=
(
InputManager
*
)
param
;
im
->
b_has_video
=
true
;
}
modules/gui/qt4/input_manager.hpp
View file @
197dcf82
...
@@ -34,6 +34,8 @@ public:
...
@@ -34,6 +34,8 @@ public:
InputManager
(
QObject
*
,
intf_thread_t
*
);
InputManager
(
QObject
*
,
intf_thread_t
*
);
virtual
~
InputManager
();
virtual
~
InputManager
();
void
delInput
();
bool
b_has_audio
,
b_has_video
,
b_had_audio
,
b_had_video
;
private:
private:
intf_thread_t
*
p_intf
;
intf_thread_t
*
p_intf
;
input_thread_t
*
p_input
;
input_thread_t
*
p_input
;
...
@@ -50,6 +52,8 @@ signals:
...
@@ -50,6 +52,8 @@ signals:
void
nameChanged
(
QString
);
void
nameChanged
(
QString
);
void
navigationChanged
(
int
);
void
navigationChanged
(
int
);
void
statusChanged
(
int
);
void
statusChanged
(
int
);
void
audioStarted
();
void
videoStarted
();
};
};
class
MainInputManager
:
public
QObject
class
MainInputManager
:
public
QObject
...
...
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