mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 03:25:43 +01:00
Fixed one-card operations...
This commit is contained in:
parent
6c9844d3dc
commit
4809266783
1 changed files with 27 additions and 17 deletions
|
@ -63,6 +63,28 @@ static void help( void )
|
||||||
printf( " from configuration file\n" );
|
printf( " from configuration file\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int collect_all( void )
|
||||||
|
{
|
||||||
|
int idx, err;
|
||||||
|
unsigned int card_mask;
|
||||||
|
|
||||||
|
card_mask = snd_cards_mask();
|
||||||
|
if ( !card_mask ) {
|
||||||
|
error( "No soundcards found..." );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
soundcard_setup_init();
|
||||||
|
for ( idx = 0; idx < 32; idx++ ) {
|
||||||
|
if ( card_mask & (1 << idx) ) { /* find each installed soundcards */
|
||||||
|
if ( (err = soundcard_setup_collect( idx )) ) {
|
||||||
|
soundcard_setup_done();
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int store_setup( const char *cardname )
|
static int store_setup( const char *cardname )
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
@ -92,7 +114,8 @@ static int store_setup( const char *cardname )
|
||||||
error( "Cannot find soundcard '%s'...", cardname );
|
error( "Cannot find soundcard '%s'...", cardname );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
soundcard_setup_init();
|
if ( (err = collect_all()) )
|
||||||
|
return err;
|
||||||
if ( (err = soundcard_setup_load( cfgfile )) )
|
if ( (err = soundcard_setup_load( cfgfile )) )
|
||||||
return err;
|
return err;
|
||||||
if ( (err = soundcard_setup_collect( cardno )) ) {
|
if ( (err = soundcard_setup_collect( cardno )) ) {
|
||||||
|
@ -107,8 +130,7 @@ static int store_setup( const char *cardname )
|
||||||
|
|
||||||
static int restore_setup( const char *cardname )
|
static int restore_setup( const char *cardname )
|
||||||
{
|
{
|
||||||
int err, idx, cardno = -1;
|
int err, cardno = -1;
|
||||||
unsigned int card_mask;
|
|
||||||
|
|
||||||
if ( cardname ) {
|
if ( cardname ) {
|
||||||
cardno = snd_card_name( cardname );
|
cardno = snd_card_name( cardname );
|
||||||
|
@ -117,20 +139,8 @@ static int restore_setup( const char *cardname )
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
card_mask = snd_cards_mask();
|
if ( (err = collect_all()) )
|
||||||
if ( !card_mask ) {
|
|
||||||
error( "No soundcards found..." );
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
soundcard_setup_init();
|
|
||||||
for ( idx = 0; idx < 32; idx++ ) {
|
|
||||||
if ( card_mask & (1 << idx) ) { /* find each installed soundcards */
|
|
||||||
if ( (err = soundcard_setup_collect( idx )) ) {
|
|
||||||
soundcard_setup_done();
|
|
||||||
return err;
|
return err;
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ( (err = soundcard_setup_load( cfgfile )) )
|
if ( (err = soundcard_setup_load( cfgfile )) )
|
||||||
return err;
|
return err;
|
||||||
err = soundcard_setup_process( cardno );
|
err = soundcard_setup_process( cardno );
|
||||||
|
|
Loading…
Reference in a new issue