code to update the mixer interface soon.
/* 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)
{
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 */
/*****************************************************************************/
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));
/******************************************************************************/
-#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 */
+/******************************************************************************/
/* Begin Macros */
#define EAZERO(S, L) S[L-1] = '\0';
-#define MIXER(m) ((Mixer *)m)
/* End Macros */
/*****************************************************************************/
char *home_env, *home_dir;
GtkStyle *style;
GtkWidget *hbox;
+ snd_mixer_filter_t mixer_filter;
/* End Variable Declarations */
/* Go through gtk initialization */
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);