summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@lavabit.com>2010-03-05 12:07:54 +0100
committerLars-Dominik Braun <PromyLOPh@lavabit.com>2010-03-06 10:55:52 +0100
commit80ed3d8e31b212c3a9d1e6edf41f1112e8029b59 (patch)
tree97b1e03d35493dd13ca209ee3686bec84eb26025 /src/main.c
parent3838e77238e383d6bea6496a7bc035702f320210 (diff)
downloadpianobar-80ed3d8e31b212c3a9d1e6edf41f1112e8029b59.tar.gz
pianobar-80ed3d8e31b212c3a9d1e6edf41f1112e8029b59.tar.bz2
pianobar-80ed3d8e31b212c3a9d1e6edf41f1112e8029b59.zip
wardrobe: Removed internal last.fm scrobbling library
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/main.c b/src/main.c
index d842179..b7f6235 100644
--- a/src/main.c
+++ b/src/main.c
@@ -38,10 +38,6 @@ THE SOFTWARE.
#include <fcntl.h>
/* tcset/getattr () */
#include <termios.h>
-
-/* last.fm scrobbling library */
-#include <wardrobe.h>
-
#include <pthread.h>
/* pandora.com library */
@@ -61,12 +57,10 @@ int main (int argc, char **argv) {
static struct audioPlayer player;
BarSettings_t settings;
pthread_t playerThread;
- WardrobeHandle_t wh;
/* playlist; first item is current song */
PianoSong_t *playlist = NULL;
PianoSong_t *songHistory = NULL;
PianoStation_t *curStation = NULL;
- WardrobeSong_t scrobbleSong;
char doQuit = 0;
/* FIXME: max path length? */
char ctlPath[1024];
@@ -88,7 +82,6 @@ int main (int argc, char **argv) {
/* init some things */
ao_initialize ();
PianoInit (&ph);
- WardrobeInit (&wh);
BarSettingsInit (&settings);
BarSettingsRead (&settings);
@@ -122,11 +115,6 @@ int main (int argc, char **argv) {
settings.password = strdup (passBuf);
}
- if (settings.enableScrobbling) {
- wh.user = strdup (settings.lastfmUser);
- wh.password = strdup (settings.lastfmPassword);
- }
-
/* setup control connection */
if (settings.controlProxy != NULL) {
char tmpPath[2];
@@ -171,24 +159,6 @@ int main (int argc, char **argv) {
while (!doQuit) {
/* song finished playing, clean up things/scrobble song */
if (player.mode == PLAYER_FINISHED_PLAYBACK) {
- scrobbleSong.length = player.songDuration / BAR_PLAYER_MS_TO_S_FACTOR;
- /* scrobble when >= nn% are played; use seconds, not
- * milliseconds */
- if (scrobbleSong.length > 0 && settings.enableScrobbling &&
- player.songPlayed / BAR_PLAYER_MS_TO_S_FACTOR * 100 /
- scrobbleSong.length >= settings.lastfmScrobblePercent) {
- WardrobeReturn_t wRet;
-
- BarUiMsg (MSG_INFO, "Scrobbling song... ");
- if ((wRet = WardrobeSubmit (&wh, &scrobbleSong)) ==
- WARDROBE_RET_OK) {
- BarUiMsg (MSG_NONE, "Ok.\n");
- } else {
- BarUiMsg (MSG_ERR, "Error: %s\n",
- WardrobeErrorToString (wRet));
- }
- }
- WardrobeSongDestroy (&scrobbleSong);
/* FIXME: pthread_join blocks everything if network connection
* is hung up e.g. */
void *threadRet;
@@ -263,14 +233,6 @@ int main (int argc, char **argv) {
if (playlist->audioUrl == NULL) {
BarUiMsg (MSG_ERR, "Invalid song url.\n");
} else {
- /* setup artist and song name for scrobbling (playlist
- * may be NULL later) */
- WardrobeSongInit (&scrobbleSong);
- scrobbleSong.artist = strdup (playlist->artist);
- scrobbleSong.title = strdup (playlist->title);
- scrobbleSong.album = strdup (playlist->album);
- scrobbleSong.started = time (NULL);
-
/* setup player */
memset (&player, 0, sizeof (player));
@@ -359,7 +321,6 @@ int main (int argc, char **argv) {
PianoDestroy (&ph);
PianoDestroyPlaylist (songHistory);
PianoDestroyPlaylist (playlist);
- WardrobeDestroy (&wh);
ao_shutdown();
BarSettingsDestroy (&settings);