2 * An example showing how to enumerate available devices and show its
10 int main(int argc
, char *argv
[])
12 alure::DeviceManager devMgr
= alure::DeviceManager::get();
13 alure::Vector
<alure::String
> list
;
14 alure::String defname
;
16 list
= devMgr
.enumerate(alure::DeviceEnumeration::Basic
);
17 defname
= devMgr
.defaultDeviceName(alure::DefaultDeviceType::Basic
);
18 std::cout
<< "Available basic devices:\n";
19 for(const auto &name
: list
)
20 std::cout
<< " "<<name
<<((defname
==name
)?" [DEFAULT]":"") <<'\n';
23 list
= devMgr
.enumerate(alure::DeviceEnumeration::Full
);
24 defname
= devMgr
.defaultDeviceName(alure::DefaultDeviceType::Full
);
25 std::cout
<< "Available devices:\n";
26 for(const auto &name
: list
)
27 std::cout
<< " "<<name
<<((defname
==name
)?" [DEFAULT]":"") <<'\n';
30 list
= devMgr
.enumerate(alure::DeviceEnumeration::Capture
);
31 defname
= devMgr
.defaultDeviceName(alure::DefaultDeviceType::Capture
);
32 std::cout
<< "Available capture devices:\n";
33 for(const auto &name
: list
)
34 std::cout
<< " "<<name
<<((defname
==name
)?" [DEFAULT]":"") <<'\n';
37 alure::Device dev
= devMgr
.openPlayback((argc
> 1) ? argv
[1] : "");
38 std::cout
<< "Info for device \""<<dev
.getName(alure::PlaybackName::Full
)<<"\":" <<std::endl
;
39 alure::Version version
= dev
.getALCVersion();
40 std::cout
<< "ALC version: "<<version
.getMajor()<<"."<<version
.getMinor() <<std::endl
;
41 version
= dev
.getEFXVersion();
44 std::cout
<< "EFX version: "<<version
.getMajor()<<"."<<version
.getMinor() <<'\n';
45 std::cout
<< "Max auxiliary sends: "<<dev
.getMaxAuxiliarySends() <<std::endl
;
48 std::cout
<< "EFX not supported" <<std::endl
;