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
aca7ce70
Commit
aca7ce70
authored
Nov 07, 2009
by
Jakob Leben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt4: remove PlaylistEventManager
parent
6a25ed7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
81 deletions
+0
-81
modules/gui/qt4/components/playlist/playlist.cpp
modules/gui/qt4/components/playlist/playlist.cpp
+0
-51
modules/gui/qt4/components/playlist/playlist.hpp
modules/gui/qt4/components/playlist/playlist.hpp
+0
-30
No files found.
modules/gui/qt4/components/playlist/playlist.cpp
View file @
aca7ce70
...
...
@@ -148,54 +148,3 @@ void PlaylistWidget::closeEvent( QCloseEvent *event )
event
->
ignore
();
}
}
PlaylistEventManager
::
PlaylistEventManager
(
playlist_t
*
_pl
)
:
pl
(
_pl
)
{
var_AddCallback
(
pl
,
"playlist-item-append"
,
itemAddedCb
,
this
);
var_AddCallback
(
pl
,
"playlist-item-deleted"
,
itemRemovedCb
,
this
);
}
PlaylistEventManager
::~
PlaylistEventManager
()
{
var_DelCallback
(
pl
,
"playlist-item-append"
,
itemAddedCb
,
this
);
var_DelCallback
(
pl
,
"playlist-item-deleted"
,
itemRemovedCb
,
this
);
}
int
PlaylistEventManager
::
itemAddedCb
(
vlc_object_t
*
obj
,
const
char
*
var
,
vlc_value_t
old
,
vlc_value_t
cur
,
void
*
data
)
{
PlaylistEventManager
*
p_this
=
static_cast
<
PlaylistEventManager
*>
(
data
);
p_this
->
trigger
(
cur
,
ItemAddedEv
);
return
VLC_SUCCESS
;
}
int
PlaylistEventManager
::
itemRemovedCb
(
vlc_object_t
*
obj
,
const
char
*
var
,
vlc_value_t
old
,
vlc_value_t
cur
,
void
*
data
)
{
PlaylistEventManager
*
p_this
=
static_cast
<
PlaylistEventManager
*>
(
data
);
p_this
->
trigger
(
cur
,
ItemRemovedEv
);
return
VLC_SUCCESS
;
}
void
PlaylistEventManager
::
trigger
(
vlc_value_t
val
,
int
type
)
{
if
(
type
==
ItemAddedEv
)
{
playlist_add_t
*
p_add
=
static_cast
<
playlist_add_t
*>
(
val
.
p_address
);
QApplication
::
postEvent
(
this
,
new
PLEMEvent
(
type
,
p_add
->
i_item
,
p_add
->
i_node
)
);
}
else
{
QApplication
::
postEvent
(
this
,
new
PLEMEvent
(
type
,
val
.
i_int
,
0
)
);
}
}
void
PlaylistEventManager
::
customEvent
(
QEvent
*
e
)
{
PLEMEvent
*
ev
=
static_cast
<
PLEMEvent
*>
(
e
);
if
(
(
int
)
ev
->
type
()
==
ItemAddedEv
)
emit
itemAdded
(
ev
->
item
,
ev
->
parent
);
else
emit
itemRemoved
(
ev
->
item
);
}
modules/gui/qt4/components/playlist/playlist.hpp
View file @
aca7ce70
...
...
@@ -81,34 +81,4 @@ enum PLEventType {
ItemRemovedEv
};
class
PLEMEvent
:
public
QEvent
{
public:
PLEMEvent
(
int
t
,
int
i
,
int
p
)
:
QEvent
(
(
QEvent
::
Type
)
t
),
item
(
i
),
parent
(
p
)
{}
int
item
;
int
parent
;
};
class
PlaylistEventManager
:
public
QObject
{
Q_OBJECT
;
public:
PlaylistEventManager
(
playlist_t
*
);
~
PlaylistEventManager
();
signals:
void
itemAdded
(
int
i_item
,
int
i_parent
);
void
itemRemoved
(
int
i_id
);
private:
static
int
itemAddedCb
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
itemRemovedCb
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
void
trigger
(
vlc_value_t
,
int
);
void
customEvent
(
QEvent
*
);
playlist_t
*
pl
;
};
#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