Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
24a911ff
Commit
24a911ff
authored
Nov 07, 2009
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: implement PlaylistEventManager functionality in MainInputManager
parent
57f6ddba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
3 deletions
+58
-3
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.cpp
+41
-3
modules/gui/qt4/input_manager.hpp
modules/gui/qt4/input_manager.hpp
+17
-0
No files found.
modules/gui/qt4/input_manager.cpp
View file @
24a911ff
...
...
@@ -39,6 +39,10 @@ static int ItemChanged( vlc_object_t *, const char *,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
PLItemChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
PLItemAppended
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
PLItemRemoved
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
VolumeChanged
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
...
...
@@ -881,6 +885,8 @@ MainInputManager::MainInputManager( intf_thread_t *_p_intf )
var_AddCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
im
);
var_AddCallback
(
THEPL
,
"item-current"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"activity"
,
PLItemChanged
,
this
);
var_AddCallback
(
THEPL
,
"playlist-item-append"
,
PLItemAppended
,
this
);
var_AddCallback
(
THEPL
,
"playlist-item-deleted"
,
PLItemRemoved
,
this
);
var_AddCallback
(
p_intf
->
p_libvlc
,
"volume-change"
,
VolumeChanged
,
this
);
...
...
@@ -918,6 +924,8 @@ MainInputManager::~MainInputManager()
var_DelCallback
(
THEPL
,
"item-change"
,
ItemChanged
,
im
);
var_DelCallback
(
THEPL
,
"item-current"
,
PLItemChanged
,
this
);
var_DelCallback
(
THEPL
,
"playlist-item-append"
,
PLItemAppended
,
this
);
var_DelCallback
(
THEPL
,
"playlist-item-deleted"
,
PLItemRemoved
,
this
);
}
vout_thread_t
*
MainInputManager
::
getVout
()
...
...
@@ -933,14 +941,25 @@ aout_instance_t * MainInputManager::getAout()
void
MainInputManager
::
customEvent
(
QEvent
*
event
)
{
int
type
=
event
->
type
();
if
(
type
!=
ItemChanged_Type
&&
type
!=
VolumeChanged_Type
)
return
;
PLEvent
*
plEv
;
// msg_Dbg( p_intf, "New MainIM Event of type: %i", type );
if
(
type
==
VolumeChanged_T
ype
)
switch
(
t
ype
)
{
case
VolumeChanged_Type
:
emit
volumeChanged
();
return
;
case
PLItemAppended_Type
:
plEv
=
static_cast
<
PLEvent
*>
(
event
);
emit
playlistItemAppended
(
plEv
->
i_item
,
plEv
->
i_parent
);
return
;
case
PLItemRemoved_Type
:
plEv
=
static_cast
<
PLEvent
*>
(
event
);
emit
playlistItemRemoved
(
plEv
->
i_item
);
return
;
default:
if
(
type
!=
ItemChanged_Type
)
return
;
}
/* Should be PLItemChanged Event */
...
...
@@ -1035,3 +1054,22 @@ static int VolumeChanged( vlc_object_t *p_this, const char *psz_var,
return
VLC_SUCCESS
;
}
static
int
PLItemAppended
(
vlc_object_t
*
obj
,
const
char
*
var
,
vlc_value_t
old
,
vlc_value_t
cur
,
void
*
data
)
{
MainInputManager
*
mim
=
static_cast
<
MainInputManager
*>
(
data
);
playlist_add_t
*
p_add
=
static_cast
<
playlist_add_t
*>
(
cur
.
p_address
);
PLEvent
*
event
=
new
PLEvent
(
PLItemAppended_Type
,
p_add
->
i_item
,
p_add
->
i_node
);
QApplication
::
postEvent
(
mim
,
event
);
return
VLC_SUCCESS
;
}
static
int
PLItemRemoved
(
vlc_object_t
*
obj
,
const
char
*
var
,
vlc_value_t
old
,
vlc_value_t
cur
,
void
*
data
)
{
MainInputManager
*
mim
=
static_cast
<
MainInputManager
*>
(
data
);
PLEvent
*
event
=
new
PLEvent
(
PLItemRemoved_Type
,
cur
.
i_int
,
0
);
QApplication
::
postEvent
(
mim
,
event
);
return
VLC_SUCCESS
;
}
modules/gui/qt4/input_manager.hpp
View file @
24a911ff
...
...
@@ -85,6 +85,21 @@ private:
input_item_t
*
p_item
;
};
enum
PLEventTypes
{
PLItemAppended_Type
=
QEvent
::
User
+
PLEventType
+
1
,
PLItemRemoved_Type
};
class
PLEvent
:
public
QEvent
{
public:
PLEvent
(
PLEventTypes
t
,
int
i
,
int
p
)
:
QEvent
(
(
QEvent
::
Type
)
t
),
i_item
(
i
),
i_parent
(
p
)
{}
int
i_item
;
int
i_parent
;
};
class
InputManager
:
public
QObject
{
Q_OBJECT
;
...
...
@@ -251,6 +266,8 @@ public slots:
signals:
void
inputChanged
(
input_thread_t
*
);
void
volumeChanged
();
void
playlistItemAppended
(
int
itemId
,
int
parentId
);
void
playlistItemRemoved
(
int
itemId
);
};
#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