I relized that when pause the song information might be wanted, so I'll leave it up to the user to only use 1 music player at a time

This commit is contained in:
zvon 2020-05-29 22:07:53 +02:00
parent e68aa6f457
commit 5663c2a8c1
2 changed files with 2 additions and 4 deletions

View File

@ -1,5 +1,5 @@
CC ?= clang CC ?= clang
CFLAGS ?= -O2 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include/ -Wall -Wextra -g CFLAGS ?= -O2 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include/ -Wall -Wextra
PREFIX ?= /usr/local/bin PREFIX ?= /usr/local/bin
LDFLAGS ?= -ldbus-1 -lmpdclient LDFLAGS ?= -ldbus-1 -lmpdclient

4
main.c
View File

@ -67,7 +67,7 @@ int main( int argc, char **argv ) {
if ( requests & SONG_FLAG || requests & META_FLAG ) { if ( requests & SONG_FLAG || requests & META_FLAG ) {
struct song_metadata song = { 0 }; struct song_metadata song = { 0 };
if ( sources & MPD_FLAG && mpdPlaying( mpd_connection ) ) { if ( sources & MPD_FLAG ) {
song = mpdGetSong( mpd_connection ); song = mpdGetSong( mpd_connection );
if ( requests & SONG_FLAG ) if ( requests & SONG_FLAG )
printSong( &song ); printSong( &song );
@ -77,8 +77,6 @@ int main( int argc, char **argv ) {
if ( sources & DBUS_FLAG ) { if ( sources & DBUS_FLAG ) {
for ( char **player = dbus_players; *player; ++player ) { for ( char **player = dbus_players; *player; ++player ) {
if ( !dbusPlaying( dbus_connection, *player ) )
continue;
song = dbusGetSong( dbus_connection, *player ); song = dbusGetSong( dbus_connection, *player );
if ( requests & SONG_FLAG ) if ( requests & SONG_FLAG )
printSong( &song ); printSong( &song );