Line | |
---|
1 | package Ocsinventory::Agent::Backend::OS::MacOS::Sound; |
---|
2 | use strict; |
---|
3 | |
---|
4 | |
---|
5 | sub check { |
---|
6 | return(undef) unless -r '/usr/sbin/system_profiler'; # check perms |
---|
7 | return 1; |
---|
8 | } |
---|
9 | |
---|
10 | sub run { |
---|
11 | my $params = shift; |
---|
12 | my $common = $params->{common}; |
---|
13 | |
---|
14 | # create profiler obj, bail if datatype fails |
---|
15 | my $data = $common->get_sysprofile_devices_names('SPAudioDataType'); |
---|
16 | |
---|
17 | return(undef) unless(ref($data) eq 'ARRAY'); |
---|
18 | |
---|
19 | # add sound cards |
---|
20 | foreach my $sound (@$data){ |
---|
21 | $common->addSound({ |
---|
22 | 'NAME' => $sound, |
---|
23 | 'MANUFACTURER' => $sound, |
---|
24 | 'DESCRIPTION' => $sound, |
---|
25 | }); |
---|
26 | } |
---|
27 | } |
---|
28 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.