Reformatting

Also adds license headers
This commit is contained in:
Flamefire committed 2014-10-19 18:51:14 +02:00
1 parent 4c7013836b
commit d208f9d7b9
31 files changed
+525 -61

No files matched your search

+1 -1
View File
@@ -193,7 +193,7 @@ namespace Vocaluxe.Base
if (_PlaysPreview)
_PreviewPlayer.Play();
else if(CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_ON)
else if (CConfig.BackgroundMusic == EBackgroundMusicOffOn.TR_CONFIG_ON)
{
if (_SongPlayer.SongLoaded)
//Resume
+18 -1
View File
@@ -1,4 +1,21 @@
using System.Diagnostics;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System.Diagnostics;
using Vocaluxe.Base.ThemeSystem;
using VocaluxeLib;
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
namespace Vocaluxe.Base.ThemeSystem
+18 -1
View File
@@ -1,4 +1,21 @@
using System.IO;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System.IO;
using System.Linq;
using Vocaluxe.Base.Fonts;
using VocaluxeLib.Xml;
+18 -1
View File
@@ -1,4 +1,21 @@
using VocaluxeLib;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using VocaluxeLib;
using VocaluxeLib.Draw;
namespace Vocaluxe.Base.ThemeSystem
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.IO;
using System.Linq;
using Vocaluxe.Base.Fonts;
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Threading;
using Vocaluxe.Base;
using VocaluxeLib;
+17
View File
@@ -1,3 +1,20 @@
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.ComponentModel;
using System.Diagnostics;
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Drawing;
namespace Vocaluxe.Lib.Draw
-1
View File
@@ -19,7 +19,6 @@ using VocaluxeLib;
namespace Vocaluxe.Lib.Sound.Playback
{
interface IPlayback
{
bool Init();
+18 -1
View File
@@ -1,4 +1,21 @@
using System.Collections.Generic;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Vocaluxe.Base;
@@ -1,11 +1,28 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Runtime.InteropServices;
namespace Vocaluxe.Lib.Sound.Record.PitchTracker
{
/// <summary>
/// Analyzer from Performous
/// Should be very reliable but needs some proof (artificial tests show some errors)
/// Analyzer from Performous
/// Should be very reliable but needs some proof (artificial tests show some errors)
/// </summary>
class CAnalyzer : CPitchTracker
{
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Runtime.InteropServices;
namespace Vocaluxe.Lib.Sound.Record.PitchTracker
@@ -1,10 +1,27 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Runtime.InteropServices;
namespace Vocaluxe.Lib.Sound.Record.PitchTracker
{
/// <summary>
/// Pitchtracker (Pt) that uses a dynamic wavelet (DyWa) algorithm
/// Pitchtracker (Pt) that uses a dynamic wavelet (DyWa) algorithm
/// </summary>
class CPtDyWa : CPitchTracker
{
@@ -1,10 +1,27 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
namespace Vocaluxe.Lib.Sound.Record.PitchTracker
{
/// <summary>
/// Pitchtracker (Pt) in C# that uses IIR filters for smoothing and an intelligent detection algorithm to reduce calculations
/// DO NOT USE in 32 Bit! Due to floating point errors the filter will raise all values to NAN (TODO: FIX it!)
/// Pitchtracker (Pt) in C# that uses IIR filters for smoothing and an intelligent detection algorithm to reduce calculations
/// DO NOT USE in 32 Bit! Due to floating point errors the filter will raise all values to NAN (TODO: FIX it!)
/// </summary>
class CPtSharp : CPitchTracker
{
@@ -1,11 +1,28 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Diagnostics;
namespace Vocaluxe.Lib.Sound.Record.PitchTracker
{
/// <summary>
/// Base class/Interface for pitch detectors
/// Most likely some structures or system resources are used, hence it should be disposed if no longer needed
/// Base class/Interface for pitch detectors
/// Most likely some structures or system resources are used, hence it should be disposed if no longer needed
/// </summary>
abstract class CPitchTracker : IDisposable
{
@@ -26,8 +43,8 @@ namespace Vocaluxe.Lib.Sound.Record.PitchTracker
}
/// <summary>
/// Method to set weights if the algorithm does not provide anything that could simulate a visualizer.
/// Should be called with each valid detection
/// Method to set weights if the algorithm does not provide anything that could simulate a visualizer.
/// Should be called with each valid detection
/// </summary>
/// <param name="note">Current note</param>
/// <param name="weights">Array of weights (Length = NumHalfTonesDef)</param>
@@ -43,30 +60,32 @@ namespace Vocaluxe.Lib.Sound.Record.PitchTracker
}
/// <summary>
/// Gets the number of half tones the algorithm provides weights for.
/// This may not be the number of half tones the algorithm detects!
/// Gets the number of half tones the algorithm provides weights for.
/// This may not be the number of half tones the algorithm detects!
/// </summary>
/// <returns></returns>
public abstract int GetNumHalfTones();
/// <summary>
/// The treshold for detecting silence
/// Value (0-1) for which everything below is considered silence
/// The treshold for detecting silence
/// Value (0-1) for which everything below is considered silence
/// </summary>
public abstract float VolumeTreshold { get; set; }
/// <summary>
/// Recorded data. Has to be 16 bit short values.
/// Recorded data. Has to be 16 bit short values.
/// </summary>
/// <param name="data">16bit short values of data</param>
public abstract void Input(byte[] data);
/// <summary>
/// Returns the current note detected
/// Returns the current note detected
/// </summary>
/// <param name="maxVolume">Current maximum volume (0-1)</param>
/// <param name="weights">Array of NumHalfTones floats that gets filled with the current weights (0-1) where each value indicates how strong that tone is.
/// Only for basic visualization as it may not be accurate.</param>
/// <param name="weights">
/// Array of NumHalfTones floats that gets filled with the current weights (0-1) where each value indicates how strong that tone is.
/// Only for basic visualization as it may not be accurate.
/// </param>
/// <returns>Current note index (0 = C2, 12 = C3, ...)</returns>
public abstract int GetNote(out float maxVolume, float[] weights);
}
+18 -1
View File
@@ -1,4 +1,21 @@
using System.Text;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System.Text;
namespace VocaluxeLib
{
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
+18 -1
View File
@@ -1,4 +1,21 @@
using VocaluxeLib.Draw;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using VocaluxeLib.Draw;
namespace VocaluxeLib
{
+18 -1
View File
@@ -1,4 +1,21 @@
namespace VocaluxeLib.Menu
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
namespace VocaluxeLib.Menu
{
public abstract class CMenuElementBase
{
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml.Serialization;
+1 -1
View File
@@ -68,7 +68,7 @@ namespace VocaluxeLib.Menu.SingNotes
[XmlArray("BarPositions")] public SBarPosition[] BarPos;
}
public abstract class CSingNotes : CMenuElementBase, IMenuElement,IThemeable
public abstract class CSingNotes : CMenuElementBase, IMenuElement, IThemeable
{
private readonly int _PartyModeID;
private SThemeSingBar _Theme;
+1 -1
View File
@@ -19,7 +19,7 @@ using VocaluxeLib.PartyModes;
namespace VocaluxeLib.Menu.SongMenu
{
public interface ISongMenu : IMenuElement,IThemeable
public interface ISongMenu : IMenuElement, IThemeable
{
void Update(SScreenSongOptions songOptions);
void OnShow();
+20 -3
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
@@ -121,7 +138,7 @@ namespace VocaluxeLib.Utils
}
/// <summary>
/// Gets an array of numSamples samples per channel for the selected channel(s)
/// Gets an array of numSamples samples per channel for the selected channel(s)
/// </summary>
/// <param name="numSamples">Samples per channel</param>
/// <param name="channel">Channel for which to get the samples (0=all)</param>
@@ -151,7 +168,7 @@ namespace VocaluxeLib.Utils
}
/// <summary>
/// Gets an array of numSamples samples per channel for the selected channel(s)
/// Gets an array of numSamples samples per channel for the selected channel(s)
/// </summary>
/// <param name="numSamples">Samples per channel</param>
/// <param name="channel">Channel for which to get the samples (0=all)</param>
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.IO;
using VocaluxeLib.Draw;
using VocaluxeLib.Songs;
+34 -13
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -14,10 +31,10 @@ namespace VocaluxeLib.Utils.Player
public float Volume
{
set
set
{
_Volume = value;
_ApplyVolume();
_ApplyVolume();
}
get { return _Volume; }
}
@@ -25,13 +42,15 @@ namespace VocaluxeLib.Utils.Player
public float Position
{
set {
if(_StreamID == -1)
set
{
if (_StreamID == -1)
return;
_StartPosition = value;
}
get {
if(_StreamID == -1)
get
{
if (_StreamID == -1)
return -1;
return CBase.Sound.GetPosition(_StreamID);
}
@@ -50,7 +69,10 @@ namespace VocaluxeLib.Utils.Player
public bool RepeatSong;
public bool IsPlaying { get; protected set; }
public bool IsFinished { get { return RepeatSong ? false : CBase.Sound.IsFinished(_StreamID); } }
public bool IsFinished
{
get { return RepeatSong ? false : CBase.Sound.IsFinished(_StreamID); }
}
public CSoundPlayer(bool loop = false)
{
@@ -60,7 +82,7 @@ namespace VocaluxeLib.Utils.Player
public CSoundPlayer(string file, bool loop = false, float position = 0f, bool autoplay = false)
{
_StreamID = CBase.Sound.Load(file, false, true);
if(position > 0f)
if (position > 0f)
Position = position;
Loop = loop;
if (autoplay)
@@ -96,7 +118,7 @@ namespace VocaluxeLib.Utils.Player
if (_StreamID == -1)
return;
if(IsPlaying)
if (IsPlaying)
CBase.Sound.Fade(_StreamID, 0f, _FadeTime, EStreamAction.Pause);
else
{
@@ -126,7 +148,7 @@ namespace VocaluxeLib.Utils.Player
float timeToPlay;
float len = CBase.Sound.GetLength(_StreamID);
timeToPlay = (len > 0f) ? len - CBase.Sound.GetPosition(_StreamID) : _FadeTime + 1f;
bool finished = CBase.Sound.IsFinished(_StreamID);
if (timeToPlay <= _FadeTime || finished)
{
@@ -139,7 +161,6 @@ namespace VocaluxeLib.Utils.Player
else
Stop();
}
}
private void _ApplyVolume()
@@ -150,4 +171,4 @@ namespace VocaluxeLib.Utils.Player
CBase.Sound.SetStreamVolume(_StreamID, Volume);
}
}
}
}
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
+18 -1
View File
@@ -1,4 +1,21 @@
using System;
#region license
// This file is part of Vocaluxe.
//
// Vocaluxe is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Vocaluxe is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Vocaluxe. If not, see <http://www.gnu.org/licenses/>.
#endregion
using System;
namespace VocaluxeLib.Xml
{