Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

BSEtunes

, 24 Apr 2010 CPOL
BSEtunes is a MySQL based, full manageable, networkable single or multiuser jukebox application
BSE.Platten.zip
BSE.Platten
BSE.Platten.vssscc
mssccprj.scc
vssver2.scc
BSE.CoverFlow.WPFLib
BSE.CoverFlow.WPFLib.csproj.user
BSE.CoverFlow.WPFLib.csproj.vspscc
mssccprj.scc
vssver2.scc
Images
close.png
exit.png
next.png
next_disabled.png
Note.jpg
pause.png
PlayButton.png
previous.png
previous_disabled.png
stop.png
vssver2.scc
Properties
Settings.settings
vssver2.scc
Resources
vssver2.scc
BSE.Platten.Admin
BSE.Platten.Admin.csproj.vspscc
mssccprj.scc
vssver2.scc
Properties
Settings.settings
vssver2.scc
Resources
Album16.gif
BSEadmin.ico
cdimport.png
cdrip.png
cd_hoeren.png
clearsearch.png
DataContainer_MoveFirsHS.png
DataContainer_MoveLastHS.png
DataContainer_MoveNextHS.png
DataContainer_MovePreviousHS.png
DataContainer_NewRecordHS.png
diskinfo.png
DRIVEDSC.png
DRIVENET.png
Edit_UndoHS.png
exportimage.png
findfile.png
FindHS.png
freedb.png
Genre16.png
Image.png
InsertPictureHS.png
Interpret16.png
OptionsHS.png
PieChart3DHS.png
PieChartHS.png
ProtectFormHS.png
RefreshDocViewHS.png
saveHS.png
search.png
song.png
system.png
tagger.png
tools_16.png
vssver2.scc
BSE.Platten.Admin.WinApp
BSE.Platten.Admin.WinApp.csproj.user
BSE.Platten.Admin.WinApp.csproj.vspscc
mssccprj.scc
vssver2.scc
Properties
Settings.settings
vssver2.scc
Resources
BSEadmin.ico
vssver2.scc
BSE.Platten.Audio
bse.ico
BSE.Platten.Audio.csproj.vspscc
mssccprj.scc
vssver2.scc
Options
vssver2.scc
Player
vssver2.scc
Properties
vssver2.scc
Resources
FillDownHS.png
FillLeftHS.png
Folder256.png
FolderFind.png
FolderOpen256.png
GoLtrHS.png
MoveNext.png
MovePrevious.png
OptionsHS.png
PauseHS.png
PlayHS.png
Slider.gif
Start.png
StopHS.png
vssver2.scc
WinControls
vssver2.scc
WMFSDK
vssver2.scc
BSE.Platten.BO
BSE.Platten.BO.csproj.vspscc
mssccprj.scc
vssver2.scc
Properties
vssver2.scc
BSE.Platten.Common
BSE.Platten.Common.csproj.vspscc
mssccprj.scc
vssver2.scc
Properties
vssver2.scc
Resources
BSEsplash.png
DRIVEDSC.png
DRIVENET.png
Network.png
splash.png
vssver2.scc
BSE.Platten.Covers
BSE.Platten.Covers.csproj.vspscc
mssccprj.scc
vssver2.scc
Properties
Settings.settings
vssver2.scc
BSE.Platten.FreeDb
BSE.Platten.FreeDb.csproj.vspscc
mssccprj.scc
vssver2.scc
Properties
vssver2.scc
Resources
OpenCD.png
vssver2.scc
BSE.Platten.Ripper
BSE.Platten.Ripper.csproj.vspscc
mssccprj.scc
vssver2.scc
Properties
vssver2.scc
Resources
OpenCD.png
OptionsHS.png
vssver2.scc
BSE.Platten.Statistik
BSE.Platten.Statistik.csproj.vspscc
mssccprj.scc
vssver2.scc
Properties
vssver2.scc
BSE.Platten.Tunes
BSE.Platten.Tunes.csproj.user
BSE.Platten.Tunes.csproj.vspscc
mssccprj.scc
vssver2.scc
Filters
vssver2.scc
Properties
Settings.settings
vssver2.scc
Resources
About.png
Album16.gif
AudioCD.png
AudioFile.png
AutoList.png
broadcast.png
BSE.png
BSEAbout.png
BSEsplash.png
BSEtunes.ico
BSE_16.png
cd_hoeren.png
coverflow.png
DataContainer_MoveNextHS.png
delete.gif
diskinfo.png
Filter2HS.png
FindHS.png
Folder256.png
FolderOpen256.png
Genre16.gif
Interpret16.gif
keinBild.gif
NewPlaylist16.gif
OptionsHS.png
PauseHS.png
RefreshDocViewHS.png
Removabledrive.png
saveHS.png
search.png
shuffle.png
Shuffle_icon.png
song.png
splash1.png
StopHS.png
TaskHS.png
TrackInfo.gif
vssver2.scc
wiedergabe16.gif
BSEadminSetup
BSEadminSetup.vdproj
BSEadminSetup.vdproj.vspscc
mssccprj.scc
vssver2.scc
Debug
Release
BSEtunesSetup
BSEtunesSetup.vdproj
BSEtunesSetup.vdproj.vspscc
mssccprj.scc
vssver2.scc
Debug
Release
dll
BSE.CDDrives.DLL
BSE.Charts.DLL
BSE.Configuration.DLL
BSE.RemovableDrives.DLL
BSE.Shell.DLL
BSE.Windows.Forms.DLL
Lame
lame_enc.dll
vssver2.scc
lame-3.97
BSE.Platten_en.zip
BSE.CoverFlow.WPFLib.csproj.user
close.png
exit.png
next.png
next_disabled.png
Note.jpg
pause.png
PlayButton.png
previous.png
previous_disabled.png
stop.png
vssver2.scc
Settings.settings
vssver2.scc
vssver2.scc
BSE.Platten.Admin.csproj.user
Settings.settings
vssver2.scc
Album16.gif
BSEadmin.ico
cdimport.png
cdrip.png
cd_hoeren.png
clearsearch.png
DataContainer_MoveFirsHS.png
DataContainer_MoveLastHS.png
DataContainer_MoveNextHS.png
DataContainer_MovePreviousHS.png
DataContainer_NewRecordHS.png
diskinfo.png
DRIVEDSC.png
DRIVENET.png
Edit_UndoHS.png
exportimage.png
findfile.png
FindHS.png
freedb.png
Genre16.png
Image.png
InsertPictureHS.png
Interpret16.png
OptionsHS.png
PieChart3DHS.png
PieChartHS.png
ProtectFormHS.png
RefreshDocViewHS.png
saveHS.png
search.png
song.png
system.png
tagger.png
tools_16.png
vssver2.scc
BSE.Platten.Admin.WinApp.csproj.user
Settings.settings
vssver2.scc
BSEadmin.ico
vssver2.scc
bse.ico
BSE.Platten.Audio.csproj.user
vssver2.scc
vssver2.scc
vssver2.scc
FillDownHS.png
FillLeftHS.png
Folder256.png
FolderFind.png
FolderOpen256.png
GoLtrHS.png
MoveNext.png
MovePrevious.png
OptionsHS.png
PauseHS.png
PlayHS.png
Slider.gif
Start.png
StopHS.png
vssver2.scc
vssver2.scc
vssver2.scc
BSE.Platten.BO.csproj.user
vssver2.scc
BSE.Platten.Common.csproj.user
vssver2.scc
BSEsplash.png
DRIVEDSC.png
DRIVENET.png
Network.png
splash.png
vssver2.scc
BSE.Platten.Covers.csproj.user
Settings.settings
vssver2.scc
BSE.Platten.FreeDb.csproj.user
vssver2.scc
OpenCD.png
vssver2.scc
AudioWriter
vssver2.scc
BSE.Platten.Ripper.csproj.user
Lame
vssver2.scc
vssver2.scc
OpenCD.png
OptionsHS.png
vssver2.scc
BSE.Platten.Statistik.csproj.user
vssver2.scc
BSE.Platten.Tunes.csproj.user
vssver2.scc
Settings.settings
vssver2.scc
About.png
Album16.gif
AudioCD.png
AudioFile.png
AutoList.png
broadcast.png
BSE.png
BSEAbout.png
BSEsplash.png
BSEtunes.ico
BSE_16.png
cd_hoeren.png
coverflow.png
DataContainer_MoveNextHS.png
delete.gif
diskinfo.png
Filter2HS.png
FindHS.png
Folder256.png
FolderOpen256.png
Genre16.gif
Interpret16.gif
keinBild.gif
NewPlaylist16.gif
OptionsHS.png
PauseHS.png
RefreshDocViewHS.png
Removabledrive.png
saveHS.png
search.png
shuffle.png
Shuffle_icon.png
song.png
splash1.png
StopHS.png
TaskHS.png
TrackInfo.gif
vssver2.scc
wiedergabe16.gif
BSEadminSetup.vdproj
BSEtunesSetup.vdproj
BSE.CDDrives.DLL
BSE.Charts.DLL
BSE.Configuration.DLL
BSE.RemovableDrives.DLL
BSE.Shell.DLL
BSE.ThreadedShell.DLL
BSE.Windows.Forms.DLL
lame_enc.dll
MySQL.chm.zip
MySQL.chm
MySqlCreateDataBase5x.sql.zip
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using System.ComponentModel;

namespace BSE.Platten.Audio
{
    /// <summary>
    /// Represents a Windows <see cref="BSE.Platten.Audio.Trackbar"/> control contained in a StatusStrip.
    /// </summary>
    [ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.ToolStrip | ToolStripItemDesignerAvailability.StatusStrip)]
    [ToolboxBitmap(typeof(System.Windows.Forms.TrackBar))]
    public class ToolStripTrackBar : ToolStripControlHost
    {
        #region Events
        /// <summary>
        /// Occurs when the Value property of a TrackBar changes.
        /// </summary>
        [Description("Occurs when the Value property of a TrackBar changes.")]
        public event EventHandler<EventArgs> ValueChanged;
        /// <summary>
        /// Occurs when either a mouse action moves the TrackBar slider.
        /// </summary>
        [Description("Occurs when either a mouse action moves the TrackBar slider.")]
        public event EventHandler<EventArgs> Scroll;
        /// <summary>
        /// Occurs when the ThumbState on the TrackBar changes.
        /// </summary>
        [Description("Occurs when the ThumbState on the TrackBar changes.")]
        public event EventHandler<ThumbStateChangedEventArgs> ThumbStateChanged;
        #endregion

        #region Properties
        /// <summary>
        /// Gets the TrackBar
        /// </summary>
        public TrackBar TrackBar
        {
            get { return Control as TrackBar; }
        }
        /// <summary>
        /// Gets or sets the displayed text on the trackbar.
        /// </summary>
        ///<value>
        /// Type: <see cref="System.String"/>
        /// </value>
        public new string Text
        {
            get { return TrackBar.Text; }
            set { TrackBar.Text = value; }
        }
        /// <summary>
        /// Gets or sets the upper limit of the range this <see cref="TrackBar"/> is working with.
        /// </summary>
        /// <value>
        /// Type: <see cref="System.Int32"/>
        /// The maximum value for the <see cref="TrackBar"/>. The default is 10.
        /// </value>
		[Category("Appearance")]
		[Description("The maximum value for the position of the slider on the TrackBar")]
		[DefaultValue(10)]
		[RefreshProperties(RefreshProperties.All)]
		public int Maximum
		{
			get { return TrackBar.Maximum; }
			set { TrackBar.Maximum = value; }
		}
        /// <summary>
        /// Gets or sets the lower limit of the range this <see cref="TrackBar"/> is working with.
        /// </summary>
        /// <value>
        /// Type: <see cref="System.Int32"/>
        /// The minimum value for the <see cref="TrackBar"/>. The default is 0.
        /// </value>
		[Category("Appearance")]
		[Description("The minimum value for the position of the slider on the TrackBar")]
		[DefaultValue(0)]
		[RefreshProperties(RefreshProperties.All)]
		public int Minimum
		{
			get { return TrackBar.Minimum; }
			set { TrackBar.Minimum = value; }
		}
        /// <summary>
        /// Gets or sets a numeric value that represents the current position of the scroll box on the track bar.
        /// </summary>
        /// <value>
        /// Type: <see cref="System.Int32"/>
        /// A numeric value that is within the <see cref="Minimum"/> and <see cref="Maximum"/> range. The default value is 0.
        /// </value>
		[Category("Behavior")]
		[Description("The position of the slider")]
		[DefaultValue(0)]
		public int Value
		{
			get { return TrackBar.Value; }
			set { TrackBar.Value = value; }
		}
        /// <summary>
        /// Gets or sets the starting color of the gradient used in the Slider.
        /// </summary>
        [Category("Behavior")]
        [Description("Gets or sets the starting color of the gradient used in the Slider.")]
        [DefaultValue(typeof(ProfessionalColors), "System.Windows.Forms.ProfessionalColors.OverflowButtonGradientEnd")]
        public Color SliderGradientBegin
        {
            get { return TrackBar.SliderGradientBegin; }
            set { TrackBar.SliderGradientBegin = value; }
        }
         /// <summary>
        /// Gets or sets the end color of the gradient used in the Slider.
        /// </summary>
        [Category("Behavior")]
        [Description("Gets or sets the end color of the gradient used in the Slider.")]
        [DefaultValue(typeof(ProfessionalColors), "System.Windows.Forms.ProfessionalColors.OverflowButtonGradientBegin")]
        public Color SliderGradientEnd
        {
            get { return TrackBar.SliderGradientEnd; }
            set { TrackBar.SliderGradientEnd = value; }
        }
        /// <summary>
        /// Gets or sets the starting color of the gradient used in the TrackLine.
        /// </summary>
        [Category("Behavior")]
        [Description("Gets or sets the starting color of the gradient used in the TrackLine.")]
        [DefaultValue(typeof(ProfessionalColors), "System.Windows.Forms.ProfessionalColors.ToolStripGradientBegin")]
        public Color TrackLineGradientBegin
        {
            get { return TrackBar.TrackLineGradientBegin; }
            set { TrackBar.TrackLineGradientBegin = value; }
        }
        /// <summary>
        /// Gets or sets the end color of the gradient used in the TrackLine.
        /// </summary>
        [Category("Behavior")]
        [Description("Gets or sets the end color of the gradient used in the TrackLine.")]
        [DefaultValue(typeof(ProfessionalColors), "System.Windows.Forms.ProfessionalColors.ToolStripGradientEnd")]
        public Color TrackLineGradientEnd
        {
            get { return TrackBar.TrackLineGradientEnd; }
            set { TrackBar.TrackLineGradientEnd = value; }
        }
        /// <summary>
        /// Gets or sets the tracker color of the gradient used in the TrackLine.
        /// </summary>
        [Category("Behavior")]
        [Description("Gets or sets the tracker color of the gradient used in the TrackLine.")]
        [DefaultValue(typeof(Color), "System.Drawing.Color.Blue")]
        public Color TrackLine
        {
            get { return TrackBar.TrackLine; }
            set { TrackBar.TrackLine = value; }
        }
        /// <summary>
        /// Gets or sets the elapsed tracker color of the gradient used in the TrackLine.
        /// </summary>
        [Category("Behavior")]
        [Description("Gets or sets the elapsed tracker color of the gradient used in the TrackLine.")]
        [DefaultValue(typeof(Color), "System.Drawing.Color.Lime")]
        public Color ElapsedTrackLine
        {
            get { return TrackBar.ElapsedTrackLine; }
            set { TrackBar.ElapsedTrackLine = value; }
        }
        /// <summary>
        /// Gets the default margin of an item.
        /// </summary>
        protected override Padding DefaultMargin
        {
            get
            {
                if ((base.Owner != null) && (base.Owner is StatusStrip))
                {
                    return new Padding(1, 3, 1, 3);
                }
                return new Padding(1, 2, 1, 1);
            }
        }
        /// <summary>
        /// Gets the default size of the item.
        /// </summary>
        protected override Size DefaultSize
        {
            get { return new Size(200, 22); }
        }
        #endregion

        #region MethodsPublic
        /// <summary>
        /// Initializes a new instance of the ToolStripTrackBar class.
        /// </summary>
        public ToolStripTrackBar()
            : base(CreateControlInstance())
        {
        }
        /// <summary>
        /// Starts the slider on the TrackBar.
        /// </summary>
        public void Start()
		{
            if (this.TrackBar != null)
            {
                this.TrackBar.Start();
            }
		}
        /// <summary>
        /// Starts the slider on the TrackBar.
        /// </summary>
        /// <param name="strText">The displayed text of the TrackBar</param>
		public void Start(string strText)
		{
            if (this.TrackBar != null)
            {
                this.TrackBar.Start(strText);
            }
		}

        #endregion

        #region MethodsProtected
        /// <summary>
        /// Subscribes events from the hosted control.
        /// </summary>
        /// <param name="control">The control from which to subscribe events.</param>
        protected override void OnSubscribeControlEvents(Control control)
        {
            base.OnSubscribeControlEvents(control);
            TrackBar trackBar = control as TrackBar;
            if (trackBar != null)
            {
                trackBar.ValueChanged += new EventHandler<EventArgs>(TrackBarValueChanged);
                trackBar.Scroll += new EventHandler<EventArgs>(TrackBarScroll);
                trackBar.ThumbStateChanged += new EventHandler<ThumbStateChangedEventArgs>(TrackBarThumbStateChanged);
            }
        }
        /// <summary>
        /// Unsubscribes events from the hosted control.
        /// </summary>
        /// <param name="control">The control from which to unsubscribe events.</param>
        protected override void OnUnsubscribeControlEvents(Control control)
        {
            base.OnUnsubscribeControlEvents(control);
            TrackBar trackBar = control as TrackBar;
            if (trackBar != null)
            {
                trackBar.ValueChanged -= new EventHandler<EventArgs>(TrackBarValueChanged);
                trackBar.Scroll -= new EventHandler<EventArgs>(TrackBarScroll);
                trackBar.ThumbStateChanged -= new EventHandler<ThumbStateChangedEventArgs>(TrackBarThumbStateChanged);
            }
        }
        /// <summary>
        /// Raises the TrackBarScroll event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected void TrackBarScroll(object sender, EventArgs e)
        {
            if (this.Scroll != null)
            {
                this.Scroll(sender, e);
            }
        }
        /// <summary>
        /// Raises the TrackBarValueChanged event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected void TrackBarValueChanged(object sender,EventArgs e)
        {
            if (this.ValueChanged != null)
            {
                this.ValueChanged(sender, e);
            }
        }
        /// <summary>
        /// Raises the TrackBarThumbStateChanged event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected void TrackBarThumbStateChanged(object sender, ThumbStateChangedEventArgs e)
        {
            if (this.ThumbStateChanged != null)
            {
                this.ThumbStateChanged(sender, e);
            }
        }
        /// <summary>
        /// Raises the EnabledChanged event.
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected override void OnEnabledChanged(EventArgs e)
        {
            if (TrackBar != null)
            {
                TrackBar.Enabled = this.Enabled;
            }
            base.OnEnabledChanged(e);
        }
        // <summary>
        /// Raises the OwnerChanged event. 
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected override void OnOwnerChanged(EventArgs e)
        {
            if (base.Owner != null)
            {
                base.Owner.RendererChanged += new EventHandler(OwnerRendererChanged);
            }
            base.OnOwnerChanged(e);
        }
        #endregion

        #region MethodsPrivate
        
        private void OwnerRendererChanged(object sender, EventArgs e)
        {
            ToolStripProfessionalRenderer toolsTripRenderer = this.Owner.Renderer as ToolStripProfessionalRenderer;
            if (toolsTripRenderer != null)
            {
                BSE.Windows.Forms.ProfessionalColorTable colorTable = toolsTripRenderer.ColorTable as BSE.Windows.Forms.ProfessionalColorTable;
                if (colorTable != null)
                {
                    this.TrackBar.ForeColor = colorTable.ToolStripText;
                }
            }
        }
        
        private static Control CreateControlInstance()
        {
            TrackBar trackBar = new TrackBar();
            trackBar.Size = new Size(200, 22);

            return trackBar;
        }
       
        #endregion
    }
}

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)

Share

About the Author

Uwe Eichkorn

Switzerland Switzerland
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141216.1 | Last Updated 24 Apr 2010
Article Copyright 2009 by Uwe Eichkorn
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid