Author: titmuss
Date: Wed Oct 22 06:32:06 2008
New Revision: 3185

URL: http://svn.slimdevices.com?rev=3185&root=Jive&view=rev
Log:
Bug: N/A
Description:
Squeezeplay changes to switch between speaker and headphone output on jive.


Modified:
    
7.3/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
    7.3/trunk/squeezeplay/src/squeezeplay_jive/src/jive_bsp.c

Modified: 
7.3/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua?rev=3185&root=Jive&r1=3184&r2=3185&view=diff
==============================================================================
--- 
7.3/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
 (original)
+++ 
7.3/trunk/squeezeplay/src/squeezeplay_jive/share/applets/SqueezeboxJive/SqueezeboxJiveApplet.lua
 Wed Oct 22 06:32:06 2008
@@ -175,11 +175,9 @@
 
                                      elseif sw == SW_PHONE_DETECT then
                                              if val == 1 then
-                                                     jiveBSP.mixer(0, 97, 97)
-                                                     jiveBSP.mixer(5, 0, 0)
+                                                     os.execute("amixer -q 
sset Endpoint Headphone")
                                              else
-                                                     jiveBSP.mixer(0, 0, 0)
-                                                     jiveBSP.mixer(5, 97, 97)
+                                                     os.execute("amixer -q 
sset Endpoint Speaker")
                                              end
                                      end
 
@@ -245,11 +243,9 @@
        -- headphone or speaker
        local headphone = jiveBSP.ioctl(18)
        if headphone == 1 then
-               jiveBSP.mixer(0, 97, 97)
-               jiveBSP.mixer(5, 0, 0)
+               os.execute("amixer -q sset Endpoint Headphone")
        else
-               jiveBSP.mixer(0, 0, 0)
-               jiveBSP.mixer(5, 97, 97)
+               os.execute("amixer -q sset Endpoint Speaker")
        end
 
        -- set initial state

Modified: 7.3/trunk/squeezeplay/src/squeezeplay_jive/src/jive_bsp.c
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay_jive/src/jive_bsp.c?rev=3185&root=Jive&r1=3184&r2=3185&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/squeezeplay_jive/src/jive_bsp.c (original)
+++ 7.3/trunk/squeezeplay/src/squeezeplay_jive/src/jive_bsp.c Wed Oct 22 
06:32:06 2008
@@ -18,11 +18,9 @@
 
 
 static const char *bsp_devname = "/dev/misc/jive_mgmt";
-static const char *mixer_devname = "/dev/mixer";
 
 
 static int bsp_fd = -1;
-static int mixer_fd = -1;
 static int switch_event_fd = -1;
 static int wheel_event_fd = -1;
 static int motion_event_fd = -1;
@@ -53,35 +51,6 @@
 
        lua_pushinteger(L, v);
        return 1;
-}
-
-
-static int l_jivebsp_mixer(lua_State *L) {
-       unsigned int channel, l, r, volume;
-
-       if (mixer_fd == -1) {
-               // silently fail
-               return 0;
-       }
-
-       channel = luaL_checkinteger(L, 1); // mixer
-       l = luaL_checkinteger(L, 2); // left
-       r = luaL_checkinteger(L, 3); // right
-
-       if (l > 100) {
-               l = 100;
-       }
-       if (r > 100) {
-               r = 100;
-       }
-
-       volume = l | (r << 8);
-       if (ioctl(mixer_fd, MIXER_WRITE(channel), &volume) == -1) {
-               lua_pushstring(L, "Mixer ioctl failed");
-               lua_error(L);
-       }
-
-       return 0;
 }
 
 
@@ -306,7 +275,6 @@
 
 static const struct luaL_Reg jivebsplib[] = {
        { "ioctl", l_jivebsp_ioctl },
-       { "mixer", l_jivebsp_mixer },
        { NULL, NULL }
 };
 
@@ -316,11 +284,6 @@
                perror("jivebsp:");
        }
 
-       mixer_fd = open(mixer_devname, O_RDWR);
-       if (mixer_fd == -1) {
-               perror("jivebsp mixer:");
-       }
-
        open_input_devices();
 
        jive_sdlevent_pump = event_pump;

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to