Skip to content

Commit

Permalink
Fixed Audrey and amixer code for issue hollie#330.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmatis committed Dec 16, 2013
1 parent 91867fe commit ac7403a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
12 changes: 6 additions & 6 deletions code/common/pa_control.pl
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ sub pa_parms_stub {
my $results = $pactrl->prep_parms($parms);
my %pa_zones = $pactrl->get_pa_zones();

if (defined $pa_zones{audrey} && $pa_zones{audrey} ne '') {
print_log("PA: audrey zone detected, hooking via web_hook. (".$pa_zones{audrey}.")") if $Debug{pa};
if (defined $pa_zones{all}{audrey} && $pa_zones{all}{audrey} ne '') {
print_log("PA: audrey zone detected, hooking via web_hook. (".$pa_zones{all}{audrey}.")") if $Debug{pa};
push(@{$parms->{web_hook}},\&pa_web_hook);
}

Expand Down Expand Up @@ -129,8 +129,7 @@ sub pa_control_stub {
my $mode = $parms{pa_mode};
return if $mode eq 'mute' or $mode eq 'offline';

my $rooms = $parms{rooms};
print_log("PA: control_stub: rooms=$rooms, mode=$mode") if $Debug{pa};
print_log("PA: control_stub: rooms=$parms{pa_zones}, mode=$mode") if $Debug{pa};
my $results = $pactrl->audio_hook(ON,\%parms);
print_log("PA: control_stub set results: $results") if $Debug{pa} >=2;
set $pa_speaker_timer $pa_timer if $results;
Expand Down Expand Up @@ -210,9 +209,10 @@ sub pa_web_hook {
used.
Serial: The name of the serial port that you use for communcating to the IO device.
The default is "weeder". Note that this can be changed with an INI parm.
Leave this blank unless the "Type" of the PA control line is wdio, wdio_old or
aviosys. The default is "weeder". Note that this can be changed with an INI parm.
Other: Optional. Sets the type of PA control. Defaults to 'wdio'. Available options are:
Type: Optional. Sets the type of PA control. Defaults to 'wdio'. Available options are:
wdio,wdio_old,X10,xpl,xap,audrey,amixer,object
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Expand Down
11 changes: 8 additions & 3 deletions lib/PAobj.pm
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,14 @@ sub prep_parms
my $ref = &::get_object_by_name("pa_$room");
my $type = $ref->get_type();
&::print_log("PAobj: speakers_$type: Adding $room") if $main::Debug{pa} >=3;
$pa_zone_types{$type}++ unless $pa_zone_types{$type};
# $pa_zone_types{$type}++ unless $pa_zone_types{$type};
push(@{$speakertype{$type}}, $room);
}

foreach my $type (keys(%pa_zone_types)) {
undef $pa_zones{active}{$type};
}

foreach my $type (keys(%speakertype)) {
my @thespeakers = @{$speakertype{$type}};
&::print_log("PAobj: speakers_$type: ".($#thespeakers+1).": " . join(',',@thespeakers)) if $main::Debug{pa};
Expand Down Expand Up @@ -614,8 +618,9 @@ sub new
if(lc $paz_type eq 'amixer') {
#Headphone:0:L
my ($mixer,$mixernum,$channel) = split(':',$self->{address});
&main::print_log("$mixer / $mixernum / $channel");
$self->{mixer} = "$mixer,$mixernum";
&::print_log("$mixer / $mixernum / $channel");
$self->{mixer} = "$mixer";
$self->{mixer} .= ",$mixernum" if $mixernum;
$self->{mixerchan} = lc $channel if $channel;
}

Expand Down

0 comments on commit ac7403a

Please sign in to comment.