AudioScrobbler submission. More...
#include "stdinc.h"#include <curl/curl.h>#include <curl/easy.h>#include "audio_file.h"#include "config.h"#include "gui.h"#include "md5.h"#include "scrobbler.h"#include "util.h"#include "vfs.h"

Go to the source code of this file.
Data Structures | |
| struct | scrobbler_entry |
| An entry in the AudioScrobbler queue, ready to be submitted to AudioScrobbler. More... | |
Defines | |
| #define | SCROBBLER_URL "http://%s/?hs=true&p=1.2&c=her&v=0.1&u=%s&t=%u&a=%s" |
| #define | SCROBBLER_QUEUE_FOREACH(se) for (se = scrobbler_queue_first; se != NULL; se = se->next) |
| Iterate through all entries in the Scrobbler queue. | |
Functions | |
| static struct scrobbler_entry * | scrobbler_queue_next (struct scrobbler_entry *se) |
| Next item in the Scrobbler queue. | |
| static void | scrobbler_queue_insert_tail (struct scrobbler_entry *se) |
| Place a new item in our Scrobbler queue. | |
| static void | scrobbler_queue_remove_head (void) |
| Remove the first item from our Scrobbler queue. | |
| void | scrobbler_notify_read (struct audio_file *fd, int eof) |
| Notify the AudioScrobbler thread that a read from the file has been performed. | |
| void | scrobbler_notify_seek (struct audio_file *fd) |
| Notify the AudioScrobbler thread that a seek on the file has been performed. | |
| static unsigned int | scrobbler_queue_fetch (const char key[32], char **poststr) |
| Fetch as much tracks from the AudioScrobbler submission queue (at most 10), generate a HTTP/1.1 POST string for submission and return the amount of tracks described in the POST string. | |
| static void | scrobbler_queue_item_free (struct scrobbler_entry *ent) |
| Deallocate an AudioScrobbler queue entry. | |
| static void | scrobbler_queue_remove (unsigned int amount) |
| Remove a specified amount of tracks from the AudioScrobbler submission queue. | |
| static void | scrobbler_hash (time_t t, char out[32]) |
| Generate a response, based on the password and challenge. | |
| static size_t | scrobbler_curl_concat (void *ptr, size_t size, size_t nmemb, void *stream) |
| Concatenate cURL data to a string. | |
| static void | scrobbler_split_lines (char *str, char *lines[], unsigned int nlines) |
| Split a string into multiple nul-terminated lines. | |
| static int | scrobbler_send_handshake (char *key, char **url) |
| Send a handshake to the AudioScrobbler server. Also catch whether the configured password is correct. | |
| static int | scrobbler_send_tracks (char *key, const char *url, const char *poststr) |
| Submit an amount of tracks to the AudioScrobbler server. Also make sure whether the tracks are submitted properly. | |
| static void * | scrobbler_runner_thread (void *unused) |
| The actual thread that gets spawned to process AudioScrobbler submission. | |
| void | scrobbler_init (void) |
| Initialize locking for the AudioScrobbler submission thread. | |
| static void | scrobbler_queue_dump (void) |
| Dump the songs that are still present in the queue to disk. | |
| static void | scrobbler_queue_restore (void) |
| Restore the AudioScrobbler queue from a file. | |
| void | scrobbler_spawn (void) |
| Spawn an AudioScrobbler submission thread. | |
| void | scrobbler_shutdown (void) |
| Shut down the AudioScrobbler submission thread. | |
Variables | |
| static char | scrobbler_enabled = 0 |
| Flag indicating if the AudioScrobbler thread has already been launched, causing the submission queue to be filled. | |
| static GMutex * | scrobbler_lock |
| Lock used to provide safe access to the AudioScrobbler queue. | |
| static GCond * | scrobbler_avail |
| Conditional variable used to notify the avaiability of new tracks ready for submission to AudioScrobbler. | |
| static GThread * | scrobbler_runner |
| Reference to AudioScrobbler submission thread. | |
| static struct scrobbler_entry * | scrobbler_queue_first = NULL |
| First item in the Scrobbler queue. | |
| static struct scrobbler_entry * | scrobbler_queue_last = NULL |
| Last item in the Scrobbler queue. | |
AudioScrobbler submission.
Definition in file scrobbler.c.
1.6.3