<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:PeerSDK.Samples"
    x:Class="PeerSDK.Samples.PlaybackStreamWindow"
    WindowStartupLocation="CenterScreen"
    Title="Live Stream"
    Width="640"
    Height="640"
    FontFamily="Verdana"
    FontSize="16"
    Closed="Window_Closed"
    ShowInTaskbar="false"
    >

    <Window.Resources>
        <local:IrfFrameTypeConverter x:Key="converter" />
    </Window.Resources>

    <StackPanel>
        <Button Click="Start_OnClick">Start</Button>
        <ComboBox ItemsSource="{Binding Available}" SelectedIndex="{Binding Stream.Active}" />

        <StackPanel Orientation="Horizontal">
            <Label Content="Download rate:" />
            <Label Content="{Binding DownloadRate}" />
            <Label Content="Bytes" />
        </StackPanel>

        <Grid>
            <StackPanel Visibility="{Binding Type,Converter={StaticResource converter},ConverterParameter=Video}">
                <Label>Video</Label>
                <StackPanel Orientation="Horizontal">
                    <Label>Type:</Label>
                    <Label Content="{Binding Video.Type}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label>Channel:</Label>
                    <Label Content="{Binding Video.Channel}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label>Buffer length:</Label>
                    <Label Content="{Binding Video.Buffer.Length}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label>PTS:</Label>
                    <Label Content="{Binding Video.PTS}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label>Time:</Label>
                    <Label Content="{Binding Video.Time}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label>Width:</Label>
                    <Label Content="{Binding Video.Width}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label>Height:</Label>
                    <Label Content="{Binding Video.Height}" />
                </StackPanel>
            </StackPanel>
            <StackPanel Visibility="{Binding Type,Converter={StaticResource converter},ConverterParameter=Audio}">
                <Label>Audio</Label>
                <StackPanel Orientation="Horizontal">
                    <Label>Type:</Label>
                    <Label Content="{Binding Audio.Type}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label>Channel:</Label>
                    <Label Content="{Binding Audio.Channel}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label>Buffer length:</Label>
                    <Label Content="{Binding Audio.Buffer.Length}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label>PTS:</Label>
                    <Label Content="{Binding Audio.PTS}" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <Label>Time:</Label>
                    <Label Content="{Binding Audio.Time}" />
                </StackPanel>
            </StackPanel>
        </Grid>
    </StackPanel>

</Window>