mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 06:15:43 +01:00
Added stubs for the mixer notification callbacks. Will be adding the actual
code to update the mixer interface soon.
This commit is contained in:
parent
81cdad0d1e
commit
5bf715371d
6 changed files with 65 additions and 31 deletions
|
@ -37,6 +37,50 @@ extern Config config; /* The system config */
|
||||||
/* End Global Variables */
|
/* 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_teffect1(GtkWidget *widget, CBData *data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,6 +14,7 @@ void adjust_volume1(GtkWidget *widget, CBData *data);
|
||||||
void adjust_switch1(GtkWidget *widget, CBData *data);
|
void adjust_switch1(GtkWidget *widget, CBData *data);
|
||||||
void adjust_switch2(GtkWidget *widget, CBData *data);
|
void adjust_switch2(GtkWidget *widget, CBData *data);
|
||||||
void adjust_teffect1(GtkWidget *widget, CBData *data);
|
void adjust_teffect1(GtkWidget *widget, CBData *data);
|
||||||
|
void mixer_change_cb(gpointer data, gint source, GdkInputCondition condition);
|
||||||
|
|
||||||
/* End function prototypes */
|
/* End function prototypes */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -77,7 +77,8 @@ int init_cards()
|
||||||
card[i].hw_info.mixerdevs = 1;
|
card[i].hw_info.mixerdevs = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
card[i].nmixers = card[i].hw_info.mixerdevs;
|
||||||
|
|
||||||
/* Allocate out the mixer array */
|
/* Allocate out the mixer array */
|
||||||
card[i].mixer = calloc(card[i].hw_info.mixerdevs, sizeof(Mixer));
|
card[i].mixer = calloc(card[i].hw_info.mixerdevs, sizeof(Mixer));
|
||||||
|
|
||||||
|
|
|
@ -125,34 +125,13 @@ typedef struct _Config Config;
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
/******************************************************************************/
|
||||||
struct _Channel
|
/* Begin type macros */
|
||||||
{
|
|
||||||
int num; /* The channel's number */
|
#define MIXER(x) ((Mixer *)(x))
|
||||||
snd_mixer_channel_t data; /* the data */
|
#define CARD(x) ((Card *)(x))
|
||||||
snd_mixer_channel_info_t info; /* The info */
|
|
||||||
unsigned int flags; /* The Channel's flags */
|
/* End type macros */
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ CBData *create_cb_data(Group *group, void *handle, int element, int index);
|
||||||
/* Begin Macros */
|
/* Begin Macros */
|
||||||
|
|
||||||
#define EAZERO(S, L) S[L-1] = '\0';
|
#define EAZERO(S, L) S[L-1] = '\0';
|
||||||
#define MIXER(m) ((Mixer *)m)
|
|
||||||
|
|
||||||
/* End Macros */
|
/* End Macros */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -58,6 +58,7 @@ int main(int argc, char **argv)
|
||||||
char *home_env, *home_dir;
|
char *home_env, *home_dir;
|
||||||
GtkStyle *style;
|
GtkStyle *style;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
|
snd_mixer_filter_t mixer_filter;
|
||||||
/* End Variable Declarations */
|
/* End Variable Declarations */
|
||||||
|
|
||||||
/* Go through gtk initialization */
|
/* Go through gtk initialization */
|
||||||
|
@ -177,6 +178,15 @@ int main(int argc, char **argv)
|
||||||
config.icon_xpm, config.icon_mask);
|
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 */
|
/* Show the whole kit and kaboodle */
|
||||||
gtk_widget_show(window);
|
gtk_widget_show(window);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue