diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-02-23 10:15:45 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-02-23 10:15:45 -0500 |
commit | c758cdf4f6e959b92683f2dba6ce8617ac4f0a83 (patch) | |
tree | 36e2664048b4ba9d6925b33281afcab2a0aab53d /drivers/alsa/hammerfall.c | |
parent | 25786b77b700abbcce664e7e39504a2b0dd1f0c8 (diff) | |
download | jack1-c758cdf4f6e959b92683f2dba6ce8617ac4f0a83.tar.gz |
uncrustification of jack source code
Diffstat (limited to 'drivers/alsa/hammerfall.c')
-rw-r--r-- | drivers/alsa/hammerfall.c | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/drivers/alsa/hammerfall.c b/drivers/alsa/hammerfall.c index fcb9add..531d73a 100644 --- a/drivers/alsa/hammerfall.c +++ b/drivers/alsa/hammerfall.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2001 Paul Davis + Copyright (C) 2001 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ + */ #include "hardware.h" #include "alsa_driver.h" @@ -26,7 +26,7 @@ * warning: `hammerfall_monitor_controls' defined but not used */ #define HAMMERFALL_MONITOR_CONTROLS 0 -static void +static void set_control_id (snd_ctl_elem_id_t *ctl, const char *name) { snd_ctl_elem_id_set_name (ctl, name); @@ -57,9 +57,8 @@ hammerfall_broadcast_channel_status_change (hammerfall_t *h, int lock, int sync, status |= NoSync; } - for (chn = lowchn; chn < highchn; chn++) { + for (chn = lowchn; chn < highchn; chn++) alsa_driver_set_clock_sync_status (h->driver, chn, status); - } } static void @@ -74,12 +73,12 @@ hammerfall_check_sync_state (hammerfall_t *h, int val, int adat_id) XXX - maybe need to make sure that the rate matches our idea of the current rate ? - */ + */ if (!h->said_that_spdif_is_fine) { ClockSyncStatus status; - - status = Lock|Sync; + + status = Lock | Sync; /* XXX broken! fix for hammerfall light ! */ @@ -91,10 +90,10 @@ hammerfall_check_sync_state (hammerfall_t *h, int val, int adat_id) lock = (val & 0x1) ? TRUE : FALSE; sync = (val & 0x2) ? TRUE : FALSE; - + if (h->lock_status[adat_id] != lock || h->sync_status[adat_id] != sync) { - hammerfall_broadcast_channel_status_change (h, lock, sync, adat_id*8, (adat_id*8)+8); + hammerfall_broadcast_channel_status_change (h, lock, sync, adat_id * 8, (adat_id * 8) + 8); } h->lock_status[adat_id] = lock; @@ -108,7 +107,7 @@ hammerfall_check_sync (hammerfall_t *h, snd_ctl_elem_value_t *ctl) const char *name; int val; snd_ctl_elem_id_t *ctl_id; - + jack_info ("check sync"); snd_ctl_elem_id_alloca (&ctl_id); @@ -131,38 +130,37 @@ hammerfall_check_sync (hammerfall_t *h, snd_ctl_elem_value_t *ctl) } #endif /* HAMMERFALL_MONITOR_CONTROLS */ -static int +static int hammerfall_set_input_monitor_mask (jack_hardware_t *hw, unsigned long mask) { - hammerfall_t *h = (hammerfall_t *) hw->private; + hammerfall_t *h = (hammerfall_t*)hw->private; snd_ctl_elem_value_t *ctl; snd_ctl_elem_id_t *ctl_id; int err; int i; - + snd_ctl_elem_value_alloca (&ctl); snd_ctl_elem_id_alloca (&ctl_id); set_control_id (ctl_id, "Channels Thru"); snd_ctl_elem_value_set_id (ctl, ctl_id); - - for (i = 0; i < 26; i++) { - snd_ctl_elem_value_set_integer (ctl, i, (mask & (1<<i)) ? 1 : 0); - } - + + for (i = 0; i < 26; i++) + snd_ctl_elem_value_set_integer (ctl, i, (mask & (1 << i)) ? 1 : 0); + if ((err = snd_ctl_elem_write (h->driver->ctl_handle, ctl)) != 0) { jack_error ("ALSA/Hammerfall: cannot set input monitoring (%s)", snd_strerror (err)); return -1; } - + hw->input_monitor_mask = mask; return 0; } -static int -hammerfall_change_sample_clock (jack_hardware_t *hw, SampleClockMode mode) +static int +hammerfall_change_sample_clock (jack_hardware_t *hw, SampleClockMode mode) { - hammerfall_t *h = (hammerfall_t *) hw->private; + hammerfall_t *h = (hammerfall_t*)hw->private; snd_ctl_elem_value_t *ctl; snd_ctl_elem_id_t *ctl_id; int err; @@ -195,7 +193,7 @@ static void hammerfall_release (jack_hardware_t *hw) { - hammerfall_t *h = (hammerfall_t *) hw->private; + hammerfall_t *h = (hammerfall_t*)hw->private; void *status; if (h == 0) { @@ -212,8 +210,8 @@ hammerfall_release (jack_hardware_t *hw) static void * hammerfall_monitor_controls (void *arg) { - jack_hardware_t *hw = (jack_hardware_t *) arg; - hammerfall_t *h = (hammerfall_t *) hw->private; + jack_hardware_t *hw = (jack_hardware_t*)arg; + hammerfall_t *h = (hammerfall_t*)hw->private; snd_ctl_elem_id_t *switch_id[3]; snd_ctl_elem_value_t *sw[3]; @@ -250,7 +248,7 @@ hammerfall_monitor_controls (void *arg) jack_error ("cannot read control switch 0 ..."); } hammerfall_check_sync (h, sw[2]); - + if (nanosleep (&h->monitor_interval, 0)) { break; } @@ -267,9 +265,9 @@ jack_alsa_hammerfall_hw_new (alsa_driver_t *driver) jack_hardware_t *hw; hammerfall_t *h; - hw = (jack_hardware_t *) malloc (sizeof (jack_hardware_t)); + hw = (jack_hardware_t*)malloc (sizeof(jack_hardware_t)); - hw->capabilities = Cap_HardwareMonitoring|Cap_AutoSync|Cap_WordClock|Cap_ClockMaster|Cap_ClockLockReporting; + hw->capabilities = Cap_HardwareMonitoring | Cap_AutoSync | Cap_WordClock | Cap_ClockMaster | Cap_ClockLockReporting; hw->input_monitor_mask = 0; hw->private = 0; @@ -277,7 +275,7 @@ jack_alsa_hammerfall_hw_new (alsa_driver_t *driver) hw->change_sample_clock = hammerfall_change_sample_clock; hw->release = hammerfall_release; - h = (hammerfall_t *) malloc (sizeof (hammerfall_t)); + h = (hammerfall_t*)malloc (sizeof(hammerfall_t)); h->lock_status[0] = FALSE; h->sync_status[0] = FALSE; |