Preparation to force an audio device via command line. Will be implemented by theeth.
This commit is contained in:
@@ -41,7 +41,7 @@ void sound_init();
|
||||
|
||||
void sound_exit();
|
||||
|
||||
void sound_disable();
|
||||
void sound_force_device(int device);
|
||||
|
||||
struct bSound* sound_new_file(struct Main *main, char* filename);
|
||||
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
static int sound_disabled = 0;
|
||||
static int force_device = -1;
|
||||
|
||||
void sound_disable()
|
||||
void sound_force_device(int device)
|
||||
{
|
||||
sound_disabled = 1;
|
||||
force_device = device;
|
||||
}
|
||||
|
||||
void sound_init()
|
||||
@@ -49,8 +49,8 @@ void sound_init()
|
||||
specs.format = U.audioformat;
|
||||
specs.rate = U.audiorate;
|
||||
|
||||
if (sound_disabled)
|
||||
device = 0;
|
||||
if(force_device >= 0)
|
||||
device = force_device;
|
||||
|
||||
if(buffersize < 128)
|
||||
buffersize = AUD_DEFAULT_BUFFER_SIZE;
|
||||
|
||||
@@ -487,7 +487,7 @@ int main(int argc, char **argv)
|
||||
else if (BLI_strcasecmp(argv[a], "-noglsl") == 0)
|
||||
GPU_extensions_disable();
|
||||
else if (BLI_strcasecmp(argv[a], "-noaudio") == 0)
|
||||
sound_disable();
|
||||
sound_force_device(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -527,7 +527,7 @@ int main(int argc, char **argv)
|
||||
case 'n':
|
||||
case 'N':
|
||||
if (BLI_strcasecmp(argv[a], "-noaudio") == 0)
|
||||
sound_disable();
|
||||
sound_force_device(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user