<UserControl x:Class="FeenPhone.WPFApp.Controls.AudioOutWPF"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             Background="{StaticResource clrBackgroundPrimary}"
             d:DesignHeight="100" d:DesignWidth="300">
    <DockPanel>
        <TextBlock Background="{StaticResource clrBackgroundHeaders}" DockPanel.Dock="Top" TextAlignment="Center">AUDIO OUT</TextBlock>
        <StackPanel Name="stack">
            <DockPanel>
                <Border BorderBrush="Black" BorderThickness="0 1 0 1" Background="{StaticResource clrBackgroundHeaders}">
                    <Label DockPanel.Dock="Left" VerticalAlignment="Center">
                        <Label.LayoutTransform>
                            <TransformGroup>
                                <RotateTransform Angle="-90"/>
                            </TransformGroup>
                        </Label.LayoutTransform>
                        MASTER
                    </Label>
                </Border>
                <DockPanel DockPanel.Dock="Right" Background="{StaticResource clrBackgroundPrimary}">
                    <ProgressBar Orientation="Vertical" Width="20" Minimum="0" Maximum="100" Value="{Binding TotalOutputLevelPercent}"></ProgressBar>
                    <Grid IsEnabled="{Binding LevelManager, Converter={StaticResource NullToBoolConverter}}">
                        <Slider 
                        Orientation="Vertical"
                        Minimum="{Binding LevelManager.Min}" 
                        Maximum="{Binding LevelManager.Max}" 
                        Value="{Binding LevelManager.Level, Mode=TwoWay}" 
                        IsEnabled="{Binding LevelManager.IsAttached}" 
                    />
                    </Grid>
                    <Image Margin="0 0 5 0" DockPanel.Dock="Left" Height="64" Source="/FeenPhone;component/WPFApp/Resources/Images/Headhone_64.png" />
                    <StackPanel>
                        <Label HorizontalAlignment="Left">Output Device</Label>
                        <DockPanel>
                            <WrapPanel DockPanel.Dock="Right" Visibility="Collapsed" >
                                <ToggleButton Width="16" 
                                      IsChecked="{Binding UseWaveEvent}" 
                                      Visibility="{Binding SelectedOutput.IsWaveDevice, Converter={StaticResource BoolToVisConverter}}"
                                      ToolTip="Use WaveEvent Output">
                                    <Image Height="16" Source="/FeenPhone;component/WPFApp/Resources/Images/Event.png"  />
                                </ToggleButton>
                                <CheckBox VerticalAlignment="Center" IsChecked="{Binding ShouldRampUnderruns}" ToolTip="Should ramp underruns"></CheckBox>
                            </WrapPanel>
                            <ComboBox
                                ItemsSource="{Binding Path=OutputList, Mode=TwoWay}"
                                SelectedItem="{Binding Path=SelectedOutput, Mode=TwoWay}" />
                        </DockPanel>
                    </StackPanel>
                </DockPanel>
            </DockPanel>
            <ItemsControl ItemsSource="{Binding Path=AudioPlayers}" d:DataContext="{d:DesignData Source=SampleData/UserAudioPlayerList.xaml}"/>
        </StackPanel>
    </DockPanel>
</UserControl>
