chiark / gitweb /
Use gtk_widget_set_tooltip_text() instead of obsolete (and somewhat
[disorder] / disobedience / control.c
index 8e1391eb872db6bfb51d6d63689789f115f3a876..931746a88aac41cb2b23729416fe03cc713baf02 100644 (file)
@@ -2,27 +2,24 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * This program 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
+ * the Free Software Foundation, either version 3 of the License, or
  * (at your option) any later version.
  *
- * This program 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.
- *
+ * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
- * USA
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/control.c
  * @brief Volume control and buttons
  */
 
 #include "disobedience.h"
-#include "mixer.h"
 
 /* Forward declarations ---------------------------------------------------- */
 
@@ -292,8 +289,8 @@ GtkWidget *control_widget(void) {
   gtk_scale_set_digits(GTK_SCALE(balance_widget), 10);
   gtk_widget_set_size_request(volume_widget, 192, -1);
   gtk_widget_set_size_request(balance_widget, 192, -1);
-  gtk_tooltips_set_tip(tips, volume_widget, "Volume", "");
-  gtk_tooltips_set_tip(tips, balance_widget, "Balance", "");
+  gtk_widget_set_tooltip_text(volume_widget, "Volume");
+  gtk_widget_set_tooltip_text(balance_widget, "Balance");
   gtk_box_pack_start(GTK_BOX(hbox), volume_widget, FALSE, TRUE, 0);
   gtk_box_pack_start(GTK_BOX(hbox), balance_widget, FALSE, TRUE, 0);
   /* space updates rather than hammering the server */
@@ -325,7 +322,7 @@ static void volume_changed(const char attribute((unused)) *event,
   ++suppress_actions;
   /* Only display volume/balance controls if they will work */
   if(!rtp_supported
-     || (rtp_supported && mixer_supported(DEFAULT_BACKEND)))
+     || (rtp_supported && backend && backend->set_volume))
     volume_supported = TRUE;
   else
     volume_supported = FALSE;
@@ -377,8 +374,8 @@ static void icon_changed(const char attribute((unused)) *event,
    * state is immediately displayed.  sensitive and GTK_WIDGET_SENSITIVE show
    * it to be in the correct state, so I think this is may be a GTK+ bug. */
   if(icon->tip_on)
-    gtk_tooltips_set_tip(tips, icon->button,
-                           on ? icon->tip_on : icon->tip_off, "");
+    gtk_widget_set_tooltip_text(icon->button,
+                                on ? icon->tip_on : icon->tip_off);
   gtk_widget_set_sensitive(icon->button, sensitive);
   /* Icons with an associated menu item */
   if(icon->item) {
@@ -446,7 +443,8 @@ static void volume_adjusted(GtkAdjustment attribute((unused)) *a,
    * from the log. */
   if(rtp_supported) {
     int l = nearbyint(left(v, b) * 100), r = nearbyint(right(v, b) * 100);
-    mixer_control(DEFAULT_BACKEND, &l, &r, 1);
+    if(backend && backend->set_volume)
+      backend->set_volume(&l, &r);
   } else
     disorder_eclient_volume(client, volume_completed,
                             nearbyint(left(v, b) * 100),