Mercurial > audlegacy
changeset 3263:1c58910e0aeb trunk
merge
author | Ben Tucker <ben.tucker@gmail.com> |
---|---|
date | Sat, 28 Jul 2007 12:28:40 -0700 |
parents | 62d5f7a24983 (current diff) e4645b6fb7e3 (diff) |
children | 0644dae9e1be |
files | |
diffstat | 6 files changed, 478 insertions(+), 99 deletions(-) [+] |
line wrap: on
line diff
--- a/po/de.po Thu Jul 26 21:18:41 2007 -0700 +++ b/po/de.po Sat Jul 28 12:28:40 2007 -0700 @@ -577,7 +577,7 @@ "<b><big>Kann keinen Ton wiedergeben.</big></b>\n" "\n" "Bitte folgendes überprüfen:\n" -"1. Das richtige Output-Plugin wurde gewählt.\n" +"1. Das richtige Ausgabe-Plugin wurde gewählt.\n" "2. Keine anderen Programme blockieren die Soundkarte.\n" "3. Die Soundkarte ist richtig konfiguriert.\n" @@ -1174,16 +1174,16 @@ #: src/audacious/ui_manager.c:431 msgid "Load preset" -msgstr "Lade Equalizer-Voreinstellung" +msgstr "Equalizer-Voreinstellung laden" #: src/audacious/ui_manager.c:433 src/audacious/ui_manager.c:454 #: src/audacious/ui_manager.c:469 msgid "Auto-load preset" -msgstr "Autolade-Voreinstellung" +msgstr "Automatisch geladene Equalizer-Voreinstellung" #: src/audacious/ui_manager.c:434 msgid "Load auto-load preset" -msgstr "Autolade-Voreinstellung laden" +msgstr "Automatisch geladene Equalizer-Voreinstellung laden" #: src/audacious/ui_manager.c:436 src/audacious/ui_manager.c:457 msgid "Default" @@ -1191,7 +1191,7 @@ #: src/audacious/ui_manager.c:437 msgid "Load default preset into equalizer" -msgstr "Standardeinstellung in Equalizer laden" +msgstr "Standard-Equalizer-Voreinstellung in Equalizer laden" #: src/audacious/ui_manager.c:439 msgid "Zero" @@ -1207,35 +1207,35 @@ #: src/audacious/ui_manager.c:443 msgid "Load preset from file" -msgstr "Lade Voreinstellung aus Datei" +msgstr "Equalizer-Voreinstellung aus Datei laden" #: src/audacious/ui_manager.c:445 msgid "From WinAMP EQF file" -msgstr "Aus WinAMP-EQF-Datei" +msgstr "Aus Winamp-EQF-Datei" #: src/audacious/ui_manager.c:446 msgid "Load preset from WinAMP EQF file" -msgstr "Voreinstellungen aus WinAMP-EQF-Datei laden" +msgstr "Equalizer-Voreinstellung aus Winamp-EQF-Datei laden" #: src/audacious/ui_manager.c:448 msgid "WinAMP Presets" -msgstr "WinAMP-Voreinstellungen" +msgstr "Winamp-Equalizer-Voreinstellungen" #: src/audacious/ui_manager.c:449 msgid "Import WinAMP presets" -msgstr "WinAMP-Voreinstellungen importieren" +msgstr "Winamp-Equalizer-Voreinstellungen importieren" #: src/audacious/ui_manager.c:452 msgid "Save preset" -msgstr "Speichere Voreinstellung" +msgstr "Equalizer-Voreinstellung speichern" #: src/audacious/ui_manager.c:455 msgid "Save auto-load preset" -msgstr "Speichere Autolade-Voreinstellung" +msgstr "Automatisch geladene Equalizer-Voreinstellung speichern" #: src/audacious/ui_manager.c:458 msgid "Save default preset" -msgstr "Speichere Voreinstellung" +msgstr "Standard-Equalizer-Voreinstellung speichern" #: src/audacious/ui_manager.c:460 msgid "To file" @@ -1243,23 +1243,23 @@ #: src/audacious/ui_manager.c:461 msgid "Save preset to file" -msgstr "Speichere Voreinstellung in Datei" +msgstr "Equalizer-Voreinstellung in Datei speichern" #: src/audacious/ui_manager.c:463 msgid "To WinAMP EQF file" -msgstr "In WinAMP EQF-Datei" +msgstr "In Winamp-EQF-Datei" #: src/audacious/ui_manager.c:464 msgid "Save preset to WinAMP EQF file" -msgstr "Voreinstellung in WinAMP EQF-Datei speichern" +msgstr "Equalizer-Voreinstellung in Winamp-EQF-Datei speichern" #: src/audacious/ui_manager.c:467 msgid "Delete preset" -msgstr "Lösche Voreinstellung" +msgstr "Equalizer-Voreinstellung löschen" #: src/audacious/ui_manager.c:470 msgid "Delete auto-load preset" -msgstr "Autolade-Voreinstellung löschen" +msgstr "Automatisch geladene Equalizer-Voreinstellung löschen" #: src/audacious/ui_preferences.c:101 src/audacious/glade/prefswin.glade:1363 msgid "Appearance" @@ -1287,7 +1287,7 @@ #: src/audacious/ui_preferences.c:113 src/audacious/ui_fileinfopopup.c:254 msgid "Artist" -msgstr "Artist" +msgstr "Künstler" #: src/audacious/ui_preferences.c:114 src/audacious/ui_fileinfopopup.c:257 #: src/audacious/titlestring.c:380 @@ -1378,7 +1378,7 @@ #: src/audacious/ui_fileopener.c:129 msgid "Open Files" -msgstr "/Dateien öffnen" +msgstr "Dateien öffnen" #: src/audacious/ui_fileopener.c:129 msgid "Add Files" @@ -1411,26 +1411,27 @@ "expressions work, simply insert a literal portion of what you're searching " "for." msgstr "" -"Wiedergabelisteneinträge durch Eingabe von einem oder mehreren Feldern " -"auswählen. Benutzt reguläre Ausdrücke ohne Beachtung der Gross- und " -"Kleinschreibung. Falls diese unbekannt sind, kann auch einfach ein " -"Suchbegriff eingegeben werden." +"Wiedergabelisteneinträge können durch Ausfüllen von einem oder mehreren " +"Feldern auswählt werden. Die Felder benutzen reguläre Ausdrücke ohne " +"Beachtung der Gross- und Kleinschreibung. Falls der Umgang mit regulären " +"Ausdrücken nicht vertraut ist, kann auch einfach ein Suchbegriff " +"eingegeben werden." #: src/audacious/ui_playlist.c:496 msgid "Track name: " -msgstr "Titelname:" +msgstr "Titelname: " #: src/audacious/ui_playlist.c:502 msgid "Album name: " -msgstr "Albumname:" +msgstr "Albumname: " #: src/audacious/ui_playlist.c:508 msgid "Artist: " -msgstr "Künstler:" +msgstr "Künstler: " #: src/audacious/ui_playlist.c:514 msgid "Filename: " -msgstr "Dateiname:" +msgstr "Dateiname: " #: src/audacious/ui_playlist.c:521 msgid "Clear previous selection before searching" @@ -1475,11 +1476,11 @@ #: src/audacious/ui_playlist.c:1690 msgid "Audacious Playlist Editor" -msgstr "Audacious Wiedergabelisteneditor" +msgstr "Audacious-Wiedergabelisteneditor" #: src/audacious/ui_urlopener.c:90 msgid "Add/Open URL Dialog" -msgstr "URL hinzufügen/öffnen-Dialog" +msgstr "«URL hinzufügen/öffnen»-Fenster" #: src/audacious/ui_playlist_manager.c:253 msgid "Playlist Manager" @@ -1523,7 +1524,7 @@ #: src/audacious/titlestring.c:379 msgid "Performer/Artist" -msgstr "Performer/Artist" +msgstr "Interpret/Künstler" #: src/audacious/titlestring.c:382 msgid "File name" @@ -1655,7 +1656,7 @@ #: src/audacious/glade/prefswin.glade:1093 msgid "Use Bitmap fonts if available" -msgstr "Bitmap-Schriften (falls verfügbar)" +msgstr "Bitmap-Schriften benützen (falls verfügbar)" #: src/audacious/glade/prefswin.glade:1127 msgid "<b>_Miscellaneous</b>" @@ -1667,11 +1668,11 @@ #: src/audacious/glade/prefswin.glade:1210 msgid "Show separators in playlist" -msgstr "Trennzeichen in Wiedergabeliste zeigen" +msgstr "Trennstriche in Wiedergabeliste zeigen" #: src/audacious/glade/prefswin.glade:1245 msgid "Use custom cursors" -msgstr "Eigenen Cursor benutzen" +msgstr "Benutzerdefinierte Mauszeiger benutzen" #: src/audacious/glade/prefswin.glade:1279 #: src/audacious/glade/prefswin.glade:1290 @@ -1693,7 +1694,7 @@ "(but sadly not as user-friendly)." msgstr "" "XMMS/GTK1-artigen Dateiauswahldialog aktivieren. Dieser wird von Audacious " -"zur Verfügung gestellt und ist schneller als derjenige von GTK2, aber dafür " +"zur Verfügung gestellt und ist schneller als derjenige von GTK2, dafür aber " "nicht so benutzerfreundlich." #: src/audacious/glade/prefswin.glade:1321 @@ -1706,7 +1707,7 @@ #: src/audacious/glade/prefswin.glade:1458 msgid "Changes volume by" -msgstr "Lautstärke verändern von" +msgstr "Lautstärke verändern um" #: src/audacious/glade/prefswin.glade:1486 msgid "percent" @@ -1714,7 +1715,7 @@ #: src/audacious/glade/prefswin.glade:1514 msgid "Scrolls playlist by" -msgstr "Wiedergabeliste bewegen von" +msgstr "Wiedergabeliste bewegen um" #: src/audacious/glade/prefswin.glade:1567 msgid "lines" @@ -1726,15 +1727,15 @@ #: src/audacious/glade/prefswin.glade:1729 msgid "Convert underscores to blanks" -msgstr "Unterstriche zu Leerzeichen konvertieren" +msgstr "Unterstriche in Leerzeichen umwandeln" #: src/audacious/glade/prefswin.glade:1764 msgid "Convert %20 to blanks" -msgstr "%20 zu Leerzeichen konvertieren" +msgstr "%20 in Leerzeichen umwandeln" #: src/audacious/glade/prefswin.glade:1799 msgid "Convert backslash '\\' to forward slash '/'" -msgstr "Umgekehrter Schrägstich (\\) zu normalem Schrägstrich (/) umwandeln" +msgstr "Umgekehrten Schrägstrich (\\) in normalen Schrägstrich (/) umwandeln" #: src/audacious/glade/prefswin.glade:1833 msgid "<b>Metadata</b>" @@ -1779,8 +1780,8 @@ msgstr "" "Alternativ für Metadaten verwendete Zeichensätze. Wenn die automatische " "Erkennung des Zeichensatzes fehlgeschlagen oder deaktiviert ist, werden die " -"nachfolgend aufgelisteten Zeichensätze ausprobiert. Von diesen aus dann noch " -"einmal probiert, UTF-8 zu dekodieren." +"nachfolgend aufgelisteten Zeichensätze ausprobiert. Nach diesen wird dann " +"noch einmal probiert, von diesen Zeichensätzen nach UTF-8 zu dekodieren." #: src/audacious/glade/prefswin.glade:2035 msgid "Auto character encoding detector for:" @@ -1796,8 +1797,8 @@ "directories, and Gnome VFS should handle automatically)." msgstr "" "Dateidialog immer aktualisieren (dies wird das Öffnen des Dialogs mit " -"grossen Verzeichnissen langsamer machen, sollte Gnome VFS sollte es " -"automatisch aktiviert sein)" +"großen Verzeichnissen langsamer machen, und Gnome VFS sollte das " +"automatisch machen)" #: src/audacious/glade/prefswin.glade:2132 msgid "Always refresh directory when opening file dialog" @@ -1826,10 +1827,10 @@ "Custom" msgstr "" "TITEL\n" -"ARTIST - TITEL\n" -"ARTIST - ALBUM - TITEL\n" -"ARTIST - ALBUM - TRACK. TITEL\n" -"ARTIST [ ALBUM ] - TRACK. TITEL\n" +"KÜNSTLER - TITEL\n" +"KÜNSTLER - ALBUM - TITEL\n" +"KÜNSTLER - ALBUM - TRACK. TITEL\n" +"KÜNSTLER [ ALBUM ] - TRACK. TITEL\n" "ALBUM - TITEL\n" "Eigene" @@ -1849,7 +1850,8 @@ msgstr "" "Schaltet die Popup-Informationen ein und aus. Diese werden angezeigt, wenn " "mit der Maus über einen Wiedergabelisteneintrag gefahren wird. Gezeigt " -"werden Titel, Album, Genre, Publikationsjahr und weitere Informationen." +"werden Titel, Album, Genre, Publikationsjahr, Titelnummer, Titellänge und " +"Cover-Bild." #: src/audacious/glade/prefswin.glade:2418 msgid "Show popup information for playlist entries" @@ -1861,19 +1863,19 @@ #: src/audacious/glade/prefswin.glade:2553 msgid "<b>Presets</b>" -msgstr "<b>Voreinstellungen</b>" +msgstr "<b>Equalizer-Voreinstellungen</b>" #: src/audacious/glade/prefswin.glade:2653 msgid "Directory preset file:" -msgstr "Verzeichnis für Voreinstellungs-Dateien:" +msgstr "Verzeichnis für Equalizer-Voreinstellungs-Dateien:" #: src/audacious/glade/prefswin.glade:2681 msgid "File preset extension:" -msgstr "Endung von Voreinstellungs-Dateien:" +msgstr "Endung von Equalizer-Voreinstellungs-Dateien:" #: src/audacious/glade/prefswin.glade:2729 msgid "Available _Presets:" -msgstr "Verfügbare _Voreinstellungen:" +msgstr "Verfügbare Equalizer-_Voreinstellungen:" #: src/audacious/glade/prefswin.glade:2909 msgid "<b>Proxy Configuration</b>" @@ -1908,8 +1910,8 @@ "<span size=\"small\">Changing these settings will require a restart of " "Audacious.</span>" msgstr "" -"<span size=\"small\">Das Ändern dieser Einstellungen wird einen Neustart von " -"Audacious benötigen.</span>" +"<span size=\"small\">Das Ändern dieser Einstellungen benötigt einen Neustart " +"von Audacious.</span>" #: src/audacious/glade/prefswin.glade:3419 msgid "<b>Audio System</b>" @@ -1923,14 +1925,15 @@ msgid "" "<span size=\"small\">This is the amount of time to prebuffer audio streams " "by, in milliseconds.\n" -"Increase this value if you are experiencing audio skipping. \n" +"Increase this value if you are experiencing audio skipping.\n" "Please note however, that high values will result in Audacious performing " "poorly.</span>" msgstr "" "<span size=\"small\">Dies ist die Grösse des Puffers für Audio-Streams, " "angegeben in Millisekunden.\n" -"Erhöhen sie diesen Wert, wenn sie Unterbrüche im Ton haben.\n" -"Hohe Werte können dazu führen, dass Audacious langsamer läuft.</span>" +"Dieser Wert sollte erhöht werden, wenn Unterbrechungen im Ton festgestellt " +"werden.\n" +"Hohe Werte können jedoch dazu führen, dass Audacious langsamer läuft.</span>" #: src/audacious/glade/prefswin.glade:3571 msgid "Buffer size:" @@ -1938,11 +1941,11 @@ #: src/audacious/glade/prefswin.glade:3695 msgid "Output Plugin Preferences" -msgstr "Output-Plugin-Einstellungen" +msgstr "Ausgabe-Plugin-Einstellungen" #: src/audacious/glade/prefswin.glade:3770 msgid "Output Plugin Information" -msgstr "Output-Plugin-Information" +msgstr "Ausgabe-Plugin-Information" #: src/audacious/glade/prefswin.glade:3822 msgid "<b>Format Detection</b>" @@ -1955,7 +1958,7 @@ msgstr "" "Falls aktiviert, wird Audacious Dateiformate nur bei Bedarf ermitteln. Dies " "kann zu einer unordentlichen Wiedergabeliste führen, bringt gleichzeitig " -"aber eine Geschwindigkeitserhöhung." +"aber eine beträchtliche Geschwindigkeitserhöhung." #: src/audacious/glade/prefswin.glade:3863 msgid "Detect file formats on demand, instead of immediately." @@ -1967,13 +1970,13 @@ "slightly slower than detection on demand, but still provides a minimal level " "of format detection." msgstr "" -"Wenn aktiviert wird Audacious das Dateiformat anhand der Dateierweiterung " +"Falls aktiviert, wird Audacious das Dateiformat anhand der Dateierweiterung " "erkennen. Dies ist etwas langsamer als die Erkennung bei Bedarf, garantiert " "aber trotzdem einen minimalen Grad an Format-Erkennung." #: src/audacious/glade/prefswin.glade:3899 msgid "Detect file formats by extension." -msgstr "Dateiformat nach Dateiendung erkennen" +msgstr "Dateiformat an Dateiendung erkennen" #: src/audacious/glade/prefswin.glade:3933 msgid "<b>Playback</b>" @@ -1988,21 +1991,21 @@ #: src/audacious/glade/prefswin.glade:3974 msgid "Continue playback on startup" -msgstr "Wiedergabe beim Start fortführen" +msgstr "Wiedergabe am Start fortführen" #: src/audacious/glade/prefswin.glade:4008 msgid "When finished playing a song, don't automatically advance to the next." msgstr "" -"Nicht automatisch beim nächsten fortfahren, wenn ein Song zuende gespielt " -"worden ist." +"Nicht automatisch mit dem nächsten Titel fortfahren, wenn ein Titel zuende " +"gespielt wurde." #: src/audacious/glade/prefswin.glade:4010 msgid "Don't advance in the playlist" -msgstr "Nicht an die Wiedergabeliste anfügen" +msgstr "Nicht in der Wiedergabeliste weitergehen" #: src/audacious/glade/prefswin.glade:4045 msgid "Pause between songs" -msgstr "Zwischen Songs unterbrechen" +msgstr "Zwischen Titeln unterbrechen" #: src/audacious/glade/prefswin.glade:4083 msgid "Pause for" @@ -2030,9 +2033,10 @@ "This should be the max supported sampling rate of\n" "the sound card or output plugin.</span>" msgstr "" -"<span size=\"small\">Alle Streams werden in diese Abtastfrequenz umgewandelt.\n" +"<span size=\"small\">Alle Streams werden in diese Abtastfrequenz " +"umgewandelt.\n" "Sie sollte die maximal unterstützte Abtastfrequenz der\n" -"Soundkarte oder des Output-Plugins sein.</span>" +"Soundkarte oder des Ausgabe-Plugins sein.</span>" #: src/audacious/glade/prefswin.glade:4364 msgid "Converter Type:" @@ -2066,8 +2070,8 @@ "using commas." msgstr "" "Wenn Audacious das Titelbild sucht, sucht es nach bestimmten Worten im " -"Dateinamen. Diese können nachfolgend eingegeben werden, jeweils mit Kommas " -"getrennt." +"Dateinamen. Diese können nachfolgend eingegeben werden, jeweils durch " +"Beistriche getrennt." #: src/audacious/glade/prefswin.glade:4758 msgid "Include:"
--- a/src/audacious/playback.c Thu Jul 26 21:18:41 2007 -0700 +++ b/src/audacious/playback.c Sat Jul 28 12:28:40 2007 -0700 @@ -193,6 +193,9 @@ if (playback->plugin->stop) playback->plugin->stop(playback); + if (playback->thread != NULL) + g_thread_join(playback->thread); + free_vis_data(); ip_data.paused = FALSE; @@ -243,6 +246,7 @@ playback->plugin = entry->decoder; playback->output = &psuedo_output_plugin; playback->filename = g_strdup(entry->filename); + playback->thread = g_thread_self(); set_current_input_playback(playback); @@ -253,6 +257,8 @@ else if (playback->error) playback_error(); + playback->thread = NULL; + g_thread_exit(NULL); return NULL; }
--- a/src/audacious/plugin.h Thu Jul 26 21:18:41 2007 -0700 +++ b/src/audacious/plugin.h Sat Jul 28 12:28:40 2007 -0700 @@ -191,6 +191,8 @@ int playing; gboolean error; gboolean eof; + + GThread *thread; }; struct _InputPlugin {
--- a/src/audacious/ui_lastfm.c Thu Jul 26 21:18:41 2007 -0700 +++ b/src/audacious/ui_lastfm.c Sat Jul 28 12:28:40 2007 -0700 @@ -1,5 +1,376 @@ -#include <glib.h> +#include <gtk/gtk.h> +#include <glib/gi18n.h> +#include <gdk/gdkkeysyms.h> +#include "configdb.h" +#include "playback.h" +#define DEBUG 1 +typedef struct { + gchar *username, + *session; +}last_fm; + +typedef struct +{ + gchar *artist, + *title; +} +track_data; + +last_fm *login_data=NULL; +Playlist *current_playlist=NULL; +TitleInput *info = NULL; +GtkWidget *lastfm_url_entry, *lastfm_label,*artist_label,*title_label,*album_label, *gui_window=NULL; + +gpointer open_url(gpointer url) +{ + gchar*s=g_new0(gchar,20); + VFSFile* fd = vfs_fopen((gchar*)url,"r"); + if(fd) + { + vfs_fgets(s,20,fd); + g_print("Got data: '%s'\n",s); + vfs_fclose(fd); + } + g_free(s); + g_free(url); + return NULL; +} +void command(gchar *comm) +{ + /* get the session from mowgli*/ + if(login_data->session) + { + g_free(login_data->session); + login_data->session=NULL; + } + login_data->session = g_strdup(mowgli_global_storage_get("lastfm_session_id")); + gchar *url=g_strdup_printf("http://ws.audioscrobbler.com/radio/control.php?session=%s&command=%s&debug=0",login_data->session,comm); + g_thread_create(open_url,url,FALSE,NULL); + if(!g_str_has_prefix(comm,"love")) + g_thread_create((gpointer)playback_initiate,NULL,FALSE,NULL); + return; + +} +static void change_track_data_cb(gpointer track, gpointer unused) +{ + gchar **inf, + **t, + *alb, + *tr; + tr=g_strdup(((track_data*)track)->title); + + if(tr==NULL) + return ; + if(g_strrstr(tr,"last.fm")==NULL) + { + gtk_entry_set_text(GTK_ENTRY(lastfm_url_entry),"Not last.fm stream"); + return; + } + +#if DEBUG + g_print("New Track: %s \n",tr); +#endif + if(g_str_has_prefix(tr,"lastfm://")) + return; + if(g_strrstr(tr,"Neighbour")!=NULL) + { + gchar *temp=g_strdup_printf("lastfm://user/%s/neighbours", login_data->username); + gtk_entry_set_text(GTK_ENTRY(lastfm_url_entry),temp); + g_free(temp); + } + if(g_strrstr(tr,"Personal")!=NULL) + { + gchar *temp=g_strdup_printf("lastfm://user/%s/personal", login_data->username); + gtk_entry_set_text(GTK_ENTRY(lastfm_url_entry),temp); + g_free(temp); + } + + inf = g_strsplit(tr," - ",2); + if(inf[0]==NULL || inf[1]==NULL) + return; + gchar* artist_markup=g_strdup_printf("<b>Artist:</b> %s" ,inf[0]); + gtk_label_set_markup(GTK_LABEL(artist_label),artist_markup); + g_free(artist_markup); + + t = g_strsplit(inf[1], g_strrstr(inf[1],"("),2); + if(t[0]==NULL) return; + alb = g_strdup(mowgli_global_storage_get("lastfm_album")); + + gchar* title_markup=g_strdup_printf("<b>Title:</b> %s" ,t[0]); + gtk_label_set_markup( GTK_LABEL(title_label),title_markup); + g_free(title_markup); + + gchar* album_markup=g_strdup_printf("<b>Album:</b> %s" ,alb); + gtk_label_set_markup( GTK_LABEL(album_label),album_markup); + g_free(album_markup); + + g_strfreev(inf); + g_strfreev(t); + g_free(alb); + g_free(tr); + + return ; +} + +static void show_login_error_dialog(void) +{ + const gchar *markup = + N_("<b><big>Couldn't find your lastfm login data.</big></b>\n\n" + "Check if your Scrobbler's plugin login settings are configured properly.\n"); + + GtkWidget *dialog = + gtk_message_dialog_new_with_markup(NULL, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _(markup)); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + + + +void init_last_fm(void) +{ + login_data = g_new0(last_fm,1); + login_data->username = NULL; + login_data->session = NULL; + ConfigDb *cfg = NULL; + + if ((cfg = bmp_cfg_db_open()) != NULL) + { + login_data->username=NULL; + bmp_cfg_db_get_string(cfg, "audioscrobbler","username", + &login_data->username); + if(login_data->username==NULL) + show_login_error_dialog(); + g_free(cfg); + } + + current_playlist = g_new0(Playlist,1); + current_playlist = playlist_get_active(); + track_data * tr=g_new0(track_data,1); + tr->title =NULL; + hook_associate( "playlist set info" , change_track_data_cb ,tr); + +} + +/*event callback functions*/ + +gboolean love_press_callback(GtkWidget *love) +{ + command("love"); + return FALSE; +} + +gboolean skip_press_callback(GtkWidget *skip) +{ + command("skip"); + return FALSE; +} +gboolean ban_press_callback(GtkWidget *ban) +{ + command("ban"); + return FALSE; +} + + +gboolean add_press_callback(GtkWidget *love) +{ + gchar *text=NULL; + gint poz=0; + text = g_strdup(gtk_entry_get_text(GTK_ENTRY(lastfm_url_entry))); + if(playback_get_playing()==TRUE) + playback_stop(); + + poz = playlist_get_length(current_playlist); + playlist_add_url(current_playlist, text); + sleep(1); + playlist_set_position(current_playlist, poz); + playback_initiate(); + g_free(text); + return FALSE; +} + +gboolean neighbours_press_callback(GtkWidget *love) +{ + gchar *temp=g_strdup_printf("lastfm://user/%s/neighbours", login_data->username); + gtk_entry_set_text(GTK_ENTRY(lastfm_url_entry),temp); + g_free(temp); + return FALSE; +} + +gboolean personal_press_callback(GtkWidget *love) +{ + gchar *per=g_strdup_printf("lastfm://user/%s/personal", login_data->username); + gtk_entry_set_text(GTK_ENTRY(lastfm_url_entry),per); + g_free(per); + return FALSE; +} + +gboolean delete_window_callback(GtkWidget *window) +{ + gtk_widget_destroy(window); + window=NULL; + return FALSE; +} +static gboolean keypress_callback(GtkWidget * widget, GdkEventKey * event, gpointer data) +{ + switch (event->keyval) + { + case GDK_Escape: + gtk_widget_hide_all(widget); + break; + default: + return FALSE; + } + return TRUE; +} + + +GtkWidget *ui_lastfm_create(void) +{ + GtkWidget *window; + GtkWidget *box1,*box2,*vboxw,*vbox1,*vbox2,*v_hbox1,*v_hbox2,*labelbox; + GtkWidget *love,*ban,*skip,*add,*neighbours,*personal; + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER); + gtk_window_set_title(GTK_WINDOW(window), N_("Audacious last.fm radio tuner")); + lastfm_label = gtk_label_new_with_mnemonic(N_("Station:")); + title_label = gtk_label_new(NULL); + artist_label = gtk_label_new(NULL); + album_label = gtk_label_new(NULL); + lastfm_url_entry = gtk_entry_new(); + gtk_editable_set_editable (GTK_EDITABLE(lastfm_url_entry),TRUE); + gchar* artist_markup=g_strdup("<b>Artist:</b>"); + gtk_label_set_markup(GTK_LABEL(artist_label),artist_markup); + g_free(artist_markup); + + gchar* title_markup=g_strdup("<b>Title:</b>"); + gtk_label_set_markup( GTK_LABEL(title_label),title_markup); + g_free(title_markup); + + gchar* album_markup=g_strdup_printf("<b>Album:</b>"); + gtk_label_set_markup( GTK_LABEL(album_label),album_markup); + g_free(album_markup); + + love = gtk_button_new_with_label (N_("Love")); + ban = gtk_button_new_with_label (N_("Ban")); + skip = gtk_button_new_with_label (N_("Skip")); + add = gtk_button_new_with_label (N_("Tune in")); + + neighbours = gtk_button_new_with_label(N_("Neighbours' radio")); + personal = gtk_button_new_with_label(N_("Personal radio")); + + box1 = gtk_hbox_new(FALSE,1); + box2 = gtk_hbox_new(FALSE,1); + + vboxw = gtk_vbox_new(FALSE,1); + + vbox1 = gtk_vbox_new(FALSE,1); + vbox2 = gtk_vbox_new(FALSE,1); + + v_hbox1 = gtk_vbox_new(FALSE,1); + v_hbox2 = gtk_hbox_new(FALSE,1); + labelbox = gtk_vbox_new(FALSE,1); + + gtk_misc_set_alignment(GTK_MISC(artist_label),0,0); + gtk_misc_set_alignment(GTK_MISC(title_label),0,0); + gtk_misc_set_alignment(GTK_MISC(album_label),0,0); + + gtk_box_pack_start(GTK_BOX(vboxw),box1,FALSE,TRUE,1); + gtk_box_pack_end(GTK_BOX(vboxw),box2,TRUE,TRUE,1); + + gtk_box_pack_start(GTK_BOX(box1),lastfm_label,FALSE,TRUE,1); + gtk_box_pack_start(GTK_BOX(box1),lastfm_url_entry,TRUE,TRUE,1); + gtk_box_pack_start(GTK_BOX(box1),add,FALSE,TRUE,1); + + gtk_box_set_spacing(GTK_BOX(box1),2); + gtk_container_set_border_width(GTK_CONTAINER(box1),2); + + gtk_box_pack_start(GTK_BOX(box2),vbox1,FALSE,TRUE,1); + gtk_box_pack_start(GTK_BOX(box2),vbox2,TRUE,TRUE,1); + + gtk_box_pack_start(GTK_BOX(vbox1),neighbours,FALSE,TRUE,3); + gtk_box_pack_start(GTK_BOX(vbox1),personal,FALSE,TRUE,3); + gtk_box_set_spacing(GTK_BOX(vbox1),2); + gtk_container_set_border_width(GTK_CONTAINER(vbox1),2); + + gtk_box_pack_start(GTK_BOX(vbox2),v_hbox1,TRUE,TRUE,1); + gtk_box_pack_start(GTK_BOX(vbox2),v_hbox2,TRUE,TRUE,1); + + gtk_box_pack_start(GTK_BOX(v_hbox1),artist_label,TRUE,TRUE,1); + gtk_box_pack_start(GTK_BOX(v_hbox1),title_label,TRUE,TRUE,1); + gtk_box_pack_start(GTK_BOX(v_hbox1),album_label,TRUE,TRUE,1); + gtk_box_set_spacing(GTK_BOX(v_hbox1),2); + gtk_container_set_border_width(GTK_CONTAINER(v_hbox1),2); + + + gtk_box_pack_start(GTK_BOX(v_hbox2),love,TRUE,TRUE,1); + gtk_box_pack_start(GTK_BOX(v_hbox2),skip,TRUE,TRUE,1); + gtk_box_pack_start(GTK_BOX(v_hbox2),ban,TRUE,TRUE,1); + gtk_box_set_spacing(GTK_BOX(v_hbox1),2); + gtk_container_set_border_width(GTK_CONTAINER(v_hbox1),2); + + + + gtk_container_add (GTK_CONTAINER (window), vboxw); + + g_signal_connect (G_OBJECT (love), "button_press_event",G_CALLBACK (love_press_callback), NULL); + g_signal_connect (G_OBJECT (add), "button_press_event",G_CALLBACK (add_press_callback), NULL); + g_signal_connect (G_OBJECT (ban), "button_press_event",G_CALLBACK (ban_press_callback), NULL); + g_signal_connect (G_OBJECT (skip), "button_press_event",G_CALLBACK (skip_press_callback), NULL); + g_signal_connect (G_OBJECT (neighbours), "button_press_event",G_CALLBACK (neighbours_press_callback), NULL); + g_signal_connect (G_OBJECT (personal), "button_press_event",G_CALLBACK (personal_press_callback), NULL); + g_signal_connect (G_OBJECT (window), "delete_event",G_CALLBACK (gtk_widget_hide_all), window); + g_signal_connect (G_OBJECT (window), "key_press_event",G_CALLBACK(keypress_callback), NULL); + + gtk_widget_set_size_request(GTK_WIDGET(window),400,124); + gtk_window_set_resizable(GTK_WINDOW(window),FALSE); + gtk_widget_show_all(gui_window); + return window; +} +#if 0 +static void no_lastfm_plugin_dialog(void) +{ + const gchar *markup = + N_("<b><big>The lastfm radio plugin could not be found.</big></b>\n\n" + "Check if the AudioScrobbler plugin was compiled in\n"); + + GtkWidget *dialog = + gtk_message_dialog_new_with_markup(NULL, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, + _(markup)); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} +#endif + + void ui_lastfm(void) { -g_print("lastfm gui stub\n"); + /*if(!mowgli_global_storage_get("lastfm_loaded")) + { + no_lastfm_plugin_dialog(); + return; + } + */ + init_last_fm(); + if(!gui_window) + { + if((gui_window = ui_lastfm_create())!=NULL); + gtk_widget_show_all(gui_window); +#if 0 /*here should be set the artist, title and album labels at the first run, because it isn't captured by the hook*/ + gchar* current_title = playlist_get_songtitle(current_playlist,playlist_get_position(current_playlist)); + if(current_title) + change_track_data_cb(current_title,NULL); +#endif + } + else + gtk_widget_show_all(gui_window); + } +
--- a/src/audacious/ui_main.c Thu Jul 26 21:18:41 2007 -0700 +++ b/src/audacious/ui_main.c Sat Jul 28 12:28:40 2007 -0700 @@ -166,10 +166,7 @@ static gint mainwin_timeout_id; -G_LOCK_DEFINE_STATIC(mainwin_title); - static gboolean mainwin_force_redraw = FALSE; -static gchar *mainwin_title_text = NULL; static gboolean mainwin_info_text_locked = FALSE; static int ab_position_a = -1; @@ -633,10 +630,8 @@ void mainwin_set_song_title(const gchar * title) { - G_LOCK(mainwin_title); - g_free(mainwin_title_text); - mainwin_title_text = make_mainwin_title(title); - G_UNLOCK(mainwin_title); + gchar *mainwin_title_text = make_mainwin_title(title); + gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text); } static void @@ -888,10 +883,7 @@ return; /* clear title */ - G_LOCK(mainwin_title); - g_free(mainwin_title_text); - mainwin_title_text = NULL; - G_UNLOCK(mainwin_title); + mainwin_set_song_title(NULL); /* clear sampling parameters */ playback_set_sample_params(0, 0, 0); @@ -1138,6 +1130,8 @@ case GDK_KP_Insert: ui_jump_to_track(); break; + case GDK_Return: + case GDK_KP_Enter: case GDK_KP_5: mainwin_play_pushed(); break; @@ -2909,7 +2903,7 @@ gint length, t; gchar stime_prefix; - if (!playback_get_playing() || time < 0) + if (!playback_get_playing()) return FALSE; if (ab_position_a != -1 && ab_position_b != -1 && time > ab_position_b) @@ -2958,6 +2952,16 @@ g_free(time_str); } + if (length == -1) { + gtk_widget_hide(mainwin_position); + gtk_widget_hide(mainwin_sposition); + return TRUE; + } else { + gtk_widget_show(mainwin_position); + if (cfg.player_shaded) + gtk_widget_show(mainwin_sposition); + } + time /= 1000; length /= 1000; if (length > 0) { @@ -3003,16 +3007,6 @@ draw_equalizer_window(FALSE); draw_playlist_window(FALSE); - if (mainwin_title_text) { - G_LOCK(mainwin_title); - gtk_window_set_title(GTK_WINDOW(mainwin), mainwin_title_text); - g_free(mainwin_title_text); - mainwin_title_text = NULL; - G_UNLOCK(mainwin_title); - - playlistwin_update_list(playlist_get_active()); - } - /* tristate buttons seek */ if ( seek_state != MAINWIN_SEEK_NIL ) {
--- a/src/audacious/widgets/skin.c Thu Jul 26 21:18:41 2007 -0700 +++ b/src/audacious/widgets/skin.c Sat Jul 28 12:28:40 2007 -0700 @@ -1375,14 +1375,16 @@ filename = find_file_recursively(dirname, basename); - if (filename && cfg.custom_cursors) { + if (filename && cfg.custom_cursors) cursor_animated = gdk_pixbuf_animation_new_from_file(filename, &error); + + if (cursor_animated) { cursor_pixbuf = gdk_pixbuf_animation_get_static_image(cursor_animated); cursor_gdk = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), cursor_pixbuf, 0, 0); - } else { + } + else cursor_gdk = gdk_cursor_new(GDK_LEFT_PTR); - } gdk_window_set_cursor(mainwin->window, cursor_gdk); gdk_window_set_cursor(playlistwin->window, cursor_gdk);