Click here to Skip to main content
15,884,237 members
Articles / Desktop Programming / Windows Forms

BSEtunes

Rate me:
Please Sign up or sign in to vote.
4.67/5 (11 votes)
24 Apr 2010CPOL4 min read 64.6K   4.3K   58  
BSEtunes is a MySQL based, full manageable, networkable single or multiuser jukebox application
<Window x:Class="BSE.CoverFlow.WPFLib.WindowCoverFlow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="WindowCoverFlow" Height="500" Width="500" xmlns:CoverFlow="clr-namespace:BSE.CoverFlow.WPFLib" PreviewKeyDown="WindowPreviewKeyDown" Loaded="WindowLoaded" Closing="WindowClosing">
    <Window.Resources>
        <ResourceDictionary>
            <ModelVisual3D x:Key="modelVisual3D">
                <ModelVisual3D.Content>
                    <Model3DGroup>
                        <Model3DGroup.Transform>
                            <Transform3DGroup>
                                <RotateTransform3D CenterX="0" CenterY="0" CenterZ="0">
                                    <RotateTransform3D.Rotation>
                                        <AxisAngleRotation3D Angle="72" Axis="0,1,0"/>
                                    </RotateTransform3D.Rotation>
                                </RotateTransform3D>
                                <TranslateTransform3D OffsetX="0.0" OffsetY="0.0" OffsetZ="0.0"/>
                            </Transform3DGroup>
                        </Model3DGroup.Transform>
                        <GeometryModel3D>
                            <GeometryModel3D.Geometry>
                                <MeshGeometry3D
                            Normals="0,0,4 0,0,4 0,0,4 0,0,4 0,0,4 0,0,4"
                            Positions="-1,-1,0 1,-1,0 1,1,0 -1,1,0"
                            TextureCoordinates="0,1 1,1 1,0 0,0 1,0 1,1"
                            TriangleIndices="0 1 2 2 3 0" />
                            </GeometryModel3D.Geometry>
                            <GeometryModel3D.Material>
                                <MaterialGroup>
                                    <DiffuseMaterial>
                                        <DiffuseMaterial.Brush>
                                            <ImageBrush ImageSource="/BSE.CoverFlow.WPFLib;component/Images/Note.jpg"/>
                                        </DiffuseMaterial.Brush>
                                    </DiffuseMaterial>
                                </MaterialGroup>
                            </GeometryModel3D.Material>
                        </GeometryModel3D>
                        <GeometryModel3D>
                            <GeometryModel3D.Geometry>
                                <MeshGeometry3D
                            Normals="0,0,4 0,0,4 0,0,4 0,0,4 0,0,4 0,0,4"
                            Positions="-1,-3,0 1,-3,0 1,-1,0 -1,-1,0"
                            TextureCoordinates="0,0 1,0 1,1 0,1 1,1 1,0"
                            TriangleIndices="0 1 2 2 3 0" />
                            </GeometryModel3D.Geometry>
                            <GeometryModel3D.Material>
                                <MaterialGroup>
                                    <DiffuseMaterial>
                                        <DiffuseMaterial.Brush>
                                            <ImageBrush ImageSource="/BSE.CoverFlow.WPFLib;component/Images/Note.jpg"/>
                                        </DiffuseMaterial.Brush>
                                    </DiffuseMaterial>
                                </MaterialGroup>
                            </GeometryModel3D.Material>
                        </GeometryModel3D>
                    </Model3DGroup>
                </ModelVisual3D.Content>
            </ModelVisual3D>
            <Storyboard x:Key="modelAnimation">
                <Rotation3DAnimation Duration="0:0:0.5" DecelerationRatio="0.5" Storyboard.TargetProperty="(Viewport3D.Children)[2].(ModelVisual3D.Children)[0].(ModelVisual3D.Content).(Model3DGroup.Transform).(Transform3DGroup.Children)[1].(RotateTransform3D.Rotation).(AxisAngleRotation3D.Angle)">
                    <Rotation3DAnimation.To>
                        <AxisAngleRotation3D Axis="0,1,0"
										 Angle="0" />
                    </Rotation3DAnimation.To>
                </Rotation3DAnimation>
                <DoubleAnimation Duration="0:0:0.5" To="0" DecelerationRatio="0.5" Storyboard.TargetProperty="(Viewport3D.Children)[2].(ModelVisual3D.Children)[0].(ModelVisual3D.Content).(Model3DGroup.Transform).(Transform3DGroup.Children)[1].(TranslateTransform3D.OffsetX)" />
                <DoubleAnimation Duration="0:0:0.5" To="0" DecelerationRatio="0.5" Storyboard.TargetProperty="(Viewport3D.Children)[2].(ModelVisual3D.Children)[0].(ModelVisual3D.Content).(Model3DGroup.Transform).(Transform3DGroup.Children)[1].(TranslateTransform3D.OffsetY)"/>
                <DoubleAnimation Duration="0:0:0.5" To="0" DecelerationRatio="0.5" Storyboard.TargetProperty="(Viewport3D.Children)[2].(ModelVisual3D.Children)[0].(ModelVisual3D.Content).(Model3DGroup.Transform).(Transform3DGroup.Children)[1].(TranslateTransform3D.OffsetZ)"/>
            </Storyboard>
            <Image x:Key="m_imgDefault" Source="/BSE.CoverFlow.WPFLib;component/Images/Note.jpg"/>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources\RoundGlassButton.xaml"/>
                <ResourceDictionary Source="Resources\PlayButton.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <DockPanel>
        <DockPanel.Background>
            <SolidColorBrush Color="Black"></SolidColorBrush>
        </DockPanel.Background>
        <DockPanel DockPanel.ZIndex="99" DockPanel.Dock="Bottom" Height="100">
            <Border BorderBrush="Black" BorderThickness="0" CornerRadius="30" Padding="2" HorizontalAlignment="Center" VerticalAlignment="Center">
                <StackPanel>
                    <TextBlock Name="m_txtSong" Height="30" TextAlignment="Center" Foreground="White" FontSize="20" IsHitTestVisible="False" IsHyphenationEnabled="True" TextTrimming="WordEllipsis" FontWeight="Bold"></TextBlock>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Width="370" VerticalAlignment="Center" Opacity="1" Height="50" Grid.IsSharedSizeScope="True" Margin="10">
                        <CoverFlow:PlayButton x:Name="m_btnStop" Height="25" Width="80" Background="#FFFFFFFF" Style="{StaticResource PlayButton}" Click="BtnStopClick" IsTabStop="False">
                            <Image Name="m_imgStop" Margin="0" Width="23" Height="23" Source="/BSE.CoverFlow.WPFLib;component/Images/stop.png"/>
                        </CoverFlow:PlayButton>
                        <CoverFlow:PlayButton x:Name="m_btnPrevious" Height="25" Width="80" Style="{StaticResource PlayButton}" Background="#FFFFFFFF" IsEnabled="True" IsEnabledChanged="BtnPreviousIsEnabledChanged" Click="BtnPreviousClick" IsTabStop="False">
                            <Image x:Name="m_imgPrevious" Margin="0" Width="23" Height="23" Source="/BSE.CoverFlow.WPFLib;component/Images/previous.png"/>
                        </CoverFlow:PlayButton>
                        <CoverFlow:StartButton x:Name="m_btnPlay" Background="Blue" Height="50" Width="50" Style="{StaticResource RoundGlassButton}" OverridesDefaultStyle="True" DisplayStateChanged="BtnPlayDisplayStateChanged" Click="BtnPlayClick" IsTabStop="True" Focusable="True">
                            <Image Name="m_imgPlay" Margin="2,0,0,0" Width="40" Height="40" Source="/BSE.CoverFlow.WPFLib;component/Images/PlayButton.png"/>
                        </CoverFlow:StartButton>
                        <CoverFlow:PlayButton x:Name="m_btnNext" Reversed="True" Height="25" Width="80" Style="{StaticResource PlayButton}" Background="#FFFFFFFF" IsEnabledChanged="BtnNextIsEnabledChanged" Click="BtnNextClick" IsTabStop="False">
                            <Image Name="m_imgNext" Margin="0" Width="23" Height="23" Source="/BSE.CoverFlow.WPFLib;component/Images/next.png"/>
                        </CoverFlow:PlayButton>
                        <CoverFlow:PlayButton x:Name="m_btnClose" Reversed="True" Height="25" Width="80" Style="{StaticResource PlayButton}" Background="#FFFFFFFF" Click="BtnCloseClick" IsTabStop="False">
                            <Image Margin="0" Width="23" Height="23" Source="/BSE.CoverFlow.WPFLib;component/Images/exit.png"/>
                        </CoverFlow:PlayButton>
                    </StackPanel>
                </StackPanel>
            </Border>
        </DockPanel>
        <Viewport3D x:Name="m_viewPort3D" ClipToBounds="False" MouseDown="WindowMouseDown" DockPanel.Dock="Top">
            <Viewport3D.Camera>
                <PerspectiveCamera Position="0,0,3"
                                   UpDirection="0,1,0" LookDirection="0,0,-1"
                                   FieldOfView="100" NearPlaneDistance="0.125"/>
            </Viewport3D.Camera>
            <Viewport3D.Children>
                <ModelVisual3D>
                    <ModelVisual3D.Content>
                        <AmbientLight Color="White"/>
                    </ModelVisual3D.Content>
                </ModelVisual3D>
                <ModelVisual3D>
                    <ModelVisual3D.Content>
                        <DirectionalLight Color="White" Direction="-1,0,-3" />
                    </ModelVisual3D.Content>
                </ModelVisual3D>
                <ModelVisual3D x:Name="m_visualModel"/>
            </Viewport3D.Children>
        </Viewport3D>
    </DockPanel>
</Window>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Switzerland Switzerland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions