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
f32bdde1
Commit
f32bdde1
authored
Dec 10, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
telepathy: shows an empty status when VLC has been stopped
parent
848c1c1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
modules/misc/notify/telepathy.c
modules/misc/notify/telepathy.c
+28
-0
No files found.
modules/misc/notify/telepathy.c
View file @
f32bdde1
...
...
@@ -51,6 +51,8 @@ static void Close ( vlc_object_t * );
static
int
ItemChange
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
StateChange
(
vlc_object_t
*
,
const
char
*
,
vlc_value_t
,
vlc_value_t
,
void
*
);
static
int
SendToTelepathy
(
intf_thread_t
*
,
const
char
*
);
/*****************************************************************************
...
...
@@ -128,6 +130,7 @@ static int Open( vlc_object_t *p_this )
*****************************************************************************/
static
void
Close
(
vlc_object_t
*
p_this
)
{
p_this
->
b_dead
=
VLC_TRUE
;
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
p_this
;
playlist_t
*
p_playlist
=
pl_Yield
(
p_this
);
...
...
@@ -137,8 +140,12 @@ static void Close( vlc_object_t *p_this )
/* Do not check for VLC_ENOMEM as we're closing */
SendToTelepathy
(
p_intf
,
""
);
PL_LOCK
;
var_DelCallback
(
p_playlist
,
"item-change"
,
ItemChange
,
p_intf
);
var_DelCallback
(
p_playlist
,
"playlist-current"
,
ItemChange
,
p_intf
);
if
(
p_playlist
->
p_input
)
var_DelCallback
(
p_playlist
->
p_input
,
"state"
,
StateChange
,
p_intf
);
PL_UNLOCK
;
pl_Release
(
p_this
);
/* we won't use the DBus connection anymore */
...
...
@@ -159,6 +166,9 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
char
*
psz_buf
=
NULL
;
input_thread_t
*
p_input
;
if
(
p_intf
->
b_dead
)
return
VLC_EGENERIC
;
/* Don't update Telepathy presence each time an item has been preparsed */
if
(
!
strncmp
(
"playlist-current"
,
psz_var
,
16
)
)
{
/* stores the current input item id */
...
...
@@ -199,8 +209,12 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
}
}
if
(
!
strncmp
(
"playlist-current"
,
psz_var
,
16
)
)
var_AddCallback
(
p_input
,
"state"
,
StateChange
,
p_intf
);
/* We format the string to be displayed */
psz_buf
=
str_format_meta
(
p_this
,
p_intf
->
p_sys
->
psz_format
);
/* We don't need the input anymore */
vlc_object_release
(
p_input
);
...
...
@@ -213,6 +227,20 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
return
VLC_SUCCESS
;
}
/*****************************************************************************
* StateChange: State change callback
*****************************************************************************/
static
int
StateChange
(
vlc_object_t
*
p_this
,
const
char
*
psz_var
,
vlc_value_t
oldval
,
vlc_value_t
newval
,
void
*
param
)
{
intf_thread_t
*
p_intf
=
(
intf_thread_t
*
)
param
;
if
(
p_intf
->
b_dead
)
return
VLC_EGENERIC
;
if
(
newval
.
i_int
>=
END_S
)
return
SendToTelepathy
(
p_intf
,
""
);
return
VLC_SUCCESS
;
}
/*****************************************************************************
* SendToTelepathy
*****************************************************************************/
...
...
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