Permalink
Browse files

Merging with latest pianobar.

  • Loading branch information...
1 parent babede1 commit 6907b73e04167b019467120d30bdb3fd0a8c2f6f Joshua V. Dillon committed Sep 22, 2012
View
71 INSTALL
@@ -4,13 +4,16 @@ Install
Dependencies
------------
-gmake
-libao http://www.xiph.org/ao/
-libfaad2 http://www.audiocoding.com/downloads.html
-AND/OR libmad http://www.underbit.com/products/mad/
-pthreads
-libid3tag http://www.underbit.com/products/mad/
-UTF-8 console/locale!
+- gmake
+- pthreads
+- libao
+- gnutls
+- gcrypt
+- json-c
+- libfaad2 (compiled with --without-drm)
+- libmad (optional, Pandora One users only)
+- UTF-8 console/locale
+- libid3tag http://www.underbit.com/products/mad/
Building
--------
@@ -19,13 +22,6 @@ If you have all of the dependencies listed above just type
make clean && make
-NOTE: The above won't work on Mac OS X (Snow Leopard) since c99 targets i386
-and cc (gcc4.2) targets x86_64. If you've built supporting libraries
-(libao, etc.) using gcc, you'll be unable to link. You can work around
-this issue by overriding CFLAGS[1]
-
- make clean && make CFLAGS="-O2 -DNDEBUG -W64"
-
You can run the client directly from the source directory now
./pianobarfly
@@ -34,23 +30,50 @@ Or install it by issuing
make install
-In case you don't want to install libmad OR libfaad you probably want to
-disable one of them:
+Selecting features
+++++++++++++++++++
- make clean && make DISABLE_FAAD=1
+It is possible to disable certain features when building pianobar by setting
+one of the variables listed below. In fact it is required if you don’t have the
+corresponding library installed. So if you don’t want AAC playback or don’t
+have libfaad installed for example, run
-or
+ gmake DISABLE_FAAD=1
- make clean && make DISABLE_MAD=1
+instead of a plain `gmake`.
-You can also disable libid3tag:
+DISABLE_FAAD=1
+ Disables AAC playback.
+DISABLE_MAD=1
+ Disables MP3 playback.
+DISABLE_ID3TAG=1
+ Disables libid3tag.
- make clean && make DISABLE_ID3TAG=1
+Mac OS X
+++++++++
-libpiano can be built and installed by running
-
- make clean && make libpiano && make install-libpiano
+NOTE: The above won't work on Mac OS X (Snow Leopard) since c99 targets i386
+and cc (gcc4.2) targets x86_64. If you've built supporting libraries
+(libao, etc.) using gcc, you'll be unable to link. You can work around
+this issue by overriding CFLAGS[1]
+ make clean && make CFLAGS="-O2 -DNDEBUG -W64"
[1] https://github.com/PromyLOPh/pianobar/issues/98
+Ubuntu 12.04
+++++++++++++
+
+To install on Ubuntu >= 12.04
+
+ sudo apt-get install \
+ libao-dev \
+ libmad0-dev \
+ libfaad-dev \
+ libgnutls-dev \
+ libjson0-dev \
+ libgcrypt11-dev
+ make
+ sudo make install
+
+You can then fire it up with `pianobarfly`
View
@@ -1,7 +1,8 @@
-Copyright (c) 2008-2011
+Copyright (c) 2008-2012
Lars-Dominik Braun <lars@6xq.net>
Ted Jordan <silverfunk@gmail.com>
Geoffrey Huntley <ghuntley@ghuntley.com>
+ Joshua V. Dillon <jvdillon@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
148 Makefile
@@ -48,14 +48,12 @@ LIBPIANO_DIR=src/libpiano
LIBPIANO_SRC=\
${LIBPIANO_DIR}/crypt.c \
${LIBPIANO_DIR}/piano.c \
- ${LIBPIANO_DIR}/xml.c
+ ${LIBPIANO_DIR}/request.c \
+ ${LIBPIANO_DIR}/response.c
LIBPIANO_HDR=\
${LIBPIANO_DIR}/config.h \
- ${LIBPIANO_DIR}/crypt_key_output.h \
- ${LIBPIANO_DIR}/xml.h \
${LIBPIANO_DIR}/crypt.h \
${LIBPIANO_DIR}/piano.h \
- ${LIBPIANO_DIR}/crypt_key_input.h \
${LIBPIANO_DIR}/piano_private.h
LIBPIANO_OBJ=${LIBPIANO_SRC:.c=.o}
LIBPIANO_RELOBJ=${LIBPIANO_SRC:.c=.lo}
@@ -70,81 +68,137 @@ LIBWAITRESS_OBJ=${LIBWAITRESS_SRC:.c=.o}
LIBWAITRESS_RELOBJ=${LIBWAITRESS_SRC:.c=.lo}
LIBWAITRESS_INCLUDE=${LIBWAITRESS_DIR}
-LIBEZXML_DIR=src/libezxml
-LIBEZXML_SRC=${LIBEZXML_DIR}/ezxml.c
-LIBEZXML_HDR=${LIBEZXML_DIR}/ezxml.h
-LIBEZXML_OBJ=${LIBEZXML_SRC:.c=.o}
-LIBEZXML_RELOBJ=${LIBEZXML_SRC:.c=.lo}
-LIBEZXML_INCLUDE=${LIBEZXML_DIR}
-
-ifneq (${DISABLE_FAAD}, 1)
+ifeq (${DISABLE_FAAD}, 1)
+ LIBFAAD_CFLAGS=
+ LIBFAAD_LDFLAGS=
+else
LIBFAAD_CFLAGS=-DENABLE_FAAD
LIBFAAD_LDFLAGS=-lfaad
endif
-ifneq (${DISABLE_MAD}, 1)
- LIBMAD_CFLAGS=${shell pkg-config --cflags mad} -DENABLE_MAD
- LIBMAD_LDFLAGS=${shell pkg-config --libs mad}
+ifeq (${DISABLE_MAD}, 1)
+ LIBMAD_CFLAGS=
+ LIBMAD_LDFLAGS=
+else
+ LIBMAD_CFLAGS=-DENABLE_MAD
+ LIBMAD_CFLAGS+=$(shell pkg-config --cflags mad)
+ LIBMAD_LDFLAGS=$(shell pkg-config --libs mad)
endif
-LIBGNUTLS_CFLAGS=
-LIBGNUTLS_LDFLAGS=-lgnutls
+LIBGNUTLS_CFLAGS=$(shell pkg-config --cflags gnutls)
+LIBGNUTLS_LDFLAGS=$(shell pkg-config --libs gnutls)
-ifneq (${DISABLE_ID3TAG}, 1)
- LIBID3TAG_CFLAGS=${shell pkg-config --cflags id3tag} -DENABLE_ID3TAG
- LIBID3TAG_LDFLAGS=${shell pkg-config --libs id3tag}
-endif
+LIBGCRYPT_CFLAGS=
+LIBGCRYPT_LDFLAGS=-lgcrypt
-LIBAO_CFLAGS=${shell pkg-config --cflags ao}
-LIBAO_LDFLAGS=${shell pkg-config --libs ao}
+LIBJSONC_CFLAGS=$(shell pkg-config --cflags json)
+LIBJSONC_LDFLAGS=$(shell pkg-config --libs json)
+
+ifeq (${DISABLE_ID3TAG}, 1)
+ LIBID3TAG_CFLAGS=
+ LIBID3TAG_LDFLAGS=
+else
+ LIBID3TAG_CFLAGS=$(shell pkg-config --cflags id3tag) -DENABLE_ID3TAG
+ LIBID3TAG_LDFLAGS=$(shell pkg-config --libs id3tag)
+endif
# build pianobarfly
ifeq (${DYNLINK},1)
pianobarfly: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} libpiano.so.0
- ${CC} -o $@ ${PIANOBAR_OBJ} ${LDFLAGS} ${LIBAO_LDFLAGS} -lpthread -L. \
- -lpiano ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS}
+ @echo " LINK $@"
+ @${CC} -o $@ ${PIANOBAR_OBJ} ${LDFLAGS} -lao -lpthread -lm -L. -lpiano \
+ ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS}
else
pianobarfly: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} \
- ${LIBWAITRESS_HDR} ${LIBEZXML_OBJ} ${LIBEZXML_HDR}
- ${CC} ${CFLAGS} ${LDFLAGS} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \
- ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ} ${LIBAO_LDFLAGS} -lpthread \
- ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS} ${LIBID3TAG_LDFLAGS} -o $@
+ ${LIBWAITRESS_HDR}
+ @echo " LINK $@"
+ @${CC} ${CFLAGS} ${LDFLAGS} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \
+ ${LIBWAITRESS_OBJ} -lao -lpthread -lm \
+ ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS} \
+ ${LIBGCRYPT_LDFLAGS} ${LIBJSONC_LDFLAGS} ${LIBID3TAG_LDFLAGS} -o $@
endif
# build shared and static libpiano
libpiano.so.0: ${LIBPIANO_RELOBJ} ${LIBPIANO_HDR} ${LIBWAITRESS_RELOBJ} \
- ${LIBWAITRESS_HDR} ${LIBEZXML_RELOBJ} ${LIBEZXML_HDR} \
- ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ}
- ${CC} -shared -Wl,-soname,libpiano.so.0 ${CFLAGS} ${LDFLAGS} \
+ ${LIBWAITRESS_HDR} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ}
+ @echo " LINK $@"
+ @${CC} -shared -Wl,-soname,libpiano.so.0 ${CFLAGS} ${LDFLAGS} \
-o libpiano.so.0.0.0 ${LIBPIANO_RELOBJ} \
- ${LIBWAITRESS_RELOBJ} ${LIBEZXML_RELOBJ}
- ln -s libpiano.so.0.0.0 libpiano.so.0
- ln -s libpiano.so.0 libpiano.so
- ${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ}
-
+ ${LIBWAITRESS_RELOBJ} ${LIBGNUTLS_LDFLAGS} ${LIBGCRYPT_LDFLAGS} \
+ ${LIBJSONC_LDFLAGS}
+ @ln -s libpiano.so.0.0.0 libpiano.so.0
+ @ln -s libpiano.so.0 libpiano.so
+ @echo " AR libpiano.a"
+ @${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ}
+
+
+# build dependency files
+%.d: %.c
+ @set -e; rm -f $@; \
+ $(CC) -M ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
+ ${LIBFAAD_CFLAGS} ${LIBMAD_CFLAGS} ${LIBGNUTLS_CFLAGS} \
+ ${LIBGCRYPT_CFLAGS} ${LIBJSONC_CFLAGS} $< > $@.$$$$; \
+ sed '1 s,^.*\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
+ rm -f $@.$$$$
+
+-include $(PIANOBAR_SRC:.c=.d)
+-include $(LIBPIANO_SRC:.c=.d)
+-include $(LIBWAITRESS_SRC:.c=.d)
+
+# build standard object files
%.o: %.c
- ${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
- -I ${LIBEZXML_INCLUDE} ${LIBFAAD_CFLAGS} \
- ${LIBMAD_CFLAGS} ${LIBGNUTLS_CFLAGS} ${LIBID3TAG_CFLAGS} ${LIBAO_CFLAGS} -c -o $@ $<
+ @echo " CC $<"
+ @${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
+ ${LIBFAAD_CFLAGS} ${LIBMAD_CFLAGS} ${LIBGNUTLS_CFLAGS} \
+ ${LIBGCRYPT_CFLAGS} ${LIBJSONC_CFLAGS} ${LIBID3TAG_CFLAGS} -c -o $@ $<
# create position independent code (for shared libraries)
%.lo: %.c
- ${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
- -I ${LIBEZXML_INCLUDE} -c -fPIC -o $@ $<
+ @echo " CC $< (PIC)"
+ @${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
+ ${LIBJSONC_CFLAGS} \
+ -c -fPIC -o $@ $<
clean:
- ${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBWAITRESS_OBJ}/test.o \
- ${LIBEZXML_OBJ} ${LIBPIANO_RELOBJ} ${LIBWAITRESS_RELOBJ} \
- ${LIBEZXML_RELOBJ} pianobarfly libpiano.so* libpiano.a waitress-test
+ @echo " CLEAN"
+ @${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBWAITRESS_OBJ}/test.o \
+ ${LIBPIANO_RELOBJ} ${LIBWAITRESS_RELOBJ} pianobarfly libpiano.so* \
+ libpiano.a waitress-test $(PIANOBAR_SRC:.c=.d) $(LIBPIANO_SRC:.c=.d) \
+ $(LIBWAITRESS_SRC:.c=.d)
all: pianobarfly
debug: pianobarfly
-debug: CFLAGS=-Wall -pedantic -ggdb -DDEBUG
+debug: CFLAGS=-pedantic -ggdb -Wall -Wmissing-declarations -Wshadow -Wcast-qual \
+ -Wformat=2 -Winit-self -Wignored-qualifiers -Wmissing-include-dirs \
+ -Wfloat-equal -Wundef -Wpointer-arith -Wtype-limits -Wbad-function-cast \
+ -Wcast-align -Wclobbered -Wempty-body -Wjump-misses-init -Waddress \
+ -Wlogical-op -Waggregate-return -Wstrict-prototypes \
+ -Wold-style-declaration -Wold-style-definition -Wmissing-parameter-type \
+ -Wmissing-prototypes -Wmissing-field-initializers -Woverride-init \
+ -Wpacked -Wredundant-decls -Wnested-externs
+# warnings for gcc 4.5; disabled:
+# -Wswitch-default: too many bogus warnings
+# -Wswitch-enum: too many bogus warnings
+# -Wunused-parameter: too many bogus warnings
+# -Wstrict-overflow: depends on optimization level
+# -Wunsafe-loop-optimizations: depends on optimization level
+# -Wwrite-strings: to be enabled
+# -Wconversion: too many (bogus?) warnings
+# -Wsign-conversion: same here
+# -Wsign-compare: to be enabled
+# -Wmissing-noreturn: recommendation
+# -Wmissing-format-attribute: same here
+# -Wpadded: have a closer look at this one
+# -Winline: we don't care
+# -Winvalid-pch: not our business
+# -Wdisabled-optimization: depends on optimization level
+# -Wstack-protector: we don't use stack protector
+# -Woverlength-strings: over-portability-ish
waitress-test: CFLAGS+= -DTEST
waitress-test: ${LIBWAITRESS_OBJ}
- ${CC} ${LDFLAGS} ${LIBWAITRESS_OBJ} -o waitress-test
+ ${CC} ${LDFLAGS} ${LIBWAITRESS_OBJ} ${LIBGNUTLS_LDFLAGS} -o waitress-test
test: waitress-test
./waitress-test
View
7 README
@@ -11,3 +11,10 @@ pianobarfly is a console client for the personalized web radio pandora
- last.fm scrobbling support (external application)
- proxy support for listeners outside the USA
- auto-rips streams to audio files
+
+The sourcecode for pianobar can be downloaded at:
+ http://github.com/PromyLOPh/pianobar/
+or,
+ http://6xq.net/projects/pianobar/
+The sourcecode for pianobarfly can be downloaded at:
+ http://github.com/ghuntley/pianobarfly
View
@@ -48,8 +48,7 @@
#embed_cover = true
# Misc
-# mp3, mp3-hifi or aacplus
-#audio_format = aacplus
+#audio_quality = low
#autostart_station = 123456
#event_command = /home/user/.config/pianobarfly/eventcmd
#fifo = /tmp/pianobar
@@ -62,3 +61,15 @@
# Format strings
#format_nowplaying_song = %t by %a on %l%r%@%s
#format_nowplaying_station = Station %n
+#format_list_song = %i) %a - %t%r
+
+# high-quality audio (192k mp3, for Pandora One subscribers only!)
+#audio_quality = high
+#rpc_host = internal-tuner.pandora.com
+#partner_user = pandora one
+#partner_password = TVCKIBGS9AO9TSYLNNFUML0743LH82D
+#device = D01
+#encrypt_password = 2%3WCL*JU$MP]4
+#decrypt_password = U#IO$RZPAB%VX2
+#tls_fingerprint = 394067EECB420E3911985C2CC02C12AE89BB09B2
+
Oops, something went wrong.

0 comments on commit 6907b73

Please sign in to comment.