|
Packit Service |
b98cfc |
/*****************************************************************************
|
|
Packit Service |
b98cfc |
loopback.c
|
|
Packit Service |
b98cfc |
Copyright (C) 2003 by Robert Vetter <postmaster@robertvetter.com>
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
This program is free software; you can redistribute it and/or
|
|
Packit Service |
b98cfc |
modify it under the terms of the GNU General Public License
|
|
Packit Service |
b98cfc |
as published by the Free Software Foundation; either version 2
|
|
Packit Service |
b98cfc |
of the License, or (at your option) any later version.
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
This program is distributed in the hope that it will be useful,
|
|
Packit Service |
b98cfc |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
b98cfc |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
b98cfc |
GNU General Public License for more details.
|
|
Packit Service |
b98cfc |
******************************************************************************/
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
#include "rmedigicontrol.h"
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
static snd_ctl_elem_value_t *val;
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
static void loopback_toggled(GtkToggleButton *c,gpointer p)
|
|
Packit Service |
b98cfc |
{
|
|
Packit Service |
b98cfc |
snd_ctl_elem_value_set_integer(val,0,gtk_toggle_button_get_active(c)?1:0);
|
|
Packit Service |
b98cfc |
snd_ctl_elem_write(ctl, val);
|
|
Packit Service |
b98cfc |
}
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
GtkWidget *create_loopback_toggle()
|
|
Packit Service |
b98cfc |
{
|
|
Packit Service |
b98cfc |
GtkWidget *t;
|
|
Packit Service |
b98cfc |
GtkWidget *box;
|
|
Packit Service |
b98cfc |
char *elem_name="Loopback Input";
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
box=gtk_hbox_new(FALSE,0);
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
snd_ctl_elem_value_malloc(&val;;
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
snd_ctl_elem_value_set_interface(val, SND_CTL_ELEM_IFACE_MIXER);
|
|
Packit Service |
b98cfc |
snd_ctl_elem_value_set_name(val,elem_name);
|
|
Packit Service |
b98cfc |
snd_ctl_elem_read(ctl, val);
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
t=gtk_check_button_new_with_label(elem_name);
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
gtk_signal_connect(GTK_OBJECT(t),"toggled",GTK_SIGNAL_FUNC(loopback_toggled),NULL);
|
|
Packit Service |
b98cfc |
if(snd_ctl_elem_value_get_integer(val,0))
|
|
Packit Service |
b98cfc |
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(t),TRUE);
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
gtk_box_pack_start(GTK_BOX(box),t,TRUE,TRUE,0);
|
|
Packit Service |
b98cfc |
|
|
Packit Service |
b98cfc |
return box;
|
|
Packit Service |
b98cfc |
}
|