RhythmBox是否具有任何命令行界面或进程间通信的方法?


21

我真的很想通过Web服务器与Rhythmbox通信,以便可以从智能手机远程更改播放的音乐。Rhythmbox是否有命令行界面可以执行以下(虚拟)命令?

rhythmbox next
rhythmbox shuffle=false
rhythmbox change album='Dark Side of the Moon' artist='Pink Floyd' song='Time' 

是否有套接字或消息传递接口?是否有其他替代程序可以完成工作,例如Banshee或其他类型的服务器?




2
@foss不,这些问题都没有与Geppetos类似的答案。
Braiam 2013年

Answers:


16

基本上,简短的回答是“是”,并且这种回答的补充是“使用rhythmbox-client终端上的命令来控制当前运行的Rhythmbox,如果尚未加载,则您的命令的第一个实例将调用它。”

例如:rhythmbox-client --play将使当前Rhythmbox会话开始播放当前歌曲(或列表中的第一首歌曲)。如果Rhythmbox已关闭,则它将首先打开它以开始播放。

有关rhythmbox-client和及其用法的更多信息,可以在rhythmbox-client手册页中找到。我将手册页的一部分放在这里仅供参考。

NAME
       rhythmbox-client - controls a running instance of rhythmbox

SYNOPSIS
       rhythmbox-client [option...][file...]

DESCRIPTION
       rhythmbox-client  is a tool for controlling an already running instance
       of  rhythmbox.   It's  useful  for  remote  control  scripting,  adding
       specific  files  to  the library from the shell, or printing details of
       what's playing. It also has an interactive mode, useful for controlling
       playback  remotely  via  ssh.  Any  files  specified  after  the option
       arguments will be added to the library.  If  the  --enqueue  option  is
       given, the files will also be added to the play queue.

OPTIONS
       -?,--help
              Show help options

       --debug
              Enable debug output

       --no-start
              Do not start a new instance of rhythmbox

       --quit Quit rhythmbox

       -i,--interactive
              Start  interactive  mode  --no-present Don't present an existing
              rhythmbox window

       --next Jump to next song

       --previous
              Jump to previous song

       --play Resume playback if currently paused

       --pause
              Pause playback if currently playing

       --play-pause
              Toggle play/pause mode

       --stop Stop playback if currently playing

       --play-uri=URI
              Play a specified URI, importing it if necessary

       --enqueue
              Add specified tracks already in the library to the play queue

       --clear-queue
              Empty the play queue before adding new tracks

       --print-playing
              Print the title and artist of the playing song

       --print-playing-format=format
              Print formatted details of the song (see FORMAT OPTIONS below).

       --set-volume
              Set the playback volume

       --volume-up
              Increase the playback volume

       --volume-down
              Decrease the playback volume

       --print-volume
              Print the current playback volume

       --select-source=URI
              Select the source corresponding to a URI (device or mount point)

       --activate-source=URI
              Select the source corresponding to a URI (device or mount point)
              and start playing from it if not already playing.

       --play-source=URI
              Select the source corresponding to a URI (device or mount point)
              and start playing from it.

FORMAT OPTIONS
       %at    album title

       %aa    album artist

       %aA    album artist (lowercase)

       %as    album artist sortname

       %aS    album artist sortname (lowercase)

       %ay    album year

       %ag    album genre

       %aG    album genre (lowercase)

       %an    album disc number

       %aN    album disc number, zero padded

       %st    stream title

       %tn    track number (i.e 8)

       %tN    track number, zero padded (i.e 08)

       %tt    track title

       %ta    track artist

       %tA    track artist (lowercase)

       %ts    track artist sortname

       %tS    track artist sortname (lowercase)

       %td    track duration

       %te    track elapsed time

       Variables can be combined using quotes. For example "%tn %aa %tt", will
       print  the  track  number  followed  by the artist and the title of the
       track.

AUTHOR
       This manual page was written by Sven Arvidsson  <sa@whiz.se>,  for  the
       Debian system (but may be used by others).

编辑

我对此主题产生了兴趣,因此我对下一个命令进行了测试:

dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Seek int64:60000000

从此处发布的原始答案。这确实适用于搜索当前正在播放的歌曲的任务(基于提问者的评论)。

祝好运!


太棒了!那让我省了很多麻烦。你知道有--seek能力吗?它不在手册页中。
亚当·克拉克

不幸的是,rhythmbox-client选项是有限的。为了方便起见,我在此答案中添加了详细信息。
Geppettvs D'Constanzo

看一下以下答案:unix.stackexchange.com/a/75680,以前的--seek选项似乎已被弃用,但似乎还有另一种解决方案。如果您成功,请告诉我们。谢谢。
Geppettvs D'Constanzo

哦,好吧,我为您添加了另一个编辑。祝好运!
Geppettvs D'Constanzo

事实证明,Banshee具有查询当前播放器信息(例如曲目播放,光标位置,播放器状态等)并控制播放的功能!banshee --help一切都简单!谢谢您的帮助,希望您过得愉快!
亚当·克拉克
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.