Mercurial > audlegacy-plugins
changeset 1320:bd98b757e264
Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author | William Pitcock <nenolod@atheme-project.org> |
---|---|
date | Fri, 20 Jul 2007 23:37:53 -0500 |
parents | a0320227c751 (current diff) a9a97179a1f9 (diff) |
children | f0b81aeed25f 285d54073f12 |
files | |
diffstat | 9 files changed, 133 insertions(+), 120 deletions(-) [+] |
line wrap: on
line diff
--- a/src/amidi-plug/i_utils.c Fri Jul 20 23:37:48 2007 -0500 +++ b/src/amidi-plug/i_utils.c Fri Jul 20 23:37:53 2007 -0500 @@ -33,6 +33,7 @@ GtkWidget *hseparator , *hbuttonbox , *button_ok; GtkTextBuffer *info_textbuffer; GdkPixbuf *logo_pixbuf; + gchar *info_textbuffer_content = NULL; if ( aboutwin != NULL ) return; @@ -64,22 +65,22 @@ gtk_text_view_set_justification( GTK_TEXT_VIEW(info_textview) , GTK_JUSTIFY_LEFT ); gtk_text_view_set_left_margin( GTK_TEXT_VIEW(info_textview) , 10 ); - gtk_text_buffer_set_text( info_textbuffer , - "\nAMIDI-Plug " AMIDIPLUG_VERSION - "\nmodular MIDI music player\n" - "http://www.develia.org/projects.php?p=amidiplug\n\n" - "written by Giacomo Lozito\n" - "< james@develia.org >\n\n\n" - "special thanks to...\n\n" - "Clemens Ladisch and Jaroslav Kysela\n" - "for their cool programs aplaymidi and amixer; those\n" - "were really useful, along with alsa-lib docs, in order\n" - "to learn more about the ALSA API\n\n" - "Alfredo Spadafina\n" - "for the nice midi keyboard logo\n\n" - "Tony Vroon\n" - "for the good help with alpha testing\n\n" - , -1 ); + info_textbuffer_content = g_strjoin( NULL , "\nAMIDI-Plug " , AMIDIPLUG_VERSION , + _("\nmodular MIDI music player\n" + "http://www.develia.org/projects.php?p=amidiplug\n\n" + "written by Giacomo Lozito\n") , + "< james@develia.org >\n\n\n" , + _("special thanks to...\n\n" + "Clemens Ladisch and Jaroslav Kysela\n" + "for their cool programs aplaymidi and amixer; those\n" + "were really useful, along with alsa-lib docs, in order\n" + "to learn more about the ALSA API\n\n" + "Alfredo Spadafina\n" + "for the nice midi keyboard logo\n\n" + "Tony Vroon\n" + "for the good help with alpha testing\n\n") , NULL ); + gtk_text_buffer_set_text( info_textbuffer , info_textbuffer_content , -1 ); + g_free( info_textbuffer_content ); info_scrolledwin = gtk_scrolled_window_new( NULL , NULL ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(info_scrolledwin) ,
--- a/src/aosd/aosd_ui.c Fri Jul 20 23:37:48 2007 -0500 +++ b/src/aosd/aosd_ui.c Fri Jul 20 23:37:53 2007 -0500 @@ -1096,6 +1096,7 @@ GtkWidget *bbar_bbox, *bbar_bt_ok; GtkTextBuffer *info_tb; GdkGeometry abount_win_hints; + gchar *info_tb_content = NULL; if ( about_win != NULL ) { @@ -1136,14 +1137,15 @@ gtk_text_view_set_justification( GTK_TEXT_VIEW(info_tv) , GTK_JUSTIFY_LEFT ); gtk_text_view_set_left_margin( GTK_TEXT_VIEW(info_tv) , 10 ); - gtk_text_buffer_set_text( info_tb , - _("\nAudacious OSD " AOSD_VERSION_PLUGIN - "\nhttp://www.develia.org/projects.php?p=aosd\n" - "written by Giacomo Lozito\n" - "< james@develia.org >\n\n" - "On-Screen-Display is based on Ghosd library\n" - "written by Evan Martin\n" - "http://neugierig.org/software/ghosd/\n\n") , -1 ); + info_tb_content = g_strjoin( NULL , "\nAudacious OSD " , AOSD_VERSION_PLUGIN , + _("\nhttp://www.develia.org/projects.php?p=audacious#aosd\n" + "written by Giacomo Lozito\n") , + "< james@develia.org >\n\n" , + _("On-Screen-Display is based on Ghosd library\n" + "written by Evan Martin\n" + "http://neugierig.org/software/ghosd/\n\n") , NULL ); + gtk_text_buffer_set_text( info_tb , info_tb_content , -1 ); + g_free( info_tb_content ); info_tv_sw = gtk_scrolled_window_new( NULL , NULL ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(info_tv_sw) ,
--- a/src/arts/arts.c Fri Jul 20 23:37:48 2007 -0500 +++ b/src/arts/arts.c Fri Jul 20 23:37:53 2007 -0500 @@ -15,15 +15,15 @@ static void about(void) { static GtkWidget *dialog; - + if (dialog) return; - dialog = xmms_show_message("About aRts Output", - "aRts output plugin by " + dialog = xmms_show_message(_("About aRts Output"), + _("aRts output plugin by " "H\303\245vard Kv\303\245len <havardk@xmms.org>\n" - "Audacious port by Giacomo Lozito from develia.org", - "Ok", FALSE, NULL, NULL); + "Audacious port by Giacomo Lozito from develia.org"), + _("Ok"), FALSE, NULL, NULL); gtk_signal_connect(GTK_OBJECT(dialog), "destroy", GTK_SIGNAL_FUNC(gtk_widget_destroyed), &dialog);
--- a/src/arts/arts.h Fri Jul 20 23:37:48 2007 -0500 +++ b/src/arts/arts.h Fri Jul 20 23:37:53 2007 -0500 @@ -26,6 +26,8 @@ #include "audacious/plugin.h" #include "audacious/configdb.h" +#include <audacious/i18n.h> +# include "config.h" struct arts_config {
--- a/src/arts/configure.c Fri Jul 20 23:37:48 2007 -0500 +++ b/src/arts/configure.c Fri Jul 20 23:37:53 2007 -0500 @@ -10,7 +10,6 @@ */ #include "arts.h" -#define _(string) (string) #include <gtk/gtk.h> @@ -23,7 +22,7 @@ artsxmms_cfg.buffer_size = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(buffer_size_spin)); - + db = bmp_cfg_db_open(); bmp_cfg_db_set_int(db, "arts", "buffer_size", artsxmms_cfg.buffer_size); bmp_cfg_db_close(db); @@ -43,7 +42,7 @@ if (configure_win) return; - + configure_win = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_type_hint( GTK_WINDOW(configure_win), GDK_WINDOW_TYPE_HINT_DIALOG ); gtk_signal_connect(GTK_OBJECT(configure_win), "destroy", @@ -52,23 +51,23 @@ gtk_window_set_policy(GTK_WINDOW(configure_win), FALSE, FALSE, FALSE); gtk_window_set_position(GTK_WINDOW(configure_win), GTK_WIN_POS_MOUSE); gtk_container_border_width(GTK_CONTAINER(configure_win), 10); - + vbox = gtk_vbox_new(FALSE, 10); gtk_container_add(GTK_CONTAINER(configure_win), vbox); - + notebook = gtk_notebook_new(); gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0); - + buffer_frame = gtk_frame_new(_("Buffering:")); gtk_container_set_border_width(GTK_CONTAINER(buffer_frame), 5); - + buffer_vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(buffer_frame), buffer_vbox); - + buffer_table = gtk_table_new(2, 1, TRUE); gtk_container_set_border_width(GTK_CONTAINER(buffer_table), 5); gtk_box_pack_start(GTK_BOX(buffer_vbox), buffer_table, FALSE, FALSE, 0); - + buffer_size_box = gtk_hbox_new(FALSE, 5); gtk_table_attach_defaults(GTK_TABLE(buffer_table), buffer_size_box, 0, 1, 0, 1); buffer_size_label = gtk_label_new(_("Buffer size (ms):")); @@ -79,15 +78,15 @@ buffer_size_spin = gtk_spin_button_new(GTK_ADJUSTMENT(buffer_size_adj), 8, 0); gtk_widget_set_usize(buffer_size_spin, 60, -1); gtk_box_pack_start(GTK_BOX(buffer_size_box), buffer_size_spin, FALSE, FALSE, 0); - + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), buffer_frame, gtk_label_new(_("Buffering"))); - + bbox = gtk_hbutton_box_new(); gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0); gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END); gtk_button_box_set_spacing(GTK_BUTTON_BOX(bbox), 5); - + ok = gtk_button_new_with_label(_("Ok")); cancel = gtk_button_new_with_label(_("Cancel")); GTK_WIDGET_SET_FLAGS(ok, GTK_CAN_DEFAULT); @@ -100,6 +99,6 @@ gtk_box_pack_start(GTK_BOX(bbox), ok, TRUE, TRUE, 0); gtk_widget_grab_default(ok); gtk_box_pack_start(GTK_BOX(bbox), cancel, TRUE, TRUE, 0); - + gtk_widget_show_all(configure_win); }
--- a/src/evdev-plug/ed_ui.c Fri Jul 20 23:37:48 2007 -0500 +++ b/src/evdev-plug/ed_ui.c Fri Jul 20 23:37:53 2007 -0500 @@ -1445,6 +1445,7 @@ GtkWidget *bbar_bbox, *bbar_bt_ok; GtkTextBuffer *info_tb; GdkGeometry abount_win_hints; + gchar *info_tb_content = NULL; if ( about_win != NULL ) { @@ -1485,12 +1486,13 @@ gtk_text_view_set_justification( GTK_TEXT_VIEW(info_tv) , GTK_JUSTIFY_LEFT ); gtk_text_view_set_left_margin( GTK_TEXT_VIEW(info_tv) , 10 ); - gtk_text_buffer_set_text( info_tb , - _("\nEvDev-Plug " ED_VERSION_PLUGIN - "\nplayer remote control via event devices\n" - "http://www.develia.org/projects.php?p=evdevplug\n\n" - "written by Giacomo Lozito\n" - "< james@develia.org >\n\n") , -1 ); + info_tb_content = g_strjoin( NULL , "\nEvDev-Plug " , ED_VERSION_PLUGIN , + _("\nplayer remote control via event devices\n" + "http://www.develia.org/projects.php?p=audacious#evdevplug\n\n" + "written by Giacomo Lozito\n") , + "< james@develia.org >\n\n" , NULL ); + gtk_text_buffer_set_text( info_tb , info_tb_content , -1 ); + g_free( info_tb_content ); info_tv_sw = gtk_scrolled_window_new( NULL , NULL ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(info_tv_sw) ,
--- a/src/flacng/flacng.h Fri Jul 20 23:37:48 2007 -0500 +++ b/src/flacng/flacng.h Fri Jul 20 23:37:53 2007 -0500 @@ -22,6 +22,8 @@ #include <glib.h> #include <audacious/plugin.h> #include <audacious/vfs.h> +#include <audacious/i18n.h> +# include "config.h" #define OUTPUT_BLOCK_SIZE (8192u) #define MAX_SUPPORTED_CHANNELS (2u)
--- a/src/flacng/plugin.c Fri Jul 20 23:37:48 2007 -0500 +++ b/src/flacng/plugin.c Fri Jul 20 23:37:53 2007 -0500 @@ -413,7 +413,7 @@ main_info->stream.samplerate, stream_info.samplerate); break; } - + if (stream_info.channels != main_info->stream.channels) { _ERROR("Number of channels changed midstream (now: %d, was: %d). This is not supported yet.", main_info->stream.channels, stream_info.channels); @@ -508,7 +508,7 @@ /* * Yes. Drain the output buffer and stop playing. */ - + _DEBUG("End of stream reached, draining output buffer"); while((-1 == seek_to) && flac_ip.output->buffer_playing() && playback->playing == TRUE) { @@ -540,7 +540,7 @@ * Release the play loop mutex */ g_mutex_unlock(flac_pl_mutex); - + g_thread_exit(NULL); _LEAVE NULL; @@ -739,18 +739,22 @@ void flac_aboutbox(void) { static GtkWidget* about_window; + gchar *about_text; if (about_window) { gdk_window_raise(about_window->window); } + about_text = g_strjoin("", _("FLAC Audio Plugin "), _VERSION, + _("\n\nOriginal code by\n" + "Ralf Ertzinger <ralf@skytale.net>\n" + "\n" + "http://www.skytale.net/projects/bmp-flac2/"), NULL); + about_window = xmms_show_message(_("About FLAC Audio Plugin"), - ("FLAC Audio Plugin (" _VERSION ")\n\n" - "Original code by\n" - "Ralf Ertzinger <ralf@skytale.net>\n" - "\n" - "http://www.skytale.net/projects/bmp-flac2/"), + about_text, _("OK"), FALSE, NULL, NULL); + g_signal_connect(G_OBJECT(about_window), "destroy", G_CALLBACK(gtk_widget_destroyed), &about_window); }
--- a/src/pulse_audio/pulse_audio.c Fri Jul 20 23:37:48 2007 -0500 +++ b/src/pulse_audio/pulse_audio.c Fri Jul 20 23:37:53 2007 -0500 @@ -1,16 +1,16 @@ /*** This file is part of xmms-pulse. - + xmms-pulse is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + xmms-pulse is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with xmms-pulse; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 @@ -32,6 +32,7 @@ #include <audacious/plugin.h> #include <audacious/playlist.h> #include <audacious/util.h> +#include <audacious/i18n.h> #include <pulse/pulseaudio.h> @@ -81,7 +82,7 @@ snprintf(t, sizeof(t), "%s", u = pa_locale_to_utf8(str)); pa_xfree(u); - + return t; } @@ -97,7 +98,7 @@ static void subscribe_cb(struct pa_context *c, enum pa_subscription_event_type t, uint32_t index, void *userdata) { pa_operation *o; - + assert(c); if (!stream || @@ -110,7 +111,7 @@ g_warning("pa_context_get_sink_input_info() failed: %s", pa_strerror(pa_context_errno(c))); return; } - + pa_operation_unref(o); } @@ -154,7 +155,7 @@ if (userdata) *(int*) userdata = success; - + pa_threaded_mainloop_signal(mainloop, 0); } @@ -163,7 +164,7 @@ if (userdata) *(int*) userdata = success; - + pa_threaded_mainloop_signal(mainloop, 0); } @@ -188,7 +189,7 @@ if (connected) { pa_threaded_mainloop_lock(mainloop); CHECK_DEAD_GOTO(fail, 1); - + v = volume; b = volume_valid; @@ -198,7 +199,7 @@ v = volume; b = volume_valid; } - + if (b) { if (v.channels == 2) { *l = (int) ((v.values[0]*100)/PA_VOLUME_NORM); @@ -210,8 +211,8 @@ static void volume_time_cb(pa_mainloop_api *api, pa_time_event *e, const struct timeval *tv, void *userdata) { pa_operation *o; - - if (!(o = pa_context_set_sink_input_volume(context, pa_stream_get_index(stream), &volume, NULL, NULL))) + + if (!(o = pa_context_set_sink_input_volume(context, pa_stream_get_index(stream), &volume, NULL, NULL))) g_warning("pa_context_set_sink_input_volume() failed: %s", pa_strerror(pa_context_errno(context))); else pa_operation_unref(o); @@ -264,7 +265,7 @@ g_warning("pa_stream_cork() failed: %s", pa_strerror(pa_context_errno(context))); goto fail; } - + while (pa_operation_get_state(o) != PA_OPERATION_DONE) { CHECK_DEAD_GOTO(fail, 1); pa_threaded_mainloop_wait(mainloop); @@ -272,12 +273,12 @@ if (!success) g_warning("pa_stream_cork() failed: %s", pa_strerror(pa_context_errno(context))); - + fail: if (o) pa_operation_unref(o); - + pa_threaded_mainloop_unlock(mainloop); } @@ -300,25 +301,25 @@ * between this means we should trigger the playback */ if (do_trigger) { int success = 0; - + if (!(o = pa_stream_trigger(stream, stream_success_cb, &success))) { g_warning("pa_stream_trigger() failed: %s", pa_strerror(pa_context_errno(context))); goto fail; } - + while (pa_operation_get_state(o) != PA_OPERATION_DONE) { CHECK_DEAD_GOTO(fail, 1); pa_threaded_mainloop_wait(mainloop); } - + if (!success) g_warning("pa_stream_trigger() failed: %s", pa_strerror(pa_context_errno(context))); } - + fail: if (o) pa_operation_unref(o); - + pa_threaded_mainloop_unlock(mainloop); do_trigger = !!l; @@ -327,12 +328,12 @@ static int pulse_get_written_time(void) { int r = 0; - + CHECK_CONNECTED(0); pa_threaded_mainloop_lock(mainloop); CHECK_DEAD_GOTO(fail, 1); - + r = (int) (((double) written*1000) / pa_bytes_per_second(pa_stream_get_sample_spec(stream))); fail: @@ -344,14 +345,14 @@ static int pulse_get_output_time(void) { int r = 0; pa_usec_t t; - + CHECK_CONNECTED(0); pa_threaded_mainloop_lock(mainloop); for (;;) { CHECK_DEAD_GOTO(fail, 1); - + if (pa_stream_get_time(stream, &t) >= 0) break; @@ -368,13 +369,13 @@ if (just_flushed) { time_offset_msec -= r; just_flushed = 0; - } + } r += time_offset_msec; fail: pa_threaded_mainloop_unlock(mainloop); - + return r; } @@ -383,7 +384,7 @@ const pa_timing_info *i; CHECK_CONNECTED(0); - + pa_threaded_mainloop_lock(mainloop); for (;;) { @@ -391,7 +392,7 @@ if ((i = pa_stream_get_timing_info(stream))) break; - + if (pa_context_errno(context) != PA_ERR_NODATA) { g_warning("pa_stream_get_timing_info() failed: %s", pa_strerror(pa_context_errno(context))); goto fail; @@ -421,7 +422,7 @@ g_warning("pa_stream_flush() failed: %s", pa_strerror(pa_context_errno(context))); goto fail; } - + while (pa_operation_get_state(o) != PA_OPERATION_DONE) { CHECK_DEAD_GOTO(fail, 1); pa_threaded_mainloop_wait(mainloop); @@ -429,15 +430,15 @@ if (!success) g_warning("pa_stream_flush() failed: %s", pa_strerror(pa_context_errno(context))); - + written = (uint64_t) (((double) time * pa_bytes_per_second(pa_stream_get_sample_spec(stream))) / 1000); just_flushed = 1; time_offset_msec = time; - + fail: if (o) pa_operation_unref(o); - + pa_threaded_mainloop_unlock(mainloop); } @@ -452,12 +453,12 @@ g_warning("pa_stream_write() failed: %s", pa_strerror(pa_context_errno(context))); goto fail; } - + do_trigger = 0; written += length; fail: - + pa_threaded_mainloop_unlock(mainloop); } @@ -474,7 +475,7 @@ g_warning("pa_stream_drain() failed: %s", pa_strerror(pa_context_errno(context))); goto fail; } - + while (pa_operation_get_state(o) != PA_OPERATION_DONE) { CHECK_DEAD_GOTO(fail, 1); pa_threaded_mainloop_wait(mainloop); @@ -482,11 +483,11 @@ if (!success) g_warning("pa_stream_drain() failed: %s", pa_strerror(pa_context_errno(context))); - + fail: if (o) pa_operation_unref(o); - + pa_threaded_mainloop_unlock(mainloop); } @@ -510,7 +511,7 @@ pa_context_unref(context); context = NULL; } - + if (mainloop) { pa_threaded_mainloop_free(mainloop); mainloop = NULL; @@ -528,7 +529,7 @@ g_assert(!context); g_assert(!stream); g_assert(!connected); - + if (fmt == FMT_U8) ss.format = PA_SAMPLE_U8; else if (fmt == FMT_S16_LE) @@ -558,7 +559,7 @@ } pa_threaded_mainloop_lock(mainloop); - + if (!(context = pa_context_new(pa_threaded_mainloop_get_api(mainloop), "Audacious"))) { g_warning("Failed to allocate context"); goto unlock_and_fail; @@ -612,7 +613,7 @@ g_warning("pa_context_subscribe() failed: %s", pa_strerror(pa_context_errno(context))); goto unlock_and_fail; } - + success = 0; while (pa_operation_get_state(o) != PA_OPERATION_DONE) { CHECK_DEAD_GOTO(fail, 1); @@ -631,7 +632,7 @@ g_warning("pa_context_get_sink_input_info() failed: %s", pa_strerror(pa_context_errno(context))); goto unlock_and_fail; } - + while (pa_operation_get_state(o) != PA_OPERATION_DONE) { CHECK_DEAD_GOTO(fail, 1); pa_threaded_mainloop_wait(mainloop); @@ -648,34 +649,34 @@ just_flushed = 0; connected = 1; volume_time_event = NULL; - + pa_threaded_mainloop_unlock(mainloop); - + return TRUE; unlock_and_fail: if (o) pa_operation_unref(o); - + pa_threaded_mainloop_unlock(mainloop); - + fail: pulse_close(); - + return FALSE; } static void pulse_about(void) { static GtkWidget *dialog; - + if (dialog != NULL) return; - + dialog = xmms_show_message( - "About Audacious PulseAudio Output Plugin", - "Audacious PulseAudio Output Plugin\n\n " + _("About Audacious PulseAudio Output Plugin"), + _("Audacious PulseAudio Output Plugin\n\n " "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" "the Free Software Foundation; either version 2 of the License, or\n" @@ -689,12 +690,12 @@ "You should have received a copy of the GNU General Public License\n" "along with this program; if not, write to the Free Software\n" "Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,\n" - "USA.", - "OK", + "USA."), + _("OK"), FALSE, NULL, NULL); - + gtk_signal_connect( GTK_OBJECT(dialog), "destroy", @@ -707,21 +708,21 @@ NULL, "PulseAudio Output Plugin", NULL, - NULL, + NULL, pulse_about, NULL, pulse_get_volume, pulse_set_volume, - pulse_open, - pulse_write, - pulse_close, - pulse_flush, - pulse_pause, - pulse_free, - pulse_playing, - pulse_get_output_time, + pulse_open, + pulse_write, + pulse_close, + pulse_flush, + pulse_pause, + pulse_free, + pulse_playing, + pulse_get_output_time, pulse_get_written_time, - NULL, + NULL, }; OutputPlugin *pulse_oplist[] = { &pulse_op, NULL };