forked from jeff-1amstudios/OpenC1
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5389f63
commit 68524e3
Showing
49 changed files
with
68,739 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,68 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Media; | ||
using System.Text; | ||
using Microsoft.DirectX.DirectSound; | ||
using Microsoft.Xna.Framework.Media; | ||
using NAudio.Wave; | ||
|
||
namespace OneAmEngine.Audio | ||
{ | ||
class MusicPlayer | ||
public class MusicPlayer | ||
{ | ||
/*private SoundPlayer _music; | ||
private WaveOutEvent _music; | ||
public static string modName; | ||
string gamePath = AppDomain.CurrentDomain.BaseDirectory + "/GameData/" + modName + "/MUSIC"; | ||
private bool found = false; | ||
|
||
public MusicPlayer() | ||
{ | ||
_music = new SoundPlayer(); | ||
if (Directory.Exists(gamePath)) | ||
{ | ||
found = true; | ||
Shuffle(); | ||
} | ||
} | ||
|
||
private void Shuffle() | ||
{ | ||
if (!found) | ||
return; | ||
|
||
var vorbisStream = new NAudio.Vorbis.VorbisWaveReader(gamePath + "/track0" + new Random().Next(2, 9) + ".ogg"); | ||
_music = new WaveOutEvent(); | ||
_music.Init(vorbisStream); | ||
_music.Stop(); | ||
} | ||
|
||
public void Play() | ||
{ | ||
_music.PlaySync(); | ||
}*/ | ||
if (!found) | ||
return; | ||
|
||
_music.Play(); | ||
} | ||
public void Stop() | ||
{ | ||
if (!found) | ||
return; | ||
|
||
_music.Stop(); | ||
} | ||
|
||
public void Update() | ||
{ | ||
if (!found) | ||
return; | ||
|
||
if (_music.PlaybackState == PlaybackState.Stopped) | ||
{ | ||
_music.Stop(); | ||
Shuffle(); | ||
_music.Play(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="NAudio" version="1.9.0" targetFramework="net35" /> | ||
<package id="NAudio.Vorbis" version="1.0.0.0" targetFramework="net35" /> | ||
<package id="NVorbis" version="0.8.4.0" targetFramework="net35" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ | |
// Build Number | ||
// Revision | ||
// | ||
[assembly: AssemblyVersion("1.4.5.0")] | ||
[assembly: AssemblyVersion("1.4.6.0")] |
Oops, something went wrong.