X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/0eaf64e8d26c08228401fa89741c63fc2ff064c3..1ce62256052854cdf87b90fb555a39eb6deea0f8:/disobedience/control.c
diff --git a/disobedience/control.c b/disobedience/control.c
index ce39124..852885f 100644
--- a/disobedience/control.c
+++ b/disobedience/control.c
@@ -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 .
*/
/** @file disobedience/control.c
* @brief Volume control and buttons
*/
#include "disobedience.h"
-#include "mixer.h"
/* Forward declarations ---------------------------------------------------- */
@@ -169,9 +166,9 @@ static int rtp_sensitive(void) {
/** @brief Table of all icons */
static struct icon icons[] = {
{
- icon_on: "pause.png",
+ icon_on: "pause32.png",
tip_on: "Pause playing track",
- icon_off: "play.png",
+ icon_off: "play32.png",
tip_off: "Resume playing track",
menuitem: "/Control/Playing",
on: pause_resume_on,
@@ -181,7 +178,7 @@ static struct icon icons[] = {
events: "pause-changed playing-changed rights-changed",
},
{
- icon_on: "cross.png",
+ icon_on: "cross32.png",
tip_on: "Cancel playing track",
menuitem: "/Control/Scratch",
sensitive: scratch_sensitive,
@@ -189,9 +186,9 @@ static struct icon icons[] = {
events: "playing-track-changed rights-changed",
},
{
- icon_on: "randomcross.png",
+ icon_on: "randomenabled32.png",
tip_on: "Disable random play",
- icon_off: "random.png",
+ icon_off: "randomdisabled32.png",
tip_off: "Enable random play",
menuitem: "/Control/Random play",
on: random_enabled,
@@ -201,9 +198,9 @@ static struct icon icons[] = {
events: "random-changed rights-changed",
},
{
- icon_on: "notescross.png",
+ icon_on: "playenabled32.png",
tip_on: "Disable play",
- icon_off: "notes.png",
+ icon_off: "playdisabled32.png",
tip_off: "Enable play",
on: playing_enabled,
sensitive: playing_sensitive,
@@ -212,9 +209,9 @@ static struct icon icons[] = {
events: "enabled-changed rights-changed",
},
{
- icon_on: "speakercross.png",
+ icon_on: "rtpenabled32.png",
tip_on: "Stop playing network stream",
- icon_off: "speaker.png",
+ icon_off: "rtpdisabled32.png",
tip_off: "Play network stream",
menuitem: "/Control/Network player",
on: rtp_enabled,
@@ -275,6 +272,7 @@ GtkWidget *control_widget(void) {
char **events = split(icons[n].events, 0, 0, 0, 0);
while(*events)
event_register(*events++, icon_changed, &icons[n]);
+ event_register("connected-changed", icon_changed, &icons[n]);
}
/* create the adjustments for the volume control */
volume_adj = GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, goesupto,
@@ -324,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;
@@ -445,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),