From c019877a9ec63189dbe24be345af2c9674005b65 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 5 Aug 2008 20:45:24 +0200 Subject: [PATCH 1/4] internationalize pavucontrol.cc --- src/Makefile.am | 4 +- src/i18n.h | 51 +++++++++++++++++++++ src/pavucontrol.cc | 111 ++++++++++++++++++++++++--------------------- 3 files changed, 113 insertions(+), 53 deletions(-) create mode 100644 src/i18n.h diff --git a/src/Makefile.am b/src/Makefile.am index c79c17f..a990de3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,10 +24,10 @@ glade_DATA=pavucontrol.glade desktop_in_files=pavucontrol.desktop.in desktop_DATA=$(desktop_in_files:.desktop.in=.desktop) -pavucontrol_SOURCES=pavucontrol.cc +pavucontrol_SOURCES=pavucontrol.cc i18n.h pavucontrol_LDADD=$(AM_LDADD) $(GUILIBS_LIBS) $(PULSE_LIBS) -pavucontrol_CXXFLAGS=$(AM_CXXFLAGS) $(GUILIBS_CFLAGS) $(PULSE_CFLAGS) +pavucontrol_CXXFLAGS=$(AM_CXXFLAGS) $(GUILIBS_CFLAGS) $(PULSE_CFLAGS) -DLOCALEDIR=\"$(localedir)\" pavucontrol_CXXFLAGS+=-DGLADE_FILE=\"$(gladedir)/pavucontrol.glade\" #pavucontrol_CXXFLAGS+=-DGLADE_FILE=\"pavucontrol.glade\" diff --git a/src/i18n.h b/src/i18n.h new file mode 100644 index 0000000..f170b17 --- /dev/null +++ b/src/i18n.h @@ -0,0 +1,51 @@ +#ifndef fooi18nhfoo +#define fooi18nhfoo + +/*** + This file is part of pavucontrol. + + Copyright 2006-2008 Lennart Poettering + + pavucontrol 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. + + pavucontrol 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 pavucontrol. If not, see . +***/ + +#if !defined(GETTEXT_PACKAGE) +#error "Something is very wrong here, config.h needs to be included first" +#endif + +#ifdef ENABLE_NLS + +#include + +#define _(String) dgettext(GETTEXT_PACKAGE, String) +#ifdef gettext_noop +#define N_(String) gettext_noop(String) +#else +#define N_(String) (String) +#endif + +#else /* NLS is disabled */ + +#define _(String) (String) +#define N_(String) (String) +#define textdomain(String) (String) +#define gettext(String) (String) +#define dgettext(Domain,String) (String) +#define dcgettext(Domain,String,Type) (String) +#define bindtextdomain(Domain,Directory) (Domain) +#define bind_textdomain_codeset(Domain,Codeset) (Codeset) + +#endif /* ENABLE_NLS */ + +#endif diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc index 08b3877..8b67e58 100644 --- a/src/pavucontrol.cc +++ b/src/pavucontrol.cc @@ -27,11 +27,14 @@ #include #include +#include #include #include #include +#include "i18n.h" + #ifndef GLADE_FILE #define GLADE_FILE "pavucontrol.glade" #endif @@ -600,7 +603,7 @@ void SinkWidget::executeVolumeUpdate() { pa_operation* o; if (!(o = pa_context_set_sink_volume_by_index(context, index, &volume, NULL, NULL))) { - show_error("pa_context_set_sink_volume_by_index() failed"); + show_error(_("pa_context_set_sink_volume_by_index() failed")); return; } @@ -615,7 +618,7 @@ void SinkWidget::onMuteToggleButton() { pa_operation* o; if (!(o = pa_context_set_sink_mute_by_index(context, index, muteToggleButton->get_active(), NULL, NULL))) { - show_error("pa_context_set_sink_mute_by_index() failed"); + show_error(_("pa_context_set_sink_mute_by_index() failed")); return; } @@ -629,7 +632,7 @@ void SinkWidget::onDefaultToggle() { return; if (!(o = pa_context_set_default_sink(context, name.c_str(), NULL, NULL))) { - show_error("pa_context_set_default_sink() failed"); + show_error(_("pa_context_set_default_sink() failed")); return; } pa_operation_unref(o); @@ -637,7 +640,7 @@ void SinkWidget::onDefaultToggle() { SourceWidget::SourceWidget(BaseObjectType* cobject, const Glib::RefPtr& x) : StreamWidget(cobject, x), - defaultMenuItem("_Default", true){ + defaultMenuItem(_("_Default"), true){ add_events(Gdk::BUTTON_PRESS_MASK); @@ -658,7 +661,7 @@ void SourceWidget::executeVolumeUpdate() { pa_operation* o; if (!(o = pa_context_set_source_volume_by_index(context, index, &volume, NULL, NULL))) { - show_error("pa_context_set_source_volume_by_index() failed"); + show_error(_("pa_context_set_source_volume_by_index() failed")); return; } @@ -673,7 +676,7 @@ void SourceWidget::onMuteToggleButton() { pa_operation* o; if (!(o = pa_context_set_source_mute_by_index(context, index, muteToggleButton->get_active(), NULL, NULL))) { - show_error("pa_context_set_source_mute_by_index() failed"); + show_error(_("pa_context_set_source_mute_by_index() failed")); return; } @@ -687,7 +690,7 @@ void SourceWidget::onDefaultToggle() { return; if (!(o = pa_context_set_default_source(context, name.c_str(), NULL, NULL))) { - show_error("pa_context_set_default_source() failed"); + show_error(_("pa_context_set_default_source() failed")); return; } pa_operation_unref(o); @@ -696,8 +699,8 @@ void SourceWidget::onDefaultToggle() { SinkInputWidget::SinkInputWidget(BaseObjectType* cobject, const Glib::RefPtr& x) : StreamWidget(cobject, x), mainWindow(NULL), - titleMenuItem("_Move Stream...", true), - killMenuItem("_Terminate Stream", true) { + titleMenuItem(_("_Move Stream..."), true), + killMenuItem(_("_Terminate Stream"), true) { add_events(Gdk::BUTTON_PRESS_MASK); @@ -723,7 +726,7 @@ void SinkInputWidget::executeVolumeUpdate() { pa_operation* o; if (!(o = pa_context_set_sink_input_volume(context, index, &volume, NULL, NULL))) { - show_error("pa_context_set_sink_input_volume() failed"); + show_error(_("pa_context_set_sink_input_volume() failed")); return; } @@ -738,7 +741,7 @@ void SinkInputWidget::onMuteToggleButton() { pa_operation* o; if (!(o = pa_context_set_sink_input_mute(context, index, muteToggleButton->get_active(), NULL, NULL))) { - show_error("pa_context_set_sink_input_mute() failed"); + show_error(_("pa_context_set_sink_input_mute() failed")); return; } @@ -772,7 +775,7 @@ void SinkInputWidget::buildMenu() { void SinkInputWidget::onKill() { pa_operation* o; if (!(o = pa_context_kill_sink_input(context, index, NULL, NULL))) { - show_error("pa_context_kill_sink_input() failed"); + show_error(_("pa_context_kill_sink_input() failed")); return; } @@ -789,7 +792,7 @@ void SinkInputWidget::SinkMenuItem::onToggle() { pa_operation* o; if (!(o = pa_context_move_sink_input_by_index(context, widget->index, index, NULL, NULL))) { - show_error("pa_context_move_sink_input_by_index() failed"); + show_error(_("pa_context_move_sink_input_by_index() failed")); return; } @@ -799,8 +802,8 @@ void SinkInputWidget::SinkMenuItem::onToggle() { SourceOutputWidget::SourceOutputWidget(BaseObjectType* cobject, const Glib::RefPtr& x) : MinimalStreamWidget(cobject, x), mainWindow(NULL), - titleMenuItem("_Move Stream...", true), - killMenuItem("_Terminate Stream", true) { + titleMenuItem(_("_Move Stream..."), true), + killMenuItem(_("_Terminate Stream"), true) { add_events(Gdk::BUTTON_PRESS_MASK); @@ -825,7 +828,7 @@ SourceOutputWidget* SourceOutputWidget::create() { void SourceOutputWidget::onKill() { pa_operation* o; if (!(o = pa_context_kill_source_output(context, index, NULL, NULL))) { - show_error("pa_context_kill_source_output() failed"); + show_error(_("pa_context_kill_source_output() failed")); return; } @@ -866,7 +869,7 @@ void SourceOutputWidget::SourceMenuItem::onToggle() { pa_operation* o; if (!(o = pa_context_move_source_output_by_index(context, widget->index, index, NULL, NULL))) { - show_error("pa_context_move_source_output_by_index() failed"); + show_error(_("pa_context_move_source_output_by_index() failed")); return; } @@ -908,7 +911,7 @@ void RoleWidget::executeVolumeUpdate() { pa_operation* o; if (!(o = pa_ext_stream_restore_write(context, PA_UPDATE_REPLACE, &info, 1, TRUE, NULL, NULL))) { - show_error("pa_ext_stream_restore_write() failed"); + show_error(_("pa_ext_stream_restore_write() failed")); return; } @@ -1029,7 +1032,7 @@ static void read_callback(pa_stream *s, size_t length, void *userdata) { double v; if (pa_stream_peek(s, &data, &length) < 0) { - show_error("Failed to read data from stream"); + show_error(_("Failed to read data from stream")); return; } @@ -1063,8 +1066,8 @@ void MainWindow::createMonitorStreamForSource(uint32_t source_idx) { snprintf(t, sizeof(t), "%u", source_idx); - if (!(s = pa_stream_new(context, "Peak detect", &ss, NULL))) { - show_error("Failed to create monitoring stream"); + if (!(s = pa_stream_new(context, _("Peak detect"), &ss, NULL))) { + show_error(_("Failed to create monitoring stream")); return; } @@ -1072,7 +1075,7 @@ void MainWindow::createMonitorStreamForSource(uint32_t source_idx) { pa_stream_set_suspended_callback(s, suspended_callback, this); if (pa_stream_connect_record(s, t, &attr, (pa_stream_flags_t) (PA_STREAM_DONT_MOVE|PA_STREAM_PEAK_DETECT|PA_STREAM_ADJUST_LATENCY)) < 0) { - show_error("Failed to connect monitoring stream"); + show_error(_("Failed to connect monitoring stream")); pa_stream_unref(s); return; } @@ -1099,8 +1102,8 @@ void MainWindow::createMonitorStreamForSinkInput(uint32_t sink_input_idx, uint32 snprintf(t, sizeof(t), "%u", monitor_source_idx); - if (!(s = pa_stream_new(context, "Peak detect", &ss, NULL))) { - show_error("Failed to create monitoring stream"); + if (!(s = pa_stream_new(context, _("Peak detect"), &ss, NULL))) { + show_error(_("Failed to create monitoring stream")); return; } @@ -1109,7 +1112,7 @@ void MainWindow::createMonitorStreamForSinkInput(uint32_t sink_input_idx, uint32 pa_stream_set_suspended_callback(s, suspended_callback, this); if (pa_stream_connect_record(s, t, &attr, (pa_stream_flags_t) (PA_STREAM_DONT_MOVE|PA_STREAM_PEAK_DETECT|PA_STREAM_ADJUST_LATENCY)) < 0) { - show_error("Failed to connect monitoring stream"); + show_error(_("Failed to connect monitoring stream")); pa_stream_unref(s); return; } @@ -1349,7 +1352,7 @@ bool MainWindow::createEventRoleWidget() { eventRoleWidget->setChannelMap(cm, true); eventRoleWidget->boldNameLabel->set_text(""); - eventRoleWidget->nameLabel->set_label("System Sounds"); + eventRoleWidget->nameLabel->set_label(_("System Sounds")); eventRoleWidget->iconImage->set_from_icon_name("multimedia-volume-control", Gtk::ICON_SIZE_SMALL_TOOLBAR); @@ -1628,7 +1631,7 @@ void sink_cb(pa_context *, const pa_sink_info *i, int eol, void *userdata) { MainWindow *w = static_cast(userdata); if (eol < 0) { - show_error("Sink callback failure"); + show_error(_("Sink callback failure")); return; } @@ -1644,7 +1647,7 @@ void source_cb(pa_context *, const pa_source_info *i, int eol, void *userdata) { MainWindow *w = static_cast(userdata); if (eol < 0) { - show_error("Source callback failure"); + show_error(_("Source callback failure")); return; } @@ -1660,7 +1663,7 @@ void sink_input_cb(pa_context *, const pa_sink_input_info *i, int eol, void *use MainWindow *w = static_cast(userdata); if (eol < 0) { - show_error("Sink input callback failure"); + show_error(_("Sink input callback failure")); return; } @@ -1676,7 +1679,7 @@ void source_output_cb(pa_context *, const pa_source_output_info *i, int eol, voi MainWindow *w = static_cast(userdata); if (eol < 0) { - show_error("Source output callback failure"); + show_error(_("Source output callback failure")); return; } @@ -1707,7 +1710,7 @@ void client_cb(pa_context *, const pa_client_info *i, int eol, void *userdata) { MainWindow *w = static_cast(userdata); if (eol < 0) { - show_error("Client callback failure"); + show_error(_("Client callback failure")); return; } @@ -1723,7 +1726,7 @@ void server_info_cb(pa_context *, const pa_server_info *i, void *userdata) { MainWindow *w = static_cast(userdata); if (!i) { - show_error("Server info callback failure"); + show_error(_("Server info callback failure")); return; } @@ -1740,7 +1743,7 @@ void ext_stream_restore_read_cb( MainWindow *w = static_cast(userdata); if (eol < 0) { - g_debug("Failed to initialized stream_restore extension: %s", pa_strerror(pa_context_errno(context))); + g_debug(_("Failed to initialized stream_restore extension: %s"), pa_strerror(pa_context_errno(context))); w->deleteEventRoleWidget(); return; } @@ -1760,7 +1763,7 @@ static void ext_stream_restore_subscribe_cb(pa_context *c, void *userdata) { pa_operation *o; if (!(o = pa_ext_stream_restore_read(c, ext_stream_restore_read_cb, w))) { - show_error("pa_ext_stream_restore_read() failed"); + show_error(_("pa_ext_stream_restore_read() failed")); return; } @@ -1777,7 +1780,7 @@ void subscribe_cb(pa_context *c, pa_subscription_event_type_t t, uint32_t index, else { pa_operation *o; if (!(o = pa_context_get_sink_info_by_index(c, index, sink_cb, w))) { - show_error("pa_context_get_sink_info_by_index() failed"); + show_error(_("pa_context_get_sink_info_by_index() failed")); return; } pa_operation_unref(o); @@ -1790,7 +1793,7 @@ void subscribe_cb(pa_context *c, pa_subscription_event_type_t t, uint32_t index, else { pa_operation *o; if (!(o = pa_context_get_source_info_by_index(c, index, source_cb, w))) { - show_error("pa_context_get_source_info_by_index() failed"); + show_error(_("pa_context_get_source_info_by_index() failed")); return; } pa_operation_unref(o); @@ -1803,7 +1806,7 @@ void subscribe_cb(pa_context *c, pa_subscription_event_type_t t, uint32_t index, else { pa_operation *o; if (!(o = pa_context_get_sink_input_info(c, index, sink_input_cb, w))) { - show_error("pa_context_get_sink_input_info() failed"); + show_error(_("pa_context_get_sink_input_info() failed")); return; } pa_operation_unref(o); @@ -1816,7 +1819,7 @@ void subscribe_cb(pa_context *c, pa_subscription_event_type_t t, uint32_t index, else { pa_operation *o; if (!(o = pa_context_get_source_output_info(c, index, source_output_cb, w))) { - show_error("pa_context_get_sink_input_info() failed"); + show_error(_("pa_context_get_sink_input_info() failed")); return; } pa_operation_unref(o); @@ -1829,7 +1832,7 @@ void subscribe_cb(pa_context *c, pa_subscription_event_type_t t, uint32_t index, else { pa_operation *o; if (!(o = pa_context_get_client_info(c, index, client_cb, w))) { - show_error("pa_context_get_client_info() failed"); + show_error(_("pa_context_get_client_info() failed")); return; } pa_operation_unref(o); @@ -1839,7 +1842,7 @@ void subscribe_cb(pa_context *c, pa_subscription_event_type_t t, uint32_t index, case PA_SUBSCRIPTION_EVENT_SERVER: { pa_operation *o; if (!(o = pa_context_get_server_info(c, server_info_cb, w))) { - show_error("pa_context_get_server_info() failed"); + show_error(_("pa_context_get_server_info() failed")); return; } pa_operation_unref(o); @@ -1871,43 +1874,43 @@ void context_state_callback(pa_context *c, void *userdata) { PA_SUBSCRIPTION_MASK_SOURCE_OUTPUT| PA_SUBSCRIPTION_MASK_CLIENT| PA_SUBSCRIPTION_MASK_SERVER), NULL, NULL))) { - show_error("pa_context_subscribe() failed"); + show_error(_("pa_context_subscribe() failed")); return; } pa_operation_unref(o); if (!(o = pa_context_get_server_info(c, server_info_cb, w))) { - show_error("pa_context_get_server_info() failed"); + show_error(_("pa_context_get_server_info() failed")); return; } pa_operation_unref(o); if (!(o = pa_context_get_client_info_list(c, client_cb, w))) { - show_error("pa_context_client_info_list() failed"); + show_error(_("pa_context_client_info_list() failed")); return; } pa_operation_unref(o); if (!(o = pa_context_get_sink_info_list(c, sink_cb, w))) { - show_error("pa_context_get_sink_info_list() failed"); + show_error(_("pa_context_get_sink_info_list() failed")); return; } pa_operation_unref(o); if (!(o = pa_context_get_source_info_list(c, source_cb, w))) { - show_error("pa_context_get_source_info_list() failed"); + show_error(_("pa_context_get_source_info_list() failed")); return; } pa_operation_unref(o); if (!(o = pa_context_get_sink_input_info_list(c, sink_input_cb, w))) { - show_error("pa_context_get_sink_input_info_list() failed"); + show_error(_("pa_context_get_sink_input_info_list() failed")); return; } pa_operation_unref(o); if (!(o = pa_context_get_source_output_info_list(c, source_output_cb, w))) { - show_error("pa_context_get_source_output_info_list() failed"); + show_error(_("pa_context_get_source_output_info_list() failed")); return; } pa_operation_unref(o); @@ -1925,13 +1928,13 @@ void context_state_callback(pa_context *c, void *userdata) { pa_operation_unref(o); } else - g_debug("Failed to initialized stream_restore extension: %s", pa_strerror(pa_context_errno(context))); + g_debug(_("Failed to initialized stream_restore extension: %s"), pa_strerror(pa_context_errno(context))); break; } case PA_CONTEXT_FAILED: - show_error("Connection failed"); + show_error(_("Connection failed")); return; case PA_CONTEXT_TERMINATED: @@ -1942,6 +1945,12 @@ void context_state_callback(pa_context *c, void *userdata) { } int main(int argc, char *argv[]) { + + /* Initialize the i18n stuff */ + bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); + bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); + textdomain(GETTEXT_PACKAGE); + signal(SIGPIPE, SIG_IGN); Gtk::Main kit(argc, argv); @@ -1954,7 +1963,7 @@ int main(int argc, char *argv[]) { g_assert(api); pa_proplist *proplist = pa_proplist_new(); - pa_proplist_sets(proplist, PA_PROP_APPLICATION_NAME, "PulseAudio Volume Control"); + pa_proplist_sets(proplist, PA_PROP_APPLICATION_NAME, _("PulseAudio Volume Control")); pa_proplist_sets(proplist, PA_PROP_APPLICATION_ID, "org.PulseAudio.pavucontrol"); pa_proplist_sets(proplist, PA_PROP_APPLICATION_ICON_NAME, "audio-card"); pa_proplist_sets(proplist, PA_PROP_APPLICATION_VERSION, PACKAGE_VERSION); @@ -1967,7 +1976,7 @@ int main(int argc, char *argv[]) { pa_context_set_state_callback(context, context_state_callback, mainWindow); if (pa_context_connect(context, NULL, (pa_context_flags_t) 0, NULL) < 0) { - show_error("Connection failed"); + show_error(_("Connection failed")); goto finish; } From f1b84a3c2701882726d57168b84fe2f058f63913 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 5 Aug 2008 20:46:52 +0200 Subject: [PATCH 2/4] add basic german translation --- po/.gitignore | 2 + po/LINGUAS | 1 + po/de.po | 298 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 301 insertions(+) create mode 100644 po/LINGUAS create mode 100644 po/de.po diff --git a/po/.gitignore b/po/.gitignore index 06abd4d..a72318b 100644 --- a/po/.gitignore +++ b/po/.gitignore @@ -10,3 +10,5 @@ insert-header.sin pavucontrol.pot quot.sed remove-potcdate.sin +*.gmo +*.mo diff --git a/po/LINGUAS b/po/LINGUAS new file mode 100644 index 0000000..7673daa --- /dev/null +++ b/po/LINGUAS @@ -0,0 +1 @@ +de diff --git a/po/de.po b/po/de.po new file mode 100644 index 0000000..50f0e19 --- /dev/null +++ b/po/de.po @@ -0,0 +1,298 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-08-05 20:39+0200\n" +"PO-Revision-Date: 2008-08-05 20:44+0100\n" +"Last-Translator: Lennart Poettering \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../src/pavucontrol.desktop.in.h:1 +msgid "Adjust the volume level" +msgstr "Lautstärke anpassen" + +#: ../src/pavucontrol.desktop.in.h:2 +#: ../src/pavucontrol.cc:1966 +msgid "PulseAudio Volume Control" +msgstr "PulseAudio Lautstärkeregler" + +#: ../src/pavucontrol.desktop.in.h:3 +#: ../src/pavucontrol.glade.h:27 +msgid "Volume Control" +msgstr "Lautstärkeregler" + +#: ../src/pavucontrol.glade.h:2 +#, no-c-format +msgid "50%" +msgstr "" + +#: ../src/pavucontrol.glade.h:3 +msgid "S_how:" +msgstr "" + +#: ../src/pavucontrol.glade.h:4 +msgid "Sho_w:" +msgstr "" + +#: ../src/pavucontrol.glade.h:5 +msgid "_Show:" +msgstr "" + +#: ../src/pavucontrol.glade.h:6 +msgid "left-front" +msgstr "" + +#: ../src/pavucontrol.glade.h:7 +msgid "No application is currently playing audio." +msgstr "Keine Applikation gibt zur Zeit Ton wieder." + +#: ../src/pavucontrol.glade.h:8 +msgid "No application is currently recording audio." +msgstr "Keine Applikation nimmt zur Zeit Ton auf." + +#: ../src/pavucontrol.glade.h:9 +msgid "No input devices available" +msgstr "Keine Eingabegeräte verfügbar." + +#: ../src/pavucontrol.glade.h:10 +msgid "No output devices available" +msgstr "Keine Ausgabegeräte verfügbar" + +#: ../src/pavucontrol.glade.h:11 +msgid "" +"All Input Devices\n" +"All Except Monitors\n" +"Hardware Input Devices\n" +"Virtual Input Devices\n" +"Monitors" +msgstr "" + +#: ../src/pavucontrol.glade.h:16 +msgid "" +"All Output Devices\n" +"Hardware Output Devices\n" +"Virtual Output Devices" +msgstr "" + +#. Applications All streams +#: ../src/pavucontrol.glade.h:20 +msgid "" +"All Streams\n" +"Applications\n" +"Virtual Streams" +msgstr "" + +#: ../src/pavucontrol.glade.h:23 +msgid "Lock channels together" +msgstr "" + +#: ../src/pavucontrol.glade.h:24 +msgid "Mute audio" +msgstr "" + +#: ../src/pavucontrol.glade.h:25 +msgid "Open menu" +msgstr "" + +#: ../src/pavucontrol.glade.h:26 +msgid "Stream Title" +msgstr "" + +#: ../src/pavucontrol.glade.h:28 +msgid "_Input Devices" +msgstr "" + +#: ../src/pavucontrol.glade.h:29 +msgid "_Output Devices" +msgstr "" + +#: ../src/pavucontrol.glade.h:30 +msgid "_Playback" +msgstr "" + +#: ../src/pavucontrol.glade.h:31 +msgid "_Recording" +msgstr "" + +#: ../src/pavucontrol.cc:606 +msgid "pa_context_set_sink_volume_by_index() failed" +msgstr "" + +#: ../src/pavucontrol.cc:621 +msgid "pa_context_set_sink_mute_by_index() failed" +msgstr "" + +#: ../src/pavucontrol.cc:635 +msgid "pa_context_set_default_sink() failed" +msgstr "" + +#: ../src/pavucontrol.cc:643 +msgid "_Default" +msgstr "" + +#: ../src/pavucontrol.cc:664 +msgid "pa_context_set_source_volume_by_index() failed" +msgstr "" + +#: ../src/pavucontrol.cc:679 +msgid "pa_context_set_source_mute_by_index() failed" +msgstr "" + +#: ../src/pavucontrol.cc:693 +msgid "pa_context_set_default_source() failed" +msgstr "" + +#: ../src/pavucontrol.cc:702 +#: ../src/pavucontrol.cc:805 +msgid "_Move Stream..." +msgstr "_Verschiebe Strom..." + +#: ../src/pavucontrol.cc:703 +#: ../src/pavucontrol.cc:806 +msgid "_Terminate Stream" +msgstr "_Beende Strom" + +#: ../src/pavucontrol.cc:729 +msgid "pa_context_set_sink_input_volume() failed" +msgstr "" + +#: ../src/pavucontrol.cc:744 +msgid "pa_context_set_sink_input_mute() failed" +msgstr "" + +#: ../src/pavucontrol.cc:778 +msgid "pa_context_kill_sink_input() failed" +msgstr "" + +#: ../src/pavucontrol.cc:795 +msgid "pa_context_move_sink_input_by_index() failed" +msgstr "" + +#: ../src/pavucontrol.cc:831 +msgid "pa_context_kill_source_output() failed" +msgstr "" + +#: ../src/pavucontrol.cc:872 +msgid "pa_context_move_source_output_by_index() failed" +msgstr "" + +#: ../src/pavucontrol.cc:914 +msgid "pa_ext_stream_restore_write() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1035 +msgid "Failed to read data from stream" +msgstr "" + +#: ../src/pavucontrol.cc:1069 +#: ../src/pavucontrol.cc:1105 +msgid "Peak detect" +msgstr "" + +#: ../src/pavucontrol.cc:1070 +#: ../src/pavucontrol.cc:1106 +msgid "Failed to create monitoring stream" +msgstr "" + +#: ../src/pavucontrol.cc:1078 +#: ../src/pavucontrol.cc:1115 +msgid "Failed to connect monitoring stream" +msgstr "" + +#: ../src/pavucontrol.cc:1355 +msgid "System Sounds" +msgstr "" + +#: ../src/pavucontrol.cc:1634 +msgid "Sink callback failure" +msgstr "" + +#: ../src/pavucontrol.cc:1650 +msgid "Source callback failure" +msgstr "" + +#: ../src/pavucontrol.cc:1666 +msgid "Sink input callback failure" +msgstr "" + +#: ../src/pavucontrol.cc:1682 +msgid "Source output callback failure" +msgstr "" + +#: ../src/pavucontrol.cc:1713 +msgid "Client callback failure" +msgstr "" + +#: ../src/pavucontrol.cc:1729 +msgid "Server info callback failure" +msgstr "" + +#: ../src/pavucontrol.cc:1746 +#: ../src/pavucontrol.cc:1931 +#, c-format +msgid "Failed to initialized stream_restore extension: %s" +msgstr "" + +#: ../src/pavucontrol.cc:1766 +msgid "pa_ext_stream_restore_read() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1783 +msgid "pa_context_get_sink_info_by_index() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1796 +msgid "pa_context_get_source_info_by_index() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1809 +#: ../src/pavucontrol.cc:1822 +msgid "pa_context_get_sink_input_info() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1835 +msgid "pa_context_get_client_info() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1845 +#: ../src/pavucontrol.cc:1883 +msgid "pa_context_get_server_info() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1877 +msgid "pa_context_subscribe() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1889 +msgid "pa_context_client_info_list() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1895 +msgid "pa_context_get_sink_info_list() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1901 +msgid "pa_context_get_source_info_list() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1907 +msgid "pa_context_get_sink_input_info_list() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1913 +msgid "pa_context_get_source_output_info_list() failed" +msgstr "" + +#: ../src/pavucontrol.cc:1937 +#: ../src/pavucontrol.cc:1979 +msgid "Connection failed" +msgstr "Verbindung fehlgeschlagen" + From 34e69af0a47b2f1e7b926d227d1d38b8dda18326 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 5 Aug 2008 20:51:58 +0200 Subject: [PATCH 3/4] improve german translation --- po/de.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/po/de.po b/po/de.po index 50f0e19..8918620 100644 --- a/po/de.po +++ b/po/de.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2008-08-05 20:39+0200\n" -"PO-Revision-Date: 2008-08-05 20:44+0100\n" +"PO-Revision-Date: 2008-08-05 20:49+0100\n" "Last-Translator: Lennart Poettering \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -108,19 +108,19 @@ msgstr "" #: ../src/pavucontrol.glade.h:28 msgid "_Input Devices" -msgstr "" +msgstr "_Eingabegeräte" #: ../src/pavucontrol.glade.h:29 msgid "_Output Devices" -msgstr "" +msgstr "_Ausgabegeräte" #: ../src/pavucontrol.glade.h:30 msgid "_Playback" -msgstr "" +msgstr "_Wiedergabe" #: ../src/pavucontrol.glade.h:31 msgid "_Recording" -msgstr "" +msgstr "_Aufnahme" #: ../src/pavucontrol.cc:606 msgid "pa_context_set_sink_volume_by_index() failed" From ecc9ad9b06184dc2a4d2bc8da581d8bca0ae67aa Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 19 Aug 2008 17:36:18 +0200 Subject: [PATCH 4/4] beep when changing volume --- configure.ac | 2 +- src/pavucontrol.cc | 59 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/configure.ac b/configure.ac index e4663e7..65c685a 100644 --- a/configure.ac +++ b/configure.ac @@ -38,7 +38,7 @@ AC_PROG_LN_S AC_TYPE_SIGNAL AC_HEADER_STDC -PKG_CHECK_MODULES(GUILIBS, [ gtkmm-2.4 libglademm-2.4 sigc++-2.0 ]) +PKG_CHECK_MODULES(GUILIBS, [ gtkmm-2.4 libglademm-2.4 sigc++-2.0 libcanberra-gtk ]) AC_SUBST(GUILIBS_CFLAGS) AC_SUBST(GUILIBS_LIBS) diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc index 8b67e58..fd63209 100644 --- a/src/pavucontrol.cc +++ b/src/pavucontrol.cc @@ -29,6 +29,8 @@ #include #include +#include + #include #include #include @@ -91,6 +93,8 @@ public: bool can_decibel; bool volumeScaleEnabled; + Glib::ustring beepDevice; + virtual void set_sensitive(bool enabled); }; @@ -118,6 +122,8 @@ public: void enableVolumeMeter(); void updatePeak(double v); + Glib::ustring beepDevice; + protected: virtual bool on_button_press_event(GdkEventButton* event); }; @@ -376,13 +382,15 @@ void ChannelWidget::setVolume(pa_volume_t volume) { if (dB > PA_DECIBEL_MININFTY) { snprintf(txt, sizeof(txt), "%0.2f dB", dB); - volumeLabel->set_text(txt); + volumeLabel->set_tooltip_text(txt); } else - volumeLabel->set_markup("-∞dB"); - } else { - snprintf(txt, sizeof(txt), "%0.0f%%", v); - volumeLabel->set_text(txt); - } + volumeLabel->set_tooltip_markup("-∞dB"); + volumeLabel->set_has_tooltip(TRUE); + } else + volumeLabel->set_has_tooltip(FALSE); + + snprintf(txt, sizeof(txt), "%0.0f%%", v); + volumeLabel->set_text(txt); volumeScaleEnabled = false; volumeScale->set_value(v > 100 ? 100 : v); @@ -399,6 +407,26 @@ void ChannelWidget::onVolumeScaleValueChanged() { pa_volume_t volume = (pa_volume_t) ((volumeScale->get_value() * PA_VOLUME_NORM) / 100); streamWidget->updateChannelVolume(channel, volume); + + if (beepDevice != "") { + g_debug("blah: %s", beepDevice.c_str()); + ca_context_change_device(ca_gtk_context_get(), beepDevice.c_str()); + + ca_context_cancel(ca_gtk_context_get(), 2); + + int r = ca_gtk_play_for_widget(GTK_WIDGET(volumeScale->gobj()), + 2, + CA_PROP_EVENT_DESCRIPTION, _("Volume Control Feedback Sound"), + CA_PROP_EVENT_ID, "audio-volume-change", + CA_PROP_CANBERRA_CACHE_CONTROL, "permanent", + CA_PROP_CANBERRA_VOLUME, "0", + CA_PROP_CANBERRA_ENABLE, "1", + NULL); + + g_debug("%i = %s", r, ca_strerror(r)); + + ca_context_change_device(ca_gtk_context_get(), NULL); + } } void ChannelWidget::set_sensitive(bool enabled) { @@ -524,6 +552,7 @@ void StreamWidget::setChannelMap(const pa_channel_map &m, bool can_decibel) { for (int i = 0; i < m.channels; i++) { ChannelWidget *cw = channelWidgets[i] = ChannelWidget::create(); + cw->beepDevice = beepDevice; cw->channel = i; cw->can_decibel = can_decibel; cw->streamWidget = this; @@ -988,6 +1017,7 @@ void MainWindow::updateSink(const pa_sink_info &info) { w = sinkWidgets[info.index]; else { sinkWidgets[info.index] = w = SinkWidget::create(); + w->beepDevice = info.name; w->setChannelMap(info.channel_map, !!(info.flags & PA_SINK_DECIBEL_VOLUME)); sinksVBox->pack_start(*w, false, false, 0); w->index = info.index; @@ -1631,6 +1661,9 @@ void sink_cb(pa_context *, const pa_sink_info *i, int eol, void *userdata) { MainWindow *w = static_cast(userdata); if (eol < 0) { + if (pa_context_errno(context) == PA_ERR_NOENTITY) + return; + show_error(_("Sink callback failure")); return; } @@ -1647,6 +1680,9 @@ void source_cb(pa_context *, const pa_source_info *i, int eol, void *userdata) { MainWindow *w = static_cast(userdata); if (eol < 0) { + if (pa_context_errno(context) == PA_ERR_NOENTITY) + return; + show_error(_("Source callback failure")); return; } @@ -1663,6 +1699,9 @@ void sink_input_cb(pa_context *, const pa_sink_input_info *i, int eol, void *use MainWindow *w = static_cast(userdata); if (eol < 0) { + if (pa_context_errno(context) == PA_ERR_NOENTITY) + return; + show_error(_("Sink input callback failure")); return; } @@ -1679,6 +1718,9 @@ void source_output_cb(pa_context *, const pa_source_output_info *i, int eol, voi MainWindow *w = static_cast(userdata); if (eol < 0) { + if (pa_context_errno(context) == PA_ERR_NOENTITY) + return; + show_error(_("Source output callback failure")); return; } @@ -1710,6 +1752,9 @@ void client_cb(pa_context *, const pa_client_info *i, int eol, void *userdata) { MainWindow *w = static_cast(userdata); if (eol < 0) { + if (pa_context_errno(context) == PA_ERR_NOENTITY) + return; + show_error(_("Client callback failure")); return; } @@ -1955,6 +2000,8 @@ int main(int argc, char *argv[]) { Gtk::Main kit(argc, argv); + ca_context_set_driver(ca_gtk_context_get(), "pulse"); + Gtk::Window* mainWindow = MainWindow::create(); pa_glib_mainloop *m = pa_glib_mainloop_new(g_main_context_default());