]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Added stubs for the mixer notification callbacks. Will be adding the actual
authorChristopher Lansdown <lansdoct@cs.alfred.edu>
Sat, 23 Oct 1999 15:31:23 +0000 (15:31 +0000)
committerChristopher Lansdown <lansdoct@cs.alfred.edu>
Sat, 23 Oct 1999 15:31:23 +0000 (15:31 +0000)
code to update the mixer interface soon.

xamixer2/callbacks.c
xamixer2/callbacks.h
xamixer2/cinit.c
xamixer2/structs.h
xamixer2/util.h
xamixer2/xamixer2.c

index 55b17e8745d96d9ff1483be4077eaf8d1665d0ac..917a661bda38a128c0c6c132df082b2ffefdd35b 100644 (file)
@@ -37,6 +37,50 @@ extern Config config; /* The system config */
 /* End Global Variables */
 /*****************************************************************************/
 
+void mixer_rebuild_cb(void *data)
+{
+
+/*     printf("A rebuild event happened.\n"); */
+/*     fflush(NULL); */
+
+       return;
+}
+
+void mixer_element_cb(void *data, int cmd, snd_mixer_eid_t *eid)
+{
+
+/*     printf("An element event happened.\n"); */
+/*     fflush(NULL); */
+
+       return;
+}
+
+void mixer_group_cb(void *data, int cmd, snd_mixer_gid_t *gid)
+{
+
+/*     printf("A group event happened.\n"); */
+/*     fflush(NULL); */
+
+       return;
+}
+
+void mixer_change_cb(gpointer data, gint source, GdkInputCondition condition)
+{
+       snd_mixer_callbacks_t callbacks;  
+
+       /* Set up the callback structure */
+       callbacks.private_data = data;
+       callbacks.rebuild = mixer_rebuild_cb;
+       callbacks.element = mixer_element_cb;
+       callbacks.group = mixer_group_cb;
+       bzero(callbacks.reserved, sizeof(void *) * 28);
+                       
+       
+       /* Actually deal with the event. */
+       snd_mixer_read(MIXER(data)->handle, &callbacks);
+
+       return;
+}
 
 void adjust_teffect1(GtkWidget *widget, CBData *data)
 {
index e96f73bb86f83143332c01c608816dcf406e7804..1575e80dc27589e13f09591983fbbc744b872a38 100644 (file)
@@ -14,6 +14,7 @@ void adjust_volume1(GtkWidget *widget, CBData *data);
 void adjust_switch1(GtkWidget *widget, CBData *data);
 void adjust_switch2(GtkWidget *widget, CBData *data);
 void adjust_teffect1(GtkWidget *widget, CBData *data);
+void mixer_change_cb(gpointer data, gint source, GdkInputCondition condition);
 
 /* End function prototypes */
 /*****************************************************************************/
index c26dcfe67216ca2c730dd488c85d2af9fea4a08d..d8a1a63436afd2e925cd7560162da1b2eb8f5583 100644 (file)
@@ -77,7 +77,8 @@ int init_cards()
                        card[i].hw_info.mixerdevs = 1;
                }
 
-               
+               card[i].nmixers = card[i].hw_info.mixerdevs;
+
                /* Allocate out the mixer array */
                card[i].mixer = calloc(card[i].hw_info.mixerdevs, sizeof(Mixer));
 
index 4b019d2634cf5a946d25e4b748aa33b9069af901..5a0ecf646882753400f18718064101af4766a604 100644 (file)
@@ -125,34 +125,13 @@ typedef struct _Config Config;
 /******************************************************************************/
 
 
-#if 0
-struct _Channel
-{
-        int num; /* The channel's number */
-        snd_mixer_channel_t data; /* the data */
-        snd_mixer_channel_info_t info; /* The info */
-        unsigned int flags; /* The Channel's flags */
-        GtkWidget *lm, *rm, *mm, *rec; /* The associated widgets */
-        GtkWidget *lrec, *rrec; /* More associated widgets */
-        GtkObject *ladj, *radj, *madj; /* The associated objects */
-        GtkTooltips *left_tt, *right_tt, *mono_tt; /* The tooltips */
-        GtkWidget *lscal, *rscal, *mscal; /* The scale widgets */
-        GtkWidget *label, *lock;
-        GtkWidget *ltor_in, *rtol_in;
-        void *mixer; /* A pointer to the mixer */
-};
-typedef struct _Channel Channel;
-#endif
-
-
-
-
-
-
-
-
-
+/******************************************************************************/
+/* Begin type macros */
 
+#define MIXER(x) ((Mixer *)(x))
+#define CARD(x) ((Card *)(x))
 
+/* End type macros */
+/******************************************************************************/
 
 
index e97e83a3621ed9839a25234d8b5a1f40c471e4ac..29790d7d9aadc36e2baddbf6991b76f13dfba292 100644 (file)
@@ -31,7 +31,6 @@ CBData *create_cb_data(Group *group, void *handle, int element, int index);
 /* Begin Macros */
 
 #define EAZERO(S, L) S[L-1] = '\0';
-#define MIXER(m) ((Mixer *)m)
 
 /* End Macros */
 /*****************************************************************************/
index 75f25d7a40c73d6f5eaa214776ef0ca42348b9ee..606328ed0740242c3f62c354dde65cc923008435 100644 (file)
@@ -58,6 +58,7 @@ int main(int argc, char **argv)
         char *home_env, *home_dir;
         GtkStyle *style;
         GtkWidget *hbox;
+       snd_mixer_filter_t mixer_filter;
         /* End Variable Declarations */
 
        /* Go through gtk initialization */
@@ -177,6 +178,15 @@ int main(int argc, char **argv)
                                     config.icon_xpm, config.icon_mask);
 
 
+       /* Set up the update callback for every mixer */
+       for(i = 0; i < cards; i++)
+               for(j = 0; j < card[i].nmixers; j++)
+                       gdk_input_add(snd_mixer_file_descriptor(card[i].mixer[j].handle),
+                                     GDK_INPUT_READ,
+                                     mixer_change_cb,
+                                     &card[i].mixer[j]);
+
+
        /* Show the whole kit and kaboodle */
        gtk_widget_show(window);