Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
a54f7868
Commit
a54f7868
authored
Nov 19, 2006
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds GetPlayingItem method
Fixes Quit method Fixes TogglePause method
parent
69f569fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
modules/control/dbus.c
modules/control/dbus.c
+24
-6
modules/control/dbus.h
modules/control/dbus.h
+3
-0
No files found.
modules/control/dbus.c
View file @
a54f7868
...
@@ -105,7 +105,7 @@ DBUS_METHOD( Quit )
...
@@ -105,7 +105,7 @@ DBUS_METHOD( Quit )
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
playlist_Stop
(
p_playlist
);
playlist_Stop
(
p_playlist
);
pl_Release
(
((
vlc_object_t
*
)
p_this
)
);
pl_Release
(
((
vlc_object_t
*
)
p_this
)
);
((
vlc_object_t
*
)
p_this
)
->
b_die
=
VLC_TRUE
;
((
vlc_object_t
*
)
p_this
)
->
p_libvlc
->
b_die
=
VLC_TRUE
;
REPLY_SEND
;
REPLY_SEND
;
}
}
...
@@ -135,6 +135,20 @@ DBUS_METHOD( Stop )
...
@@ -135,6 +135,20 @@ DBUS_METHOD( Stop )
pl_Release
(
((
vlc_object_t
*
)
p_this
)
);
pl_Release
(
((
vlc_object_t
*
)
p_this
)
);
REPLY_SEND
;
REPLY_SEND
;
}
}
DBUS_METHOD
(
GetPlayingItem
)
{
/* return the current item */
REPLY_INIT
;
OUT_ARGUMENTS
;
char
psz_no_input
=
'\0'
;
char
*
p_psz_no_input
=
&
psz_no_input
;
playlist_t
*
p_playlist
=
pl_Yield
(
((
vlc_object_t
*
)
p_this
)
);
input_thread_t
*
p_input
=
p_playlist
->
p_input
;
ADD_STRING
(
(
p_input
)
?
&
p_input
->
input
.
p_item
->
psz_name
:
&
p_psz_no_input
);
pl_Release
(
((
vlc_object_t
*
)
p_this
)
);
REPLY_SEND
;
}
DBUS_METHOD
(
GetPlayStatus
)
DBUS_METHOD
(
GetPlayStatus
)
{
/* return a string */
{
/* return a string */
REPLY_INIT
;
REPLY_INIT
;
...
@@ -173,23 +187,26 @@ DBUS_METHOD( TogglePause )
...
@@ -173,23 +187,26 @@ DBUS_METHOD( TogglePause )
vlc_value_t
val
;
vlc_value_t
val
;
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
playlist_t
*
p_playlist
=
pl_Yield
(
(
vlc_object_t
*
)
p_this
);
PL_LOCK
;
input_thread_t
*
p_input
=
p_playlist
->
p_input
;
input_thread_t
*
p_input
=
p_playlist
->
p_input
;
if
(
p_input
!=
NULL
)
if
(
p_input
)
{
{
var_Get
(
p_input
,
"state"
,
&
val
);
var_Get
(
p_input
,
"state"
,
&
val
);
if
(
val
.
i_int
!=
PAUSE_S
)
if
(
val
.
i_int
!=
PAUSE_S
)
{
{
val
.
i_int
=
PAUSE_S
;
val
.
i_int
=
PAUSE_S
;
playlist_Pause
(
p_playlist
);
}
}
else
else
{
{
val
.
i_int
=
PLAYING_S
;
val
.
i_int
=
PLAYING_S
;
playlist_Play
(
p_playlist
);
}
}
var_Set
(
p_input
,
"state"
,
val
);
}
}
PL_UNLOCK
;
else
{
val
.
i_int
=
PLAYING_S
;
playlist_Play
(
p_playlist
);
}
pl_Release
(
p_playlist
);
pl_Release
(
p_playlist
);
dbus_bool_t
pause
=
(
val
.
i_int
==
PLAYING_S
)
?
TRUE
:
FALSE
;
dbus_bool_t
pause
=
(
val
.
i_int
==
PLAYING_S
)
?
TRUE
:
FALSE
;
...
@@ -272,6 +289,7 @@ DBUS_METHOD( handle_messages )
...
@@ -272,6 +289,7 @@ DBUS_METHOD( handle_messages )
/* here D-Bus method's names are associated to an handler */
/* here D-Bus method's names are associated to an handler */
METHOD_FUNC
(
"GetPlayStatus"
,
GetPlayStatus
);
METHOD_FUNC
(
"GetPlayStatus"
,
GetPlayStatus
);
METHOD_FUNC
(
"GetPlayingItem"
,
GetPlayingItem
);
METHOD_FUNC
(
"AddMRL"
,
AddMRL
);
METHOD_FUNC
(
"AddMRL"
,
AddMRL
);
METHOD_FUNC
(
"TogglePause"
,
TogglePause
);
METHOD_FUNC
(
"TogglePause"
,
TogglePause
);
METHOD_FUNC
(
"Nothing"
,
Nothing
);
METHOD_FUNC
(
"Nothing"
,
Nothing
);
...
...
modules/control/dbus.h
View file @
a54f7868
...
@@ -89,6 +89,9 @@ const char* psz_introspection_xml_data =
...
@@ -89,6 +89,9 @@ const char* psz_introspection_xml_data =
" <method name=
\"
GetPlayStatus
\"
>
\n
"
" <method name=
\"
GetPlayStatus
\"
>
\n
"
" <arg type=
\"
s
\"
direction=
\"
out
\"
/>
\n
"
" <arg type=
\"
s
\"
direction=
\"
out
\"
/>
\n
"
" </method>
\n
"
" </method>
\n
"
" <method name=
\"
GetPlayingItem
\"
>
\n
"
" <arg type=
\"
s
\"
direction=
\"
out
\"
/>
\n
"
" </method>
\n
"
" <method name=
\"
TogglePause
\"
>
\n
"
" <method name=
\"
TogglePause
\"
>
\n
"
" <arg type=
\"
s
\"
direction=
\"
out
\"
/>
\n
"
" <arg type=
\"
s
\"
direction=
\"
out
\"
/>
\n
"
" </method>
\n
"
" </method>
\n
"
...
...
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