]> mj.ucw.cz Git - ursary.git/commitdiff
Added Compress output and its controls
authorMartin Mares <mj@ucw.cz>
Sat, 22 Nov 2014 20:15:56 +0000 (21:15 +0100)
committerMartin Mares <mj@ucw.cz>
Sat, 22 Nov 2014 20:15:56 +0000 (21:15 +0100)
ursaryd.c

index a0f19117dee521dd500a0915ac93681bfd25b7e6..0315c344efce35272315f0a80db54c1dee4c5a28 100644 (file)
--- a/ursaryd.c
+++ b/ursaryd.c
@@ -23,7 +23,7 @@
  *             rotary          red button      green button
  *     0       sink Ursarium   mute            select as default (or assign to client selected by touch)
  *     1       sink Catarium   mute            dtto
- *     2       -               -               -
+ *     2       sink Compress   -               dtto
  *     3       -               -               -
  *     4       MPD             mute            play/pause/stop
  *     5       Albireo         mute            -
@@ -288,16 +288,25 @@ static void update_default_sink(void)
     {
       noct_set_button(8, 1);
       noct_set_button(9, 0);
+      noct_set_button(10, 0);
     }
   else if (!strcmp(sink, "catarium"))
     {
       noct_set_button(8, 0);
       noct_set_button(9, 1);
+      noct_set_button(10, 0);
+    }
+  else if (!strcmp(sink, "compress"))
+    {
+      noct_set_button(8, 0);
+      noct_set_button(9, 0);
+      noct_set_button(10, 1);
     }
   else
     {
       noct_set_button(8, 0);
       noct_set_button(9, 0);
+      noct_set_button(10, 0);
     }
 }
 
@@ -328,6 +337,13 @@ static void update_default_sink_from_button(int button, int on)
       else
        switch_to = "catarium";
     }
+  else if (button == 10)
+    {
+      if (!strcmp(sink, "compress"))
+       switch_to = "burrow";
+      else
+       switch_to = "compress";
+    }
 
   if (!switch_to)
     return;
@@ -601,6 +617,7 @@ void notify_button(int button, int on)
       break;
     case 8:
     case 9:
+    case 10:
       update_default_sink_from_button(button, on);
       break;
     case 12: