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
4a624114
Commit
4a624114
authored
Mar 27, 2009
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbus test script using dbus-send
parent
973687eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
116 additions
and
0 deletions
+116
-0
test/dbus/mpris_v1.sh
test/dbus/mpris_v1.sh
+116
-0
No files found.
test/dbus/mpris_v1.sh
0 → 100755
View file @
4a624114
#!/bin/bash
#############################################################################
# Test MPRIS v1.0 dbus communication with vlc
#############################################################################
# Copyright (C) 2009, M2X BV
# Author: Jean-Paul Saman <jean-paul.saman at m2x.nl>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
#############################################################################
verbose
=
"--print-reply=3"
medialist
=
$*
if
test
-z
"
$medialist
"
;
then
echo
"Provide a MRL for testing, eg: mpris_v1.sh file://myvideo.mpeg file://myvideo2.mpeg"
echo
"Make sure vlc is started before running this test script, eg: vlc --extraintf=dbus"
exit
1
fi
mpris_methodcall
()
{
local
object
=
$1
local
method
=
$2
shift
shift
local
args
=
$*
echo
-n
"Object
$object
method org.freedesktop.MediaPlayer.
$method
$args
...["
dbus-send
$verbose
--type
=
method_call
--dest
=
org.mpris.vlc
$object
org.freedesktop.MediaPlayer.
$method
$args
if
test
"
$?
"
-eq
0
;
then
echo
"]... pass"
else
echo
"]... fail"
fi
sleep
3
}
# ROOT object
mpris_methodcall
"/"
"MprisVersion"
mpris_methodcall
"/"
"Identity"
mpris_methodcall
"/Player"
"GetCaps"
mpris_methodcall
"/TrackList"
"GetLength"
mpris_methodcall
"/TrackList"
"SetLoop"
"boolean:true"
mpris_methodcall
"/Player"
"GetStatus"
count
=
0
for
media
in
$medialist
;
do
if
test
$count
-eq
0
;
then
mpris_methodcall
"/TrackList"
"AddTrack"
"string:
$media
"
"boolean:true"
else
mpris_methodcall
"/TrackList"
"AddTrack"
"string:
$media
"
"boolean:false"
fi
mpris_methodcall
"/TrackList"
"GetLength"
mpris_methodcall
"/TrackList"
"GetCurrentTrack"
mpris_methodcall
"/TrackList"
"GetMetadata"
int32:
$count
count
=
$((
$count
+
1
))
sleep
10
done
mpris_methodcall
"/Player"
"Next"
mpris_methodcall
"/Player"
"GetMetadata"
mpris_methodcall
"/Player"
"Prev"
mpris_methodcall
"/Player"
"Pause"
mpris_methodcall
"/Player"
"GetStatus"
mpris_methodcall
"/Player"
"Pause"
mpris_methodcall
"/TrackList"
"SetRandom"
"boolean:true"
mpris_methodcall
"/Player"
"Next"
mpris_methodcall
"/Player"
"Repeat"
"boolean:true"
mpris_methodcall
"/Player"
"GetStatus"
mpris_methodcall
"/TrackList"
"SetRandom"
"boolean:false"
mpris_methodcall
"/TrackList"
"SetLoop"
"boolean:false"
mpris_methodcall
"/Player"
"Stop"
mpris_methodcall
"/Player"
"GetStatus"
mpris_methodcall
"/Player"
"Play"
for
vol
in
0 10 20 30 40 50 60 70 80 90 100
;
do
mpris_methodcall
"/Player"
"VolumeSet"
int32:
$vol
done
mpris_methodcall
"/Player"
"VolumeSet"
int32:50
mpris_methodcall
"/Player"
"VolumeGet"
mpris_methodcall
"/Player"
"PositionSet"
int32:100
mpris_methodcall
"/Player"
"PositionGet"
mpris_methodcall
"/Player"
"Stop"
sleep
5
count
=
0
for
media
in
$medialist
;
do
mpris_methodcall
"/TrackList"
"DelTrack"
int32:
$count
mpris_methodcall
"/TrackList"
"GetLength"
count
=
$((
$count
+
1
))
done
mpris_methodcall
"/TrackList"
"GetLength"
mpris_methodcall
"/"
"Quit"
exit
0
\ No newline at end of file
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