Skip to content

Commit d608f20

Browse files
Update Program.cs
1 parent e587471 commit d608f20

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

BASSdotNetExample/Program.cs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Linq;
@@ -7,6 +7,8 @@
77
using System.Threading;
88
using System.Threading.Tasks;
99
using BASSdotNET;
10+
using AnyConsole;
11+
using System.Drawing;
1012

1113
namespace BASSdotNetExample
1214
{
@@ -32,6 +34,22 @@ public static string Utf16ToUtf8(string utf16String)
3234
}
3335
static void Main(string[] args)
3436
{
37+
var console = new ExtendedConsole();
38+
console.Configure(config =>
39+
{
40+
config.SetStaticRow("Header", RowLocation.Top, Color.White, Color.DarkRed);
41+
config.SetStaticRow("SubHeader", RowLocation.Top, 1, Color.White, Color.FromArgb(30, 30, 30));
42+
config.SetStaticRow("Footer", RowLocation.Bottom, Color.White, Color.DarkBlue);
43+
config.SetLogHistoryContainer(RowLocation.Top, 2);
44+
config.SetUpdateInterval(TimeSpan.FromMilliseconds(100));
45+
config.SetMaxHistoryLines(1000);
46+
config.SetQuitHandler((consoleInstance) => {
47+
Console.Write("Quiting...");
48+
Environment.Exit(3021);
49+
});
50+
});
51+
console.Start();
52+
console.Title = "BASS.NET Example Console Edition by RiritoNinigaya";
3553
Console.WriteLine("Hello World from BASS.NET Library!!!");
3654
BASS bass = new BASS();
3755
if(bass.Init_Bass(-1, 48000, 0, 0, 0))
@@ -46,12 +64,8 @@ static void Main(string[] args)
4664
Console.WriteLine("BASS.DLL IS FAILED TO CREATING FILE STREAM!!!");
4765
Environment.Exit(323);
4866
}
49-
//Console.WriteLine(str); //This is Not Necessary, if you cannot Initializating WAV Sound or MP3 Sound
5067
bass.ChannelPlay(str, false);
51-
while(true)
52-
{
53-
Thread.Sleep(4000);
54-
}
68+
console.WaitForClose();
5569
}
5670
}
5771
}

0 commit comments

Comments
 (0)