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
70304d68
Commit
70304d68
authored
Jan 28, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 - Simplification and fix the IM interaction.
parent
a4521f0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
32 deletions
+32
-32
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+32
-32
No files found.
modules/gui/qt4/input_manager.cpp
View file @
70304d68
...
@@ -35,7 +35,7 @@ static int ChangeAudio( vlc_object_t *p_this, const char *var, vlc_value_t o,
...
@@ -35,7 +35,7 @@ static int ChangeAudio( vlc_object_t *p_this, const char *var, vlc_value_t o,
vlc_value_t
n
,
void
*
param
);
vlc_value_t
n
,
void
*
param
);
static
int
ItemChanged
(
vlc_object_t
*
,
const
char
*
,
static
int
ItemChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
Input
Changed
(
vlc_object_t
*
,
const
char
*
,
static
int
PLItem
Changed
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
InterfaceChanged
(
vlc_object_t
*
,
const
char
*
,
static
int
InterfaceChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
vlc_value_t
,
vlc_value_t
,
void
*
);
...
@@ -90,18 +90,19 @@ void InputManager::delInput()
...
@@ -90,18 +90,19 @@ void InputManager::delInput()
{
{
delCallbacks
();
delCallbacks
();
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
i_old_playing_status
=
END_S
;
old_name
=
qfu
(
""
);
artUrl
=
qfu
(
""
);
emit
positionUpdated
(
0.0
,
0
,
0
);
emit
statusChanged
(
END_S
);
emit
nameChanged
(
""
);
emit
artChanged
(
""
);
p_input
=
NULL
;
p_input
=
NULL
;
}
}
i_old_playing_status
=
END_S
;
old_name
=
qfu
(
""
);
artUrl
=
qfu
(
""
);
emit
positionUpdated
(
0.0
,
0
,
0
);
emit
statusChanged
(
END_S
);
emit
nameChanged
(
""
);
emit
artChanged
(
""
);
}
}
void
InputManager
::
addCallbacks
(
void
)
void
InputManager
::
addCallbacks
()
{
{
/* We don't care about:
/* We don't care about:
- spu-es
- spu-es
...
@@ -126,7 +127,7 @@ void InputManager::addCallbacks( void )
...
@@ -126,7 +127,7 @@ void InputManager::addCallbacks( void )
var_AddCallback
(
p_input
,
"intf-change"
,
InterfaceChanged
,
this
);
var_AddCallback
(
p_input
,
"intf-change"
,
InterfaceChanged
,
this
);
}
}
void
InputManager
::
delCallbacks
(
void
)
void
InputManager
::
delCallbacks
()
{
{
var_DelCallback
(
p_input
,
"audio-es"
,
ChangeAudio
,
this
);
var_DelCallback
(
p_input
,
"audio-es"
,
ChangeAudio
,
this
);
var_DelCallback
(
p_input
,
"video-es"
,
ChangeVideo
,
this
);
var_DelCallback
(
p_input
,
"video-es"
,
ChangeVideo
,
this
);
...
@@ -144,14 +145,13 @@ void InputManager::customEvent( QEvent *event )
...
@@ -144,14 +145,13 @@ void InputManager::customEvent( QEvent *event )
type
!=
ItemStateChanged_Type
)
type
!=
ItemStateChanged_Type
)
return
;
return
;
/* Delete the input */
if
(
!
p_input
||
p_input
->
b_dead
||
p_input
->
b_die
)
if
(
!
p_input
||
p_input
->
b_dead
||
p_input
->
b_die
)
{
{
delInput
();
delInput
();
return
;
return
;
}
}
IMEvent
*
ime
=
static_cast
<
IMEvent
*>
(
event
);
switch
(
type
)
switch
(
type
)
{
{
case
PositionUpdate_Type
:
case
PositionUpdate_Type
:
...
@@ -254,7 +254,8 @@ void InputManager::UpdateMeta( void )
...
@@ -254,7 +254,8 @@ void InputManager::UpdateMeta( void )
else
else
{
{
text
.
sprintf
(
"%s"
,
psz_name
);
text
.
sprintf
(
"%s"
,
psz_name
);
}
free
(
psz_artist
);
}
free
(
psz_artist
);
}
}
free
(
psz_name
);
free
(
psz_name
);
free
(
psz_nowplaying
);
free
(
psz_nowplaying
);
...
@@ -265,7 +266,7 @@ void InputManager::UpdateMeta( void )
...
@@ -265,7 +266,7 @@ void InputManager::UpdateMeta( void )
old_name
=
text
;
old_name
=
text
;
}
}
/* Update meta */
/* Update
Art
meta */
QString
url
;
QString
url
;
char
*
psz_art
=
input_item_GetArtURL
(
input_GetItem
(
p_input
)
);
char
*
psz_art
=
input_item_GetArtURL
(
input_GetItem
(
p_input
)
);
url
.
sprintf
(
"%s"
,
psz_art
);
url
.
sprintf
(
"%s"
,
psz_art
);
...
@@ -404,12 +405,12 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf ) : QObject(NULL),
...
@@ -404,12 +405,12 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf ) : QObject(NULL),
p_input
=
NULL
;
p_input
=
NULL
;
im
=
new
InputManager
(
this
,
p_intf
);
im
=
new
InputManager
(
this
,
p_intf
);
var_AddCallback
(
THEPL
,
"playlist-current
"
,
ItemChanged
,
im
);
//var_AddCallback( THEPL, "intf-change
", ItemChanged, im );
var_AddCallback
(
THEPL
,
"playlist-current"
,
InputChanged
,
this
);
//var_AddCallback( THEPL, "playlist-current", ItemChanged, im
);
var_AddCallback
(
THEPL
,
"intf-change"
,
ItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"
activity"
,
Input
Changed
,
this
);
var_AddCallback
(
THEPL
,
"
item-change"
,
PLItem
Changed
,
this
);
/* src/input/input.c:2076*/
var_AddCallback
(
THEPL
,
"playlist-current"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"
item-change"
,
ItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"
activity"
,
PL
ItemChanged
,
this
);
var_AddCallback
(
p_intf
->
p_libvlc
,
"volume-change"
,
VolumeChanged
,
this
);
var_AddCallback
(
p_intf
->
p_libvlc
,
"volume-change"
,
VolumeChanged
,
this
);
...
@@ -425,12 +426,14 @@ MainInputManager::~MainInputManager()
...
@@ -425,12 +426,14 @@ MainInputManager::~MainInputManager()
vlc_object_release
(
p_input
);
vlc_object_release
(
p_input
);
emit
inputChanged
(
NULL
);
emit
inputChanged
(
NULL
);
}
}
var_DelCallback
(
p_intf
->
p_libvlc
,
"volume-change"
,
VolumeChanged
,
this
);
var_DelCallback
(
p_intf
->
p_libvlc
,
"volume-change"
,
VolumeChanged
,
this
);
var_DelCallback
(
THEPL
,
"playlist-current"
,
InputChanged
,
this
);
var_DelCallback
(
THEPL
,
"activity"
,
InputChanged
,
this
);
var_DelCallback
(
THEPL
,
"playlist-current"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"playlist-current"
,
ItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"intf-change"
,
ItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"item-change"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
this
);
// var_DelCallback( THEPL, "intf-change", ItemChanged, this );
}
}
void
MainInputManager
::
customEvent
(
QEvent
*
event
)
void
MainInputManager
::
customEvent
(
QEvent
*
event
)
...
@@ -446,15 +449,13 @@ void MainInputManager::customEvent( QEvent *event )
...
@@ -446,15 +449,13 @@ void MainInputManager::customEvent( QEvent *event )
return
;
return
;
}
}
/* Should be ItemChanged */
/* Should be
PL
ItemChanged */
if
(
VLC_OBJECT_INTF
==
p_intf
->
i_object_type
)
if
(
VLC_OBJECT_INTF
==
p_intf
->
i_object_type
)
{
{
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
vlc_mutex_lock
(
&
p_intf
->
change_lock
);
if
(
p_input
&&
(
p_input
->
b_dead
||
p_input
->
b_die
)
)
if
(
p_input
&&
(
p_input
->
b_dead
||
p_input
->
b_die
)
)
{
{
var_DelCallback
(
p_input
,
"state"
,
InputChanged
,
this
);
im
->
delInput
();
vlc_object_release
(
p_input
);
p_input
=
NULL
;
emit
inputChanged
(
NULL
);
emit
inputChanged
(
NULL
);
}
}
...
@@ -464,8 +465,7 @@ void MainInputManager::customEvent( QEvent *event )
...
@@ -464,8 +465,7 @@ void MainInputManager::customEvent( QEvent *event )
p_input
=
THEPL
->
p_input
;
p_input
=
THEPL
->
p_input
;
if
(
p_input
&&
!
(
p_input
->
b_die
||
p_input
->
b_dead
)
)
if
(
p_input
&&
!
(
p_input
->
b_die
||
p_input
->
b_dead
)
)
{
{
vlc_object_yield
(
p_input
);
im
->
setInput
(
p_input
);
var_AddCallback
(
p_input
,
"state"
,
InputChanged
,
this
);
emit
inputChanged
(
p_input
);
emit
inputChanged
(
p_input
);
}
}
else
else
...
@@ -588,7 +588,7 @@ static int ChangeVideo( vlc_object_t *p_this, const char *var, vlc_value_t o,
...
@@ -588,7 +588,7 @@ static int ChangeVideo( vlc_object_t *p_this, const char *var, vlc_value_t o,
}
}
/* MIM */
/* MIM */
static
int
Input
Changed
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
static
int
PLItem
Changed
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
{
MainInputManager
*
im
=
(
MainInputManager
*
)
param
;
MainInputManager
*
im
=
(
MainInputManager
*
)
param
;
...
...
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