add a new command line option: --show-sound-devices
This commit is contained in:
parent
b4b3f62717
commit
a3b66adf51
1 changed files with 19 additions and 6 deletions
|
@ -45,6 +45,7 @@
|
|||
#include <simgear/misc/sgstream.hxx>
|
||||
#include <simgear/misc/sg_path.hxx>
|
||||
#include <simgear/scene/material/mat.hxx>
|
||||
#include <simgear/sound/soundmgr_openal.hxx>
|
||||
|
||||
// #include <Include/general.hxx>
|
||||
// #include <Airports/simple.hxx>
|
||||
|
@ -81,7 +82,8 @@ enum
|
|||
FG_OPTIONS_ERROR = 2,
|
||||
FG_OPTIONS_EXIT = 3,
|
||||
FG_OPTIONS_VERBOSE_HELP = 4,
|
||||
FG_OPTIONS_SHOW_AIRCRAFT = 5
|
||||
FG_OPTIONS_SHOW_AIRCRAFT = 5,
|
||||
FG_OPTIONS_SHOW_SOUND_DEVICES = 6
|
||||
};
|
||||
|
||||
static double
|
||||
|
@ -1503,6 +1505,8 @@ parse_option (const string& arg)
|
|||
return(FG_OPTIONS_VERBOSE_HELP);
|
||||
} else if ( arg.find( "--show-aircraft") == 0) {
|
||||
return(FG_OPTIONS_SHOW_AIRCRAFT);
|
||||
} else if ( arg.find( "--show-sound-devices") == 0) {
|
||||
return(FG_OPTIONS_SHOW_SOUND_DEVICES);
|
||||
} else if ( arg.find( "--prop:" ) == 0 ) {
|
||||
if (!set_property(arg.substr(7))) {
|
||||
SG_LOG( SG_GENERAL, SG_ALERT, "Bad property assignment: " << arg );
|
||||
|
@ -1618,11 +1622,20 @@ fgParseArgs (int argc, char **argv)
|
|||
verbose = true;
|
||||
|
||||
else if (result == FG_OPTIONS_SHOW_AIRCRAFT) {
|
||||
fgOptLogLevel( "alert" );
|
||||
SGPath path( globals->get_fg_root() );
|
||||
path.append("Aircraft");
|
||||
fgShowAircraft(path, true);
|
||||
exit(0);
|
||||
fgOptLogLevel( "alert" );
|
||||
SGPath path( globals->get_fg_root() );
|
||||
path.append("Aircraft");
|
||||
fgShowAircraft(path, true);
|
||||
exit(0);
|
||||
|
||||
} else if (result == FG_OPTIONS_SHOW_SOUND_DEVICES) {
|
||||
SGSoundMgr smgr;
|
||||
vector <const char*>devices = smgr.get_available_devices();
|
||||
for (int i=0; i<devices.size(); i++) {
|
||||
printf("%i. \"%s\"\n", i, devices[i]);
|
||||
}
|
||||
devices.clear();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
else if (result == FG_OPTIONS_EXIT)
|
||||
|
|
Loading…
Add table
Reference in a new issue