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

BSEtunes

, 24 Apr 2010
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;
using System.Drawing;

using BSE.Platten.BO.Properties;
using System.Globalization;

namespace BSE.Platten.BO
{
	/// <summary>
	/// This class contains all properties and methods of an album.
	/// </summary>
	public class CAlbum : ICloneable
    {
        #region Constants

        private readonly Size m_thumbNailSize = new Size(80, 80);

        #endregion

		#region Properties
        /// <summary>
        /// Gets or sets the AlbumId for the album.
        /// </summary>
        public int AlbumId
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the TOC for the album.
        /// </summary>
        public string TOC
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the MediaId for the album.
        /// </summary>
        public string MediaId
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the Index for the album.
        /// </summary>
        public int Index
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the InterpretId for the album.
        /// </summary>
        public int InterpretId
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the name of the artist for the album.
        /// </summary>
        public string Interpret
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the title for the album.
        /// </summary>
        public string Title
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the publishing year for the album.
        /// </summary>
        public int Year
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the MediumId for the album.
        /// </summary>
        public int MediumId
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the name of the data medium for the album.
        /// </summary>
        public string Medium
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the GenreId for the album.
        /// </summary>
        public int GenreId
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the name of the genre medium for the album.
        /// </summary>
        public string Genre
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the Cover for the album.
        /// </summary>
        public System.Drawing.Image Cover
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the Thumbnail for the album.
        /// </summary>
        public System.Drawing.Image Thumbnail
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the size of the album's thumbnail.
        /// </summary>
        public System.Drawing.Size ThumbnailSize
        {
            get { return this.m_thumbNailSize; }
        }
        /// <summary>
        /// Gets or sets the file extension of the album's cover.
        /// </summary>
        public string CoverExtension
        {
            get;
            set;
        }
        /// <summary>
        /// Gets or sets the tracks for the album
        /// </summary>
        public CTrack[] Tracks
        {
            get;
            set;
        }
		#endregion

		#region MethodsPublic

		public CAlbum()
		{
		}
        /// <summary>
        /// Converts a <see cref="BSE.Platten.BO.CDataRowAlbum"/> object into a <see cref="CAlbum"/> object.
        /// </summary>
        /// <param name="dataRowAlbum">The convertible <see cref="BSE.Platten.BO.CDataRowAlbum"/> object</param>
        /// <param name="strAudioHomeDirectory">The audio directory in which the tracks are located.</param>
        /// <returns>A <see cref="CAlbum"/> object.</returns>
        public static CAlbum GetAlbumDataByDataRow(CDataRowAlbum dataRowAlbum, string strAudioHomeDirectory)
        {
            CAlbum album = null;
            if (dataRowAlbum != null)
            {
                album = new CAlbum();
                album.AlbumId = dataRowAlbum.TitelId;
                album.InterpretId = dataRowAlbum.InterpretId;
                string strInterpret = dataRowAlbum.Interpret as string;
                if (String.IsNullOrEmpty(strInterpret) == false)
                {
                    album.Interpret = strInterpret;
                }
                string strTitel = dataRowAlbum.Titel as string;
                if (String.IsNullOrEmpty(strTitel) == false)
                {
                    album.Title = strTitel;
                }
                if (dataRowAlbum.IsErschDatumNull() == false)
                {
                    album.Year = dataRowAlbum.ErschDatum;
                }
                if (dataRowAlbum.IsMediumIdNull() == false)
                {
                    album.MediumId = dataRowAlbum.MediumId;
                }
                if (dataRowAlbum.IsGenreIdNull() == false)
                {
                    album.GenreId = dataRowAlbum.GenreId;
                }

                if (dataRowAlbum.IsCoverNull() == false)
                {
                    Byte[] byteCover = dataRowAlbum.Cover;
                    album.Cover = System.Drawing.Bitmap.FromStream(new System.IO.MemoryStream((byte[])byteCover));
                }
                if (dataRowAlbum.IsThumbNailNull() == false)
                {
                    Byte[] byteThumbNail = dataRowAlbum.ThumbNail;
                    album.Thumbnail = System.Drawing.Bitmap.FromStream(new System.IO.MemoryStream((byte[])byteThumbNail));
                }

                if (dataRowAlbum.IsPictureFormatNull() == false)
                {
                    album.CoverExtension = dataRowAlbum.PictureFormat;
                }

                CDataRowTracks[] dataRowsTrack = (CDataRowTracks[])dataRowAlbum.GetChildRows(CDataSetAlbum.DATARELATIONNAME);
                ArrayList aTracks = new ArrayList();
                foreach (CDataRowTracks dataRow in dataRowsTrack)
                {
                    CTrack track = new CTrack();
                    track.TitelId = dataRow.TitelId;
                    track.LiedId = dataRow.LiedId;
                    if (dataRow.IsTrackNull() == false)
                    {
                        track.TrackNumber = dataRow.Track;
                    }
                    if (dataRow.IsLiedNull() == false)
                    {
                        track.Title = dataRow.Lied;
                    }
                    if (dataRow.IsDauerNull() == false)
                    {
                        track.Duration = new TimeSpan(
                            dataRow.Dauer.Hour,
                            dataRow.Dauer.Minute,
                            dataRow.Dauer.Second);
                    }
                    if (dataRow.IsLiedpfadNull() == false)
                    {
                        track.FileName = dataRow.Liedpfad;
                        if (String.IsNullOrEmpty(track.FileName) == false)
                        {
                            if (String.IsNullOrEmpty(strAudioHomeDirectory) == false)
                            {
                                track.FileFullName = strAudioHomeDirectory + dataRow.Liedpfad;
                            }
                        }
                    }
                    aTracks.Add(track);
                    album.Tracks = new CTrack[dataRowsTrack.Length];
                    aTracks.CopyTo(album.Tracks);
                }
            }

            return album;
        }
        /// <summary>
        /// Creates a exact copy of this <see cref="CAlbum"/> object
        /// </summary>
        /// <returns>The <see cref="CAlbum"/> this method creates, cast as an object.
        ///</returns>
		public object Clone()
		{
			CAlbum album = new CAlbum();
            album.AlbumId = this.AlbumId;
            if (this.TOC != null)
            {
                album.TOC = (string)this.TOC.Clone();
            }
            if (this.MediaId != null)
            {
                album.MediaId = (string)this.MediaId.Clone();
            }
			album.Index = this.Index;
			album.InterpretId = this.InterpretId;
            if (this.Interpret != null)
            {
                album.Interpret = (string)this.Interpret.Clone();
            }
            if (this.Title != null)
            {
                album.Title = (string)this.Title.Clone();
            }
			album.Year = this.Year;
			album.MediumId = this.MediumId;
            if (this.Medium != null)
            {
                album.Medium = (string)this.Medium.Clone();
            }
			album.GenreId = this.GenreId;
            if (this.Genre != null)
            {
                album.Genre = (string)this.Genre.Clone();
            }
            if (this.Cover != null)
            {
                album.Cover = (Image)this.Cover.Clone();
            }
            if (this.Thumbnail != null)
            {
                album.Thumbnail = (Image)this.Thumbnail.Clone();
            }
            if (this.CoverExtension != null)
            {
                album.CoverExtension = (string)this.CoverExtension.Clone();
            }
            if (this.Tracks != null)
            {
                album.Tracks = new CTrack[this.Tracks.Length];
                this.Tracks.CopyTo(album.Tracks, 0);
            }
			return (object)album;
		}
        /// <summary>
        /// Gets the name of the audio directory in which the tracks are located.
        /// </summary>
        /// <param name="environment">A <see cref="BSE.Platten.BO.CEnvironment"/> object.</param>
        /// <returns>The name of the audio directory.</returns>
        public static string GetAudioHomeDirectory(Environment environment)
        {
            if (environment == null)
            {
                throw new ArgumentNullException(
                    string.Format(
                    CultureInfo.CurrentUICulture,
                    Resources.IDS_ArgumentException,
                    typeof(Environment).Name));
            }
            
            string strAudioHomeDirectory;
            try
            {
                strAudioHomeDirectory = environment.GetAudioHomeDirectory();
                if (String.IsNullOrEmpty(strAudioHomeDirectory) == false)
                {
                    if (!strAudioHomeDirectory.EndsWith(System.IO.Path.DirectorySeparatorChar.ToString()))
                    {
                        strAudioHomeDirectory += System.IO.Path.DirectorySeparatorChar;
                    }
                }
            }
            catch (BSE.Configuration.ConfigurationValueNotFoundException)
            {
                throw;
            }
            catch (Exception)
            {
                throw;
            }
            return strAudioHomeDirectory;
        }

		#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 | Mobile
Web04 | 2.8.140921.1 | Last Updated 24 Apr 2010
Article Copyright 2009 by Uwe Eichkorn
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid