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
0f70e31b
Commit
0f70e31b
authored
Jan 28, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4 IM. Commenting the work done.
parent
14e79100
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+27
-12
No files found.
modules/gui/qt4/input_manager.cpp
View file @
0f70e31b
...
@@ -50,6 +50,9 @@ static int VolumeChanged( vlc_object_t *, const char *,
...
@@ -50,6 +50,9 @@ static int VolumeChanged( vlc_object_t *, const char *,
/**********************************************************************
/**********************************************************************
* InputManager implementation
* InputManager implementation
**********************************************************************
* The Input Manager can be the main one around the playlist
* But can also be used for VLM dialog or similar
**********************************************************************/
**********************************************************************/
InputManager
::
InputManager
(
QObject
*
parent
,
intf_thread_t
*
_p_intf
)
:
InputManager
::
InputManager
(
QObject
*
parent
,
intf_thread_t
*
_p_intf
)
:
...
@@ -66,6 +69,9 @@ InputManager::~InputManager()
...
@@ -66,6 +69,9 @@ InputManager::~InputManager()
delInput
();
delInput
();
}
}
/* Define the Input used.
Add the callbacks on input
p_input is yield once here */
void
InputManager
::
setInput
(
input_thread_t
*
_p_input
)
void
InputManager
::
setInput
(
input_thread_t
*
_p_input
)
{
{
delInput
();
delInput
();
...
@@ -84,6 +90,9 @@ void InputManager::setInput( input_thread_t *_p_input )
...
@@ -84,6 +90,9 @@ void InputManager::setInput( input_thread_t *_p_input )
}
}
}
}
/* delete Input if it ever existed.
Delete the callbacls on input
p_input is released once here */
void
InputManager
::
delInput
()
void
InputManager
::
delInput
()
{
{
if
(
p_input
)
if
(
p_input
)
...
@@ -102,6 +111,7 @@ void InputManager::delInput()
...
@@ -102,6 +111,7 @@ void InputManager::delInput()
}
}
}
}
/* Add the callbacks on Input. Self explanatory */
void
InputManager
::
addCallbacks
()
void
InputManager
::
addCallbacks
()
{
{
/* We don't care about:
/* We don't care about:
...
@@ -127,6 +137,7 @@ void InputManager::addCallbacks()
...
@@ -127,6 +137,7 @@ void InputManager::addCallbacks()
var_AddCallback
(
p_input
,
"intf-change"
,
InterfaceChanged
,
this
);
var_AddCallback
(
p_input
,
"intf-change"
,
InterfaceChanged
,
this
);
}
}
/* Delete the callbacks on Input. Self explanatory */
void
InputManager
::
delCallbacks
()
void
InputManager
::
delCallbacks
()
{
{
var_DelCallback
(
p_input
,
"audio-es"
,
ChangeAudio
,
this
);
var_DelCallback
(
p_input
,
"audio-es"
,
ChangeAudio
,
this
);
...
@@ -137,16 +148,17 @@ void InputManager::delCallbacks()
...
@@ -137,16 +148,17 @@ void InputManager::delCallbacks()
var_DelCallback
(
p_input
,
"intf-change"
,
InterfaceChanged
,
this
);
var_DelCallback
(
p_input
,
"intf-change"
,
InterfaceChanged
,
this
);
}
}
/* Convert the event from the callbacks in actions */
void
InputManager
::
customEvent
(
QEvent
*
event
)
void
InputManager
::
customEvent
(
QEvent
*
event
)
{
{
int
type
=
event
->
type
();
int
type
=
event
->
type
();
if
(
type
!=
PositionUpdate_Type
&&
type
!=
ItemChanged_Type
&&
if
(
type
!=
PositionUpdate_Type
&&
type
!=
ItemRateChanged_Type
&&
type
!=
ItemTitleChanged_Type
&&
type
!=
ItemChanged_Type
&&
type
!=
ItemRateChanged_Type
&&
type
!=
ItemTitleChanged_Type
&&
type
!=
ItemStateChanged_Type
)
type
!=
ItemStateChanged_Type
)
return
;
return
;
msg_Dbg
(
p_intf
,
"New IM Event, type: %i"
,
type
);
/* Delete the input */
/* 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
)
{
{
...
@@ -154,6 +166,7 @@ void InputManager::customEvent( QEvent *event )
...
@@ -154,6 +166,7 @@ void InputManager::customEvent( QEvent *event )
return
;
return
;
}
}
/* Actions */
switch
(
type
)
switch
(
type
)
{
{
case
PositionUpdate_Type
:
case
PositionUpdate_Type
:
...
@@ -293,6 +306,7 @@ void InputManager::sliderUpdate( float new_pos )
...
@@ -293,6 +306,7 @@ void InputManager::sliderUpdate( float new_pos )
var_SetFloat
(
p_input
,
"position"
,
new_pos
);
var_SetFloat
(
p_input
,
"position"
,
new_pos
);
}
}
/* User togglePlayPause */
void
InputManager
::
togglePlayPause
()
void
InputManager
::
togglePlayPause
()
{
{
vlc_value_t
state
;
vlc_value_t
state
;
...
@@ -397,7 +411,8 @@ void InputManager::setRate( int new_rate )
...
@@ -397,7 +411,8 @@ void InputManager::setRate( int new_rate )
/**********************************************************************
/**********************************************************************
* MainInputManager implementation. Wrap an input manager and
* MainInputManager implementation. Wrap an input manager and
* take care of updating the main playlist input
* take care of updating the main playlist input.
* Used in the main playlist Dialog
**********************************************************************/
**********************************************************************/
MainInputManager
*
MainInputManager
::
instance
=
NULL
;
MainInputManager
*
MainInputManager
::
instance
=
NULL
;
...
@@ -407,16 +422,17 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
...
@@ -407,16 +422,17 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
p_input
=
NULL
;
p_input
=
NULL
;
im
=
new
InputManager
(
this
,
p_intf
);
im
=
new
InputManager
(
this
,
p_intf
);
// No necessary, I think
//var_AddCallback( THEPL, "intf-change", ItemChanged, im );
var_AddCallback
(
THEPL
,
"item-change"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"item-change"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"playlist-current"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"playlist-current"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"playlist-current"
,
ItemChanged
,
im
);
var_AddCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"playlist-current"
,
ItemChanged
,
im
);
var_AddCallback
(
p_intf
->
p_libvlc
,
"volume-change"
,
VolumeChanged
,
this
);
var_AddCallback
(
p_intf
->
p_libvlc
,
"volume-change"
,
VolumeChanged
,
this
);
// No necessary, I think TODO REMOVE ME at the end
//var_AddCallback( THEPL, "intf-change", ItemChanged, im );
/* Warn our embedded IM about input changes */
/* Warn our embedded IM about input changes */
CONNECT
(
this
,
inputChanged
(
input_thread_t
*
),
CONNECT
(
this
,
inputChanged
(
input_thread_t
*
),
im
,
setInput
(
input_thread_t
*
)
);
im
,
setInput
(
input_thread_t
*
)
);
...
@@ -435,7 +451,7 @@ MainInputManager::~MainInputManager()
...
@@ -435,7 +451,7 @@ MainInputManager::~MainInputManager()
var_DelCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"item-change"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"item-change"
,
PLItemChanged
,
this
);
// var_DelCallback( THEPL, "intf-change", ItemChanged, this
);
var_DelCallback
(
THEPL
,
"playlist-current"
,
ItemChanged
,
im
);
}
}
void
MainInputManager
::
customEvent
(
QEvent
*
event
)
void
MainInputManager
::
customEvent
(
QEvent
*
event
)
...
@@ -450,8 +466,7 @@ void MainInputManager::customEvent( QEvent *event )
...
@@ -450,8 +466,7 @@ void MainInputManager::customEvent( QEvent *event )
return
;
return
;
}
}
msg_Dbg
(
p_intf
,
"New MIM Event, type: %i"
,
type
);
/* Should be PLItemChanged Event */
/* Should be PLItemChanged */
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
);
...
...
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