annotate src/lastfm/lastfm.h @ 3161:6dd886b5c72b

revive stdio plugin for now. gio cannot write id3 tags.
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 13 Jul 2009 23:53:41 +0900
parents fa9f85cebade
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
1 #define LASTFM_HANDSHAKE_URL "http://ws.audioscrobbler.com/radio/handshake.php?version=1.1.1&platform=linux&username=%s&passwordmd5=%s&debug=0&language=jp"
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
2 #define LASTFM_ADJUST_URL "http://ws.audioscrobbler.com/radio/adjust.php?session=%s&url=%s&debug=0"
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
3 #define LASTFM_METADATA_URL "http://ws.audioscrobbler.com/radio/np.php?session=%s&debug=0"
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
4
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
5 #define LASTFM_CURL_TIMEOUT 10
1036
47db8268cb7b [svn] smarter polling and lots of other changes
majeru
parents: 1010
diff changeset
6
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
7
1200
0ae013f630fa mowgli transition, and some fixes
Cristi Magherusan <majeru@atheme-project.org>
parents: 1044
diff changeset
8 #define LASTFM_LOGIN_OK 0
0ae013f630fa mowgli transition, and some fixes
Cristi Magherusan <majeru@atheme-project.org>
parents: 1044
diff changeset
9 #define LASTFM_LOGIN_ERROR 1
0ae013f630fa mowgli transition, and some fixes
Cristi Magherusan <majeru@atheme-project.org>
parents: 1044
diff changeset
10 #define LASTFM_MISSING_LOGIN_DATA 2
0ae013f630fa mowgli transition, and some fixes
Cristi Magherusan <majeru@atheme-project.org>
parents: 1044
diff changeset
11 #define LASTFM_SESSION_MISSING 4
1217
d4efe4889489 rendered the lastfm transport plugin stable again, preparing it for its GUI
Cristi Magherusan <majeru@atheme-project.org>
parents: 1200
diff changeset
12 #define LASTFM_ADJUST_OK 8
d4efe4889489 rendered the lastfm transport plugin stable again, preparing it for its GUI
Cristi Magherusan <majeru@atheme-project.org>
parents: 1200
diff changeset
13 #define LASTFM_ADJUST_FAILED 16
d4efe4889489 rendered the lastfm transport plugin stable again, preparing it for its GUI
Cristi Magherusan <majeru@atheme-project.org>
parents: 1200
diff changeset
14 #define METADATA_FETCH_FAILED 64
d4efe4889489 rendered the lastfm transport plugin stable again, preparing it for its GUI
Cristi Magherusan <majeru@atheme-project.org>
parents: 1200
diff changeset
15 #define METADATA_FETCH_SUCCEEDED 128
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
16 typedef struct
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
17 {
1335
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
18 VFSFile *proxy_fd;
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
19 gchar *lastfm_session_id;
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
20 gchar *lastfm_mp3_stream_url;
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
21 gchar *lastfm_station_name;
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
22 gchar *lastfm_artist;
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
23 gchar *lastfm_title;
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
24 gchar *lastfm_album;
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
25 gchar *lastfm_cover;
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
26 unsigned int lastfm_duration;
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
27 unsigned int lastfm_progress;
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
28 } LastFM;
1335
59699988d194 fixed some issues, hopefully it won't crash that much anymore
Cristi Magherusan <majeru@atheme-project.org>
parents: 1239
diff changeset
29 GTimeVal *t0,*t1;
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
30
1217
d4efe4889489 rendered the lastfm transport plugin stable again, preparing it for its GUI
Cristi Magherusan <majeru@atheme-project.org>
parents: 1200
diff changeset
31 GThread* metadata_thread=NULL;
d4efe4889489 rendered the lastfm transport plugin stable again, preparing it for its GUI
Cristi Magherusan <majeru@atheme-project.org>
parents: 1200
diff changeset
32 gint thread_count=0;
1239
8af27e02e7b7 fixed crashes when opening multiple tracks, optimized metadata thread
Cristi Magherusan <majeru@atheme-project.org>
parents: 1231
diff changeset
33 static GMutex * metadata_mutex = NULL;
1392
e6f5685f71a1 added an experimental GUI for Last.fm radio
Cristi Magherusan <majeru@atheme-project.org>
parents: 1335
diff changeset
34 static gchar * login_url=NULL;
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
35 VFSFile *lastfm_aud_vfs_fopen_impl(const gchar * path, const gchar * mode);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
36
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
37 size_t lastfm_aud_vfs_fread_impl(gpointer ptr, size_t size, size_t nmemb, VFSFile * file);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
38
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
39 size_t lastfm_aud_vfs_fwrite_impl(gconstpointer ptr, size_t size, size_t nmemb, VFSFile * file);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
40
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
41 gint lastfm_aud_vfs_getc_impl(VFSFile * stream);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
42
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
43 gint lastfm_aud_vfs_ungetc_impl(gint c, VFSFile * stream);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
44
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
45 gint lastfm_aud_vfs_fseek_impl(VFSFile * file, glong offset, gint whence);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
46
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
47 void lastfm_aud_vfs_rewind_impl(VFSFile * file);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
48
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
49 glong lastfm_aud_vfs_ftell_impl(VFSFile * file);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
50
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
51 gboolean lastfm_aud_vfs_feof_impl(VFSFile * file);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
52
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
53 gint lastfm_aud_vfs_truncate_impl(VFSFile * file, glong size);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
54
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
55 off_t lastfm_aud_vfs_fsize_impl(VFSFile * file);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
56
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
57 gint lastfm_aud_vfs_fclose_impl(VFSFile * file);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
58
1978
fa9f85cebade s/vfs_/aud_vfs_/g
William Pitcock <nenolod@atheme.org>
parents: 1392
diff changeset
59 gchar *lastfm_aud_vfs_metadata_impl(VFSFile * file, const gchar * field);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
60
1392
e6f5685f71a1 added an experimental GUI for Last.fm radio
Cristi Magherusan <majeru@atheme-project.org>
parents: 1335
diff changeset
61 gboolean parse_metadata(LastFM * handle,gchar **res);
1036
47db8268cb7b [svn] smarter polling and lots of other changes
majeru
parents: 1010
diff changeset
62
1217
d4efe4889489 rendered the lastfm transport plugin stable again, preparing it for its GUI
Cristi Magherusan <majeru@atheme-project.org>
parents: 1200
diff changeset
63 static gpointer lastfm_metadata_thread_func(gpointer arg);
982
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
64
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
65 static gboolean lastfm_login(void);
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
66
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
67 LowlevelPlugin *get_lplugin_info(void);
7b0d16a9a92f [svn] fixed all the warnings
majeru
parents:
diff changeset
68