Cleanup: style
This commit is contained in:
@@ -184,17 +184,18 @@ void BKE_sound_init(struct Main *bmain)
|
|||||||
specs.format = U.audioformat;
|
specs.format = U.audioformat;
|
||||||
specs.rate = U.audiorate;
|
specs.rate = U.audiorate;
|
||||||
|
|
||||||
if (force_device == NULL)
|
if (force_device == NULL) {
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
char **names = BKE_sound_get_device_names();
|
char **names = BKE_sound_get_device_names();
|
||||||
device_name = names[0];
|
device_name = names[0];
|
||||||
|
|
||||||
// make sure device is within the bounds of the array
|
/* make sure device is within the bounds of the array */
|
||||||
for(i = 0; names[i]; i++)
|
for (i = 0; names[i]; i++) {
|
||||||
if(i == device)
|
if (i == device) {
|
||||||
device_name = names[i];
|
device_name = names[i];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
device_name = force_device;
|
device_name = force_device;
|
||||||
|
|
||||||
@@ -238,11 +239,11 @@ void BKE_sound_exit_once(void)
|
|||||||
AUD_exitOnce();
|
AUD_exitOnce();
|
||||||
|
|
||||||
#ifdef WITH_SYSTEM_AUDASPACE
|
#ifdef WITH_SYSTEM_AUDASPACE
|
||||||
if(audio_device_names != NULL)
|
if (audio_device_names != NULL) {
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; audio_device_names[i]; i++)
|
for (i = 0; audio_device_names[i]; i++) {
|
||||||
free(audio_device_names[i]);
|
free(audio_device_names[i]);
|
||||||
|
}
|
||||||
free(audio_device_names);
|
free(audio_device_names);
|
||||||
audio_device_names = NULL;
|
audio_device_names = NULL;
|
||||||
}
|
}
|
||||||
@@ -836,8 +837,7 @@ float BKE_sound_get_length(bSound *sound)
|
|||||||
|
|
||||||
char **BKE_sound_get_device_names(void)
|
char **BKE_sound_get_device_names(void)
|
||||||
{
|
{
|
||||||
if(audio_device_names == NULL)
|
if (audio_device_names == NULL) {
|
||||||
{
|
|
||||||
#ifdef WITH_SYSTEM_AUDASPACE
|
#ifdef WITH_SYSTEM_AUDASPACE
|
||||||
audio_device_names = AUD_getDeviceNames();
|
audio_device_names = AUD_getDeviceNames();
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -616,8 +616,7 @@ static EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C), Poi
|
|||||||
|
|
||||||
char **names = BKE_sound_get_device_names();
|
char **names = BKE_sound_get_device_names();
|
||||||
|
|
||||||
for(i = 0; names[i]; i++)
|
for (i = 0; names[i]; i++) {
|
||||||
{
|
|
||||||
EnumPropertyItem new_item = {i, names[i], 0, names[i], names[i]};
|
EnumPropertyItem new_item = {i, names[i], 0, names[i], names[i]};
|
||||||
RNA_enum_item_add(&item, &totitem, &new_item);
|
RNA_enum_item_add(&item, &totitem, &new_item);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user