Added stubs for the mixer notification callbacks. Will be adding the actual

code to update the mixer interface soon.
This commit is contained in:
Christopher Lansdown 1999-10-23 15:31:23 +00:00
parent 81cdad0d1e
commit 5bf715371d
6 changed files with 65 additions and 31 deletions

View 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)
{

View 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 */
/*****************************************************************************/

View 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));

View 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 */
/******************************************************************************/

View 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 */
/*****************************************************************************/

View 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);