¿RhythmBox tiene alguna interfaz de línea de comando o método de comunicación entre procesos?


21

Realmente me gustaría comunicarme con rhythmbox con un servidor web para poder cambiar de forma remota la música que se reproduce desde mi teléfono inteligente. ¿Existe una interfaz de línea de comandos para que rhythmbox haga cosas como los siguientes comandos (ficticios)?

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

¿Hay un socket o una interfaz para pasar mensajes en su lugar? ¿Hay algún programa sustituto que pueda hacer el trabajo, como Banshee o algún otro tipo de servidor?




2
@foss no, ninguna de las preguntas tiene una respuesta similar a Geppetos.
Braiam

Respuestas:


16

Básicamente, la respuesta corta es "Sí" y el complemento de dicha respuesta será "Use el rhythmbox-clientcomando desde un terminal para controlar su Rhythmbox actual en ejecución, si aún no está cargado, la primera instancia de sus comandos lo invocará".

Por ejemplo: rhythmbox-client --playhará que la sesión actual de Rhythmbox comience a reproducir la canción actual (o la primera canción de la lista). Si Rhythmbox está cerrado, lo abrirá primero para comenzar a jugar.

Se puede obtener más información sobre rhythmbox-clienty su uso en la página de manual de rhythmbox-client . Coloco aquí una parte de la página de manual solo como referencia.

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).

Editar

Me interesó un poco este tema, así que realicé una prueba con el siguiente comando:

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

De la respuesta original publicada aquí. Lo que de hecho funciona para la tarea de buscar la canción en reproducción actual (según el comentario del autor de la pregunta).

¡Buena suerte!


¡Increíble! Eso me ahorra mucho dolor de cabeza. ¿Sabes si hay una --seekhabilidad? No lo incluye en las páginas del manual.
Athan Clark

Desafortunadamente, las opciones de rhythmbox-client son limitadas. He agregado los detalles a esta respuesta para su conveniencia.
Geppettvs D'Constanzo

Eche un vistazo a esta respuesta: unix.stackexchange.com/a/75680 , la antigua opción --seek parece haber quedado obsoleta pero parece que hay otra solución. Por favor, háganos saber si tiene éxito. Gracias.
Geppettvs D'Constanzo

Oh bueno ... dejé caer otra edición para ti. ¡Buena suerte!
Geppettvs D'Constanzo

Resulta que Banshee tiene la capacidad de consultar información actual del jugador (como reproducción de pistas, posición del cursor, estado del jugador, etc.) y controlar la reproducción. banshee --help'lo explica todo! Sin embargo, gracias por tu ayuda, ¡espero que tengas un gran día!
Athan Clark
Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.