Version 1.0

Its stable enough and has decent features!
This commit is contained in:
Ryan 2017-08-28 22:56:50 -04:00
parent 8dfb0cb367
commit e0644f82a9
49 changed files with 125415 additions and 50682 deletions

BIN
packages/NAudio.1.8.2/NAudio.1.8.2.nupkg vendored Normal file

Binary file not shown.

22583
packages/NAudio.1.8.2/lib/NAudio.XML vendored Normal file

File diff suppressed because it is too large Load Diff

22583
packages/NAudio.1.8.2/lib/net35/NAudio.XML vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

31
packages/NAudio.1.8.2/license.txt vendored Normal file
View File

@ -0,0 +1,31 @@
Microsoft Public License (Ms-PL)
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
2. Grant of Rights
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
3. Conditions and Limitations
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.

92
packages/NAudio.1.8.2/readme.txt vendored Normal file
View File

@ -0,0 +1,92 @@
NAudio is an open source .NET audio library written by Mark Heath (mark.heath@gmail.com)
For more information, visit http://naudio.codeplex.com
NAudio is now being hosted on GitHub http://github.com/naudio/NAudio
THANKS
======
The following list includes some of the people who have contributed in various ways to NAudio, such as code contributions,
bug fixes, documentation, helping out on the forums and even donations. I haven't finished compiling this list yet, so
if your name should be on it but isn't please let me know and I will include it. Also, some people I only know by their forum
id, so if you want me to put your full name here, please also get in touch.
in alphabetical order:
Alan Jordan
Alexandre Mutel
Alexander Binkert
AmandaTarafaMas
balistof
biermeester
borman11
bradb
Brandon Hansen (kg6ypi)
csechet
ChunkWare Music Software
CKing
DaMacc
Dirk Eckhardt
Du10
eejake52
Florian Rosmann (filoe)
Freefall
Giawa
Harald Petrovitsch
Hfuy
Iain McCowan
Idael Cardaso
ioctlLR
Ivan Kochurkin (KvanTTT)
Jamie Michael Ewins
jannera
jbaker8935
jcameron23
JoeGaggler
jonahoffmann
jontdelorme
Jospin Software
Justin Frankel
K24A3
Kamen Lichev
Kassoul
kevinxxx
kzych
LionCash
Lustild
Lucian Wischik (ljw1004)
ManuN
MeelMarcel
Michael Chadwick
Michael Feld
Michael J
Michael Lehenbauer
milligan22963
myrkle
nelsonkidd
Nigel Redmon
Nikolaos Georgiou
Owen Skriloff
owoudenb
painmailer
PPavan
Pygmy
Ray Molenkamp
Roadz
Robert Bristow-Johnson
Scott Fleischman
Simon Clark
Sirish Bajpai
sporn
Steve Underwood
Ted Murphy
Tiny Simple Tools
Tobias Fleming
TomBogle
Tony Cabello
Tony Sistemas
TuneBlade
topher3683
volmart
Vladimir Rokovanov
Ville Koskinen
Wyatt Rice
Yuval Naveh
Zsb

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<dllmap dll="vulkan-1" target="vulkan.so" />
</configuration>

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<dllmap dll="vulkan-1" target="vulkan.so" />
</configuration>

Binary file not shown.

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<dllmap dll="vulkan-1" target="vulkan.so" />
</configuration>

Binary file not shown.

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<dllmap dll="vulkan-1" target="vulkan.so" />
</configuration>

Binary file not shown.

View File

@ -1,7 +1,9 @@
 
Microsoft Visual Studio Solution File, Format Version 11.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2010 # Visual Studio 2012
# SharpDevelop 5.1 # SharpDevelop 5.1
VisualStudioVersion = 12.0.20827.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "parseManagerTester", "parseManager\parseManagerTester.csproj", "{E095732F-BCDC-4794-B013-A849C4146DA3}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "parseManagerTester", "parseManager\parseManagerTester.csproj", "{E095732F-BCDC-4794-B013-A849C4146DA3}"
EndProject EndProject
Global Global

View File

@ -31,6 +31,13 @@ namespace FancyPrintCS
form = n; form = n;
} }
} }
public static void SetFVar(int f){
if(f<0 || f>6){
Console.WriteLine("Invalid int value! Only 0-7 is allowed!");
} else {
fvar=f;
}
}
public static void SetForm(string n) public static void SetForm(string n)
{ {
if (n.ToLower()=="left"){ if (n.ToLower()=="left"){

View File

@ -11,144 +11,6 @@ using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using parseManagerCS; using parseManagerCS;
using System.Windows.Input; using System.Windows.Input;
public class define : standardDefine // If you want the standard methods you must include this, Also this class cannot be static!
{
int origRow = Console.CursorTop;
int origCol = Console.CursorLeft;
public void setPosition(parseManager PM, double x, double y)
{
Console.SetCursorPosition((int)x, (int)y);
}
public void writeAt(parseManager PM, string s, double x, double y)
{
try {
Console.SetCursorPosition(origCol + (int)x, origRow + (int)y);
Console.Write(s);
} catch (ArgumentOutOfRangeException e) {
Console.Clear();
Console.WriteLine(e.Message);
}
}
public bool isDown(parseManager PM, string key)
{
if(!ApplicationIsActivated()){
return false;
}
Key kk = Key.Zoom;
var k = key.ToUpper();
if (k == "A") {
kk = Key.A;
} else if (k == "B") {
kk = Key.B;
} else if (k == "C") {
kk = Key.C;
} else if (k == "D") {
kk = Key.D;
} else if (k == "E") {
kk = Key.E;
} else if (k == "F") {
kk = Key.F;
} else if (k == "G") {
kk = Key.G;
} else if (k == "H") {
kk = Key.H;
} else if (k == "I") {
kk = Key.I;
} else if (k == "J") {
kk = Key.J;
} else if (k == "K") {
kk = Key.K;
} else if (k == "L") {
kk = Key.L;
} else if (k == "M") {
kk = Key.M;
} else if (k == "N") {
kk = Key.N;
} else if (k == "O") {
kk = Key.O;
} else if (k == "P") {
kk = Key.P;
} else if (k == "Q") {
kk = Key.Q;
} else if (k == "R") {
kk = Key.R;
} else if (k == "S") {
kk = Key.S;
} else if (k == "T") {
kk = Key.T;
} else if (k == "U") {
kk = Key.U;
} else if (k == "V") {
kk = Key.V;
} else if (k == "W") {
kk = Key.W;
} else if (k == "X") {
kk = Key.X;
} else if (k == "Y") {
kk = Key.Y;
} else if (k == "Z") {
kk = Key.Z;
} else if (k == "{UP}") {
kk = Key.Up;
} else if (k == "{DOWN}") {
kk = Key.Down;
} else if (k == "{LEFT}") {
kk = Key.Left;
} else if (k == "{RIGHT}") {
kk = Key.Right;
} else if (k == "{ENTER}") {
kk = Key.Enter;
} else if (k == "{LSHIFT}"){
kk = Key.LeftShift;
} else if (k == "{RSHIFT}"){
kk = Key.RightShift;
} else if (k == "0"){
kk = Key.D0;
} else if (k == "1"){
kk = Key.D1;
} else if (k == "2"){
kk = Key.D2;
} else if (k == "3"){
kk = Key.D3;
} else if (k == "4"){
kk = Key.D4;
} else if (k == "5"){
kk = Key.D5;
} else if (k == "6"){
kk = Key.D6;
} else if (k == "7"){
kk = Key.D7;
} else if (k == "8"){
kk = Key.D8;
} else if (k == "9"){
kk = Key.D9;
} else if(k == "{SPACE}"){
kk = Key.Space;
}
return Keyboard.IsKeyDown(kk);
}
public string isPressing(parseManager PM)
{
return Console.ReadKey(true).Key.ToString();
}
public static bool ApplicationIsActivated()
{
var activatedHandle = GetForegroundWindow();
if (activatedHandle == IntPtr.Zero) {
return false; // No window is currently activated
} else {
var procId = Process.GetCurrentProcess().Id;
int activeProcId;
GetWindowThreadProcessId(activatedHandle, out activeProcId);
return activeProcId == procId;
}
}
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern int GetWindowThreadProcessId(IntPtr handle, out int processId);
}
namespace parseManagerCS namespace parseManagerCS
{ {
class Program class Program
@ -156,12 +18,12 @@ namespace parseManagerCS
[STAThread] [STAThread]
public static void Main(string[] args) public static void Main(string[] args)
{ {
// if (args.Length == 0) { if (args.Length == 0) {
// Console.Write("Please Include a file path!"); Console.Write("Please Include a file path!");
// Console.ReadLine(); Console.ReadLine();
// Environment.Exit(0); Environment.Exit(0);
// } }
parseManager PM = new parseManager("parsetest2.txt", "define"); parseManager PM = new parseManager(args[0]);
nextType next = PM.Next(); nextType next = PM.Next();
string type; string type;
while (next.GetCMDType() != "EOF") { while (next.GetCMDType() != "EOF") {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup> </startup>
</configuration> </configuration>

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,4 @@
[PLAYGAME]{
print("Welcome to my game!")
PAUSE("ENJOY!")
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup> </startup>
</configuration> </configuration>

View File

@ -1,29 +1,59 @@
ENTRY STARTHERE VERSION 1.0
[STARTHERE]{ LOAD game/play.dat
[COUNTER]{
::loop::
sleep(1000)
secs_played=secs_played+1
if secs_played==60 then GOTO("secs")|SKIP(0)
if mins_played==60 then GOTO("mins")|GOTO("loop")
::secs::
secs_played=0
mins_played=mins_played+1
GOTO("loop")
::mins::
mins_played=0
hours_played=hours_played+1
GOTO("loop")
}
[START]{
secs_played=0
mins_played=0
hours_played=0
newThread("COUNTER")
bgm_song=loadSong("Audio/Collapse.mp3")
snd_select=loadSong("Audio/select.mp3")
playSong(bgm_song)
setFancyForm("left")
LOAD()
write("Name: ") write("Name: ")
name=getInput() name=getInput()
clear() clear()
if name=="" then SKIP(-4)|SKIP(0) if name=="" then SKIP(-4)|SKIP(0)
PAUSE("So your name is $name$, thats cool!") PAUSE("So your name is $name$, thats cool!")
pos=1 pos=1
sleep(200)
SAVE()
::loop:: ::loop::
clear() clear()
SAVE()
setFG(Color_Blue) setFG(Color_Blue)
fancy("left"," What to do $name$?,/l, Play Game, View Stats, View Credits, Quit Game") fancy(" What to do $name$? Time plsyed $hours_played$:$mins_played$:$secs_played$,/l, Play Game, View Stats, View Credits, Quit Game")
keyUP=isDown("{UP}") keyUP=isDown("{UP}")
keyDOWN=isDown("{DOWN}") keyDOWN=isDown("{DOWN}")
keyENTER=isDown("{RIGHT}") keyENTER=isDown("{ENTER}")
if keyUP==true then setVarPlay("pos",pos-1)|SKIP(0) if keyUP==true then setVarPlay("pos",pos-1)|SKIP(0)
if keyDOWN==true then setVarPlay("pos",pos+1)|SKIP(0) if keyDOWN==true then setVarPlay("pos",pos+1)|SKIP(0)
if keyENTER==true then GOTO("choicemade")|SKIP(0) if keyENTER==true then GOTO("choicemade")|SKIP(0)
writeAt("->",1,pos+2) writeAt("->",1,pos+2)
sleep(75) sleep(50)
GOTO("loop") GOTO("loop")
::choicemade:: ::choicemade::
if pos==1 then print("You Pressed Play!")|SKIP(0) playSong(snd_select)
sleep(200)
if pos==1 then JUMP("PLAYGAME")|SKIP(0)
if pos==2 then print("You Pressed Stats")|SKIP(0) if pos==2 then print("You Pressed Stats")|SKIP(0)
if pos==3 then print("You Pressed Credits")|SKIP(0) if pos==3 then print("You Pressed Credits")|SKIP(0)
if pos==4 then print("You Pressed Quit")|SKIP(0) if pos==4 then QUIT()|SKIP(0)
PAUSE("Tests done (Press Enter!)") PAUSE("Tests done (Press Enter!)")
} }
[PAUSE:function(msg)]{ [PAUSE:function(msg)]{

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
ILRepack.exe /target:exe /targetplatform:"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.x" /out:MergedFile.exe parsemanagertester.exe cscore.dll ILRepack.exe /target:exe /targetplatform:"v4,C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.x" /out:MergedFile.exe parsemanagertester.exe NAudio.dll

View File

@ -1,6 +1,6 @@
<?xml version="1.0" standalone="yes"?> <?xml version="1.0" standalone="yes"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup> </startup>
</configuration> </configuration>

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup> </startup>
</configuration> </configuration>

View File

@ -4,5 +4,7 @@ C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Debu
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Debug\parseManagerTester.pdb C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Debug\parseManagerTester.pdb
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\obj\Debug\parseManagerTester.exe C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\obj\Debug\parseManagerTester.exe
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\obj\Debug\parseManagerTester.pdb C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\obj\Debug\parseManagerTester.pdb
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Debug\CSCore.dll C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Debug\NAudio.dll
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Debug\CSCore.xml C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Debug\NAudio.xml
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Debug\Vulkan.dll
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Debug\Vulkan.Windows.dll

View File

@ -1,6 +1,8 @@
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Release\parseManagerTester.exe.config C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Release\parseManagerTester.exe.config
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Release\parseManagerTester.exe C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Release\parseManagerTester.exe
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Release\CSCore.dll
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Release\CSCore.xml
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\obj\Release\parseManagerTester.csprojResolveAssemblyReference.cache C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\obj\Release\parseManagerTester.csprojResolveAssemblyReference.cache
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\obj\Release\parseManagerTester.exe C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\obj\Release\parseManagerTester.exe
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Release\NAudio.dll
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Release\Vulkan.dll
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Release\Vulkan.Windows.dll
C:\Users\Ryan\Documents\SharpDevelop Projects\parseManager\parseManager\bin\Release\NAudio.xml

View File

@ -2,5 +2,7 @@
<packages> <packages>
<package id="CSCore" version="1.2.1.1" targetFramework="net40" /> <package id="CSCore" version="1.2.1.1" targetFramework="net40" />
<package id="MediaToolkit" version="1.1.0.1" targetFramework="net40" /> <package id="MediaToolkit" version="1.1.0.1" targetFramework="net40" />
<package id="NAudio" version="1.8.2" targetFramework="net40" />
<package id="Resource.Embedder" version="1.2.4" targetFramework="net40" developmentDependency="true" /> <package id="Resource.Embedder" version="1.2.4" targetFramework="net40" developmentDependency="true" />
<package id="VulkanSharp" version="0.1.8" targetFramework="net452" />
</packages> </packages>

View File

@ -4,17 +4,17 @@
* Time: 11:54 AM * Time: 11:54 AM
*/ */
using System; using System;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Reflection; using System.Reflection;
using CSCore;
using CSCore.Codecs;
using CSCore.SoundOut;
using parseManagerCS;
using System.Threading; using System.Threading;
using System.Windows.Input;
using FancyPrintCS; using FancyPrintCS;
using NAudio.Wave;
using parseManagerCS;
namespace parseManagerCS namespace parseManagerCS
{ {
/// The parseManager is an Advance Config Script /// The parseManager is an Advance Config Script
@ -22,6 +22,7 @@ namespace parseManagerCS
/// This also has very flexible flow control meaning you can use it for chat logic and such /// This also has very flexible flow control meaning you can use it for chat logic and such
public class parseManager public class parseManager
{ {
public string _VERSION = "1.0";
standardDefine _invoke = new standardDefine(); standardDefine _invoke = new standardDefine();
string _filepath; string _filepath;
bool _active = true; bool _active = true;
@ -29,6 +30,7 @@ namespace parseManagerCS
string _entry = "START"; string _entry = "START";
bool _isInternal; bool _isInternal;
Type _defineType; Type _defineType;
bool isThread;
standardDefine def = new standardDefine(); standardDefine def = new standardDefine();
MethodInfo _defineMethod; MethodInfo _defineMethod;
object _defineClassObject; object _defineClassObject;
@ -42,6 +44,7 @@ namespace parseManagerCS
Dictionary<string, string> _methods = new Dictionary<string, string>(); Dictionary<string, string> _methods = new Dictionary<string, string>();
void INITENV() void INITENV()
{ {
GLOBALS.SetPM(this);
_mainENV["Color_Black"] = ConsoleColor.Black; _mainENV["Color_Black"] = ConsoleColor.Black;
_mainENV["Color_Blue"] = ConsoleColor.Blue; _mainENV["Color_Blue"] = ConsoleColor.Blue;
_mainENV["Color_Cyan"] = ConsoleColor.Cyan; _mainENV["Color_Cyan"] = ConsoleColor.Cyan;
@ -63,6 +66,12 @@ namespace parseManagerCS
{ {
_mainENV = env; _mainENV = env;
} }
public void makeThread(){
isThread=true;
}
public bool isAThread(){
return isThread;
}
public parseManager(string filepath) public parseManager(string filepath)
{ {
InitFlags(); InitFlags();
@ -129,6 +138,7 @@ namespace parseManagerCS
_flags.Add("forseelabels", true); _flags.Add("forseelabels", true);
_flags.Add("debugging", false); _flags.Add("debugging", false);
_flags.Add("topdown", true); _flags.Add("topdown", true);
_flags.Add("casesensitive", true);
} }
public ENV Pop() public ENV Pop()
{ {
@ -153,11 +163,19 @@ namespace parseManagerCS
Parse(m.Groups[1].ToString()); Parse(m.Groups[1].ToString());
} }
foreach (Match m in Regex.Matches(data, @"ENABLE ([a-zA-Z0-9_\./]+)")) { foreach (Match m in Regex.Matches(data, @"ENABLE ([a-zA-Z0-9_\./]+)")) {
_flags[m.Groups[1].ToString()] = true; _flags[m.Groups[1].ToString().ToLower()] = true;
}
foreach (Match m in Regex.Matches(data, @"DISABLE ([a-zA-Z0-9_\./]+)")) {
_flags[m.Groups[1].ToString().ToLower()] = false;
} }
foreach (Match m in Regex.Matches(data, @"ENTRY ([a-zA-Z0-9_\./]+)")) { foreach (Match m in Regex.Matches(data, @"ENTRY ([a-zA-Z0-9_\./]+)")) {
_entry = m.Groups[1].ToString(); _entry = m.Groups[1].ToString();
} }
foreach (Match m in Regex.Matches(data, @"VERSION ([a-zA-Z0-9_\./]+)")) {
if (Version.Parse(m.Groups[1].ToString()) != Version.Parse(_VERSION)) {
PushError("Attempt to run a code created for a different version of the interperter/compiler!");
}
}
// foreach (Match m in Regex.Matches(data, @"USING ([a-zA-Z0-9_\./]+)")) { // foreach (Match m in Regex.Matches(data, @"USING ([a-zA-Z0-9_\./]+)")) {
// m.Groups[1].ToString(); // m.Groups[1].ToString();
// } // }
@ -237,7 +255,7 @@ namespace parseManagerCS
} }
return false; return false;
} }
public object InvokeI(string method, object[] argsV, chunk c) public object InvokeI(string method, object[] argsV, chunk c,bool rets)
{ {
var ccP = _currentChunk.GetPos(); var ccP = _currentChunk.GetPos();
var ccN = _currentChunk.GetName(); var ccN = _currentChunk.GetName();
@ -259,13 +277,17 @@ namespace parseManagerCS
} }
_defualtENV = fEnv; _defualtENV = fEnv;
def.JUMP(this, method); def.JUMP(this, method);
if(rets){
return fEnv; // TODO Handle returns return fEnv; // TODO Handle returns
} else {
return null;
}
} }
public object InvokeR(string method, object[] args) public object InvokeR(string method, object[] args)
{ {
chunk c; chunk c;
if (isRegisteredFunction(method, out c)) { if (isRegisteredFunction(method, out c)) {
return InvokeI(method, args, c); return InvokeI(method, args, c, true);
} }
try { try {
_defineMethod = _defineType.GetMethod(method); _defineMethod = _defineType.GetMethod(method);
@ -279,7 +301,7 @@ namespace parseManagerCS
{ {
chunk c; chunk c;
if (isRegisteredFunction(method, out c)) { if (isRegisteredFunction(method, out c)) {
InvokeI(method, args, c); InvokeI(method, args, c, false);
return 0; return 0;
} }
try { try {
@ -1022,6 +1044,9 @@ namespace parseManagerCS
public object this[string ind] { public object this[string ind] {
get { get {
object obj; object obj;
if (!GLOBALS.GetFlag("casesensitive")) {
ind = ind.ToLower();
}
if (_vars.TryGetValue(ind, out obj)) { if (_vars.TryGetValue(ind, out obj)) {
return obj; return obj;
} }
@ -1031,6 +1056,9 @@ namespace parseManagerCS
return null; return null;
} }
set { set {
if (!GLOBALS.GetFlag("casesensitive")) {
ind = ind.ToLower();
}
_vars[ind] = value; _vars[ind] = value;
} }
} }
@ -1116,6 +1144,20 @@ namespace parseManagerCS
static parseManager _current; static parseManager _current;
static readonly ENV _env = new ENV(); static readonly ENV _env = new ENV();
static List<string> _numvars = new List<string>(); static List<string> _numvars = new List<string>();
static List<parseManager> _Threads = new List<parseManager>();
public static void AddThread(parseManager PM)
{
_Threads.Add(PM);
}
public static void FixThreads(parseManager PM)
{
var PMS = _Threads.ToArray();
var env = PM.GetDENV();
for (int i = 0; i < PMS.Length; i++) {
PMS[i]._SetDENV(env);
PMS[i].SetENV(env);
}
}
public static void WriteToBinaryFile(string filePath, ENV objectToWrite, bool append = false) public static void WriteToBinaryFile(string filePath, ENV objectToWrite, bool append = false)
{ {
using (Stream stream = File.Open(filePath, append ? FileMode.Append : FileMode.Create)) { using (Stream stream = File.Open(filePath, append ? FileMode.Append : FileMode.Create)) {
@ -1150,6 +1192,11 @@ namespace parseManagerCS
{ {
return _current; return _current;
} }
public static bool GetFlag(string flag)
{
var PM = GetPM();
return PM.GetFlag(flag);
}
public static void Add_Var(string var) public static void Add_Var(string var)
{ {
if (!_numvars.Contains(var)) { if (!_numvars.Contains(var)) {
@ -1215,8 +1262,11 @@ namespace parseManagerCS
} }
public class standardDefine public class standardDefine
{ {
double count; List<IWavePlayer> devices = new List<IWavePlayer>();
int count = -1;
Random rnd = new Random(); Random rnd = new Random();
int origRow = Console.CursorTop;
int origCol = Console.CursorLeft;
public void newThread(parseManager PM, string Block) public void newThread(parseManager PM, string Block)
{ {
var thread = new Thread(() => _THREAD(Block, PM)); var thread = new Thread(() => _THREAD(Block, PM));
@ -1240,6 +1290,8 @@ public class standardDefine
PM = new parseManager(path, define); PM = new parseManager(path, define);
} }
} }
GLOBALS.AddThread(PM);
PM.makeThread();
PM._SetDENV(_PM.GetDENV()); PM._SetDENV(_PM.GetDENV());
PM.SetENV(_PM.GetENV()); PM.SetENV(_PM.GetENV());
nextType next = PM.Next(block); nextType next = PM.Next(block);
@ -1251,6 +1303,9 @@ public class standardDefine
} }
public void SAVE(parseManager PM) public void SAVE(parseManager PM)
{ {
if(PM.isAThread()){
PM.PushError("Cannot Call SAVE() in a thread!");
}
var env = PM.GetDENV(); var env = PM.GetDENV();
var c = PM.GetCurrentChunk(); var c = PM.GetCurrentChunk();
env["__CurrentChunkName"] = c.GetName(); env["__CurrentChunkName"] = c.GetName();
@ -1260,6 +1315,9 @@ public class standardDefine
} }
public bool LOAD(parseManager PM) public bool LOAD(parseManager PM)
{ {
if(PM.isAThread()){
PM.PushError("Cannot Call LOAD() in a thread!");
}
try { try {
ENV env = GLOBALS.ReadFromBinaryFile("savedata.dat"); ENV env = GLOBALS.ReadFromBinaryFile("savedata.dat");
var name = (string)env["__CurrentChunkName"]; var name = (string)env["__CurrentChunkName"];
@ -1269,6 +1327,7 @@ public class standardDefine
PM.SetENV(denv); PM.SetENV(denv);
PM.SetBlock(name); PM.SetBlock(name);
PM.GetCurrentChunk().SetPos(pos); PM.GetCurrentChunk().SetPos(pos);
GLOBALS.FixThreads(PM);
return true; return true;
} catch { } catch {
return false; return false;
@ -1284,10 +1343,12 @@ public class standardDefine
} }
public void EXIT(parseManager PM) public void EXIT(parseManager PM)
{ {
cleanUpAudio();
PM.Deactivate(); PM.Deactivate();
} }
public void QUIT(parseManager PM) public void QUIT(parseManager PM)
{ {
cleanUpAudio();
Environment.Exit(0); Environment.Exit(0);
} }
public void setENV(parseManager PM, ENV env) public void setENV(parseManager PM, ENV env)
@ -1455,67 +1516,189 @@ public class standardDefine
{ {
Console.Beep(); Console.Beep();
} }
public void fancy(parseManager PM, string form, string msg) public void fancy(parseManager PM, string msg)
{ {
Fancy.SetForm(form);
Fancy.Print(msg); Fancy.Print(msg);
} }
ISoundOut GetSoundOut() public void setFancyForm(parseManager PM, string form)
{ {
if (WasapiOut.IsSupportedOnCurrentPlatform) Fancy.SetForm(form);
return new WasapiOut();
else
return new DirectSoundOut();
} }
IWaveSource GetSoundSource(string path) public void setFancyType(parseManager PM, double f)
{ {
return CodecFactory.Instance.GetCodec(path); Fancy.SetFVar((int)f);
}
public void _load()
{
string path = (string)GLOBALS.GetData("__MUSIC");
double id = (double)GLOBALS.GetData("__MUSICH");
using (IWaveSource soundSource = GetSoundSource(path)) {
using (ISoundOut soundOut = GetSoundOut()) {
soundOut.Initialize(soundSource);
GLOBALS.AddData("__MUSICH" + id, soundOut);
while (true) {
Thread.Sleep(100);
}
}
}
} }
public void stopSong(parseManager PM, double id) public void stopSong(parseManager PM, double id)
{ {
var sound = (ISoundOut)GLOBALS.GetData("__MUSICH" + id); devices[(int)id].Stop();
sound.Stop();
} }
public void playSong(parseManager PM, double id) public void playSong(parseManager PM, double id)
{ {
var sound = (ISoundOut)GLOBALS.GetData("__MUSICH" + id); devices[(int)id].Play();
sound.Play();
} }
public void resumeSong(parseManager PM, double id) public void resumeSong(parseManager PM, double id)
{ {
var sound = (ISoundOut)GLOBALS.GetData("__MUSICH" + id); devices[(int)id].Play();
sound.Resume();
} }
public void setSongVolume(parseManager PM, double id, double vol) public void setSongVolume(parseManager PM, double id, double vol)
{ {
var sound = (ISoundOut)GLOBALS.GetData("__MUSICH" + id); devices[(int)id].Volume = (float)vol;
sound.Volume = (float)vol;
} }
public void pauseSong(parseManager PM, double id) public void pauseSong(parseManager PM, double id)
{ {
var sound = (ISoundOut)GLOBALS.GetData("__MUSICH" + id); devices[(int)id].Pause();
sound.Pause(); }
public void replaySong(parseManager PM, double id)
{
devices[(int)id].Stop();
devices[(int)id].Play();
} }
public double loadSong(parseManager PM, string filepath) public double loadSong(parseManager PM, string filepath)
{ {
GLOBALS.AddData("__MUSIC", filepath); count++;
GLOBALS.AddData("__MUSICH", count++); devices.Add(new WaveOut());
var oThread = new Thread(new ThreadStart(_load)); var temp = new AudioFileReader(filepath);
oThread.Start(); devices[count].Init(temp);
return count - 1; return count;
} }
void cleanUpAudio()
{
for (int i = 0; i < devices.Count; i++) {
devices[i].Stop();
devices[i].Dispose();
}
}
public void setPosition(parseManager PM, double x, double y)
{
Console.SetCursorPosition((int)x, (int)y);
}
public void writeAt(parseManager PM, string s, double x, double y)
{
try {
Console.SetCursorPosition(origCol + (int)x, origRow + (int)y);
Console.Write(s);
} catch (ArgumentOutOfRangeException e) {
Console.Clear();
Console.WriteLine(e.Message);
}
}
public bool isDown(parseManager PM, string key)
{
if (!ApplicationIsActivated()) {
return false;
}
Key kk = Key.Zoom;
var k = key.ToUpper();
if (k == "A") {
kk = Key.A;
} else if (k == "B") {
kk = Key.B;
} else if (k == "C") {
kk = Key.C;
} else if (k == "D") {
kk = Key.D;
} else if (k == "E") {
kk = Key.E;
} else if (k == "F") {
kk = Key.F;
} else if (k == "G") {
kk = Key.G;
} else if (k == "H") {
kk = Key.H;
} else if (k == "I") {
kk = Key.I;
} else if (k == "J") {
kk = Key.J;
} else if (k == "K") {
kk = Key.K;
} else if (k == "L") {
kk = Key.L;
} else if (k == "M") {
kk = Key.M;
} else if (k == "N") {
kk = Key.N;
} else if (k == "O") {
kk = Key.O;
} else if (k == "P") {
kk = Key.P;
} else if (k == "Q") {
kk = Key.Q;
} else if (k == "R") {
kk = Key.R;
} else if (k == "S") {
kk = Key.S;
} else if (k == "T") {
kk = Key.T;
} else if (k == "U") {
kk = Key.U;
} else if (k == "V") {
kk = Key.V;
} else if (k == "W") {
kk = Key.W;
} else if (k == "X") {
kk = Key.X;
} else if (k == "Y") {
kk = Key.Y;
} else if (k == "Z") {
kk = Key.Z;
} else if (k == "{UP}") {
kk = Key.Up;
} else if (k == "{DOWN}") {
kk = Key.Down;
} else if (k == "{LEFT}") {
kk = Key.Left;
} else if (k == "{RIGHT}") {
kk = Key.Right;
} else if (k == "{ENTER}") {
kk = Key.Enter;
} else if (k == "{LSHIFT}") {
kk = Key.LeftShift;
} else if (k == "{RSHIFT}") {
kk = Key.RightShift;
} else if (k == "0") {
kk = Key.D0;
} else if (k == "1") {
kk = Key.D1;
} else if (k == "2") {
kk = Key.D2;
} else if (k == "3") {
kk = Key.D3;
} else if (k == "4") {
kk = Key.D4;
} else if (k == "5") {
kk = Key.D5;
} else if (k == "6") {
kk = Key.D6;
} else if (k == "7") {
kk = Key.D7;
} else if (k == "8") {
kk = Key.D8;
} else if (k == "9") {
kk = Key.D9;
} else if (k == "{SPACE}") {
kk = Key.Space;
}
return Keyboard.IsKeyDown(kk);
}
public string isPressing(parseManager PM)
{
return Console.ReadKey(true).Key.ToString();
}
public static bool ApplicationIsActivated()
{
var activatedHandle = GetForegroundWindow();
if (activatedHandle == IntPtr.Zero) {
return false; // No window is currently activated
} else {
var procId = Process.GetCurrentProcess().Id;
int activeProcId;
GetWindowThreadProcessId(activatedHandle, out activeProcId);
return activeProcId == procId;
}
}
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
static extern IntPtr GetForegroundWindow();
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
static extern int GetWindowThreadProcessId(IntPtr handle, out int processId);
} }

View File

@ -8,8 +8,9 @@
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<RootNamespace>parseManager</RootNamespace> <RootNamespace>parseManager</RootNamespace>
<AssemblyName>parseManagerTester</AssemblyName> <AssemblyName>parseManagerTester</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<PlatformTarget>x86</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
@ -31,12 +32,12 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="CSCore">
<HintPath>..\packages\CSCore.1.2.1.1\lib\net35-client\CSCore.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp"> <Reference Include="Microsoft.CSharp">
<RequiredTargetFramework>4.0</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="NAudio">
<HintPath>..\packages\NAudio.1.8.2\lib\net35\NAudio.dll</HintPath>
</Reference>
<Reference Include="PresentationCore"> <Reference Include="PresentationCore">
<RequiredTargetFramework>3.0</RequiredTargetFramework> <RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference> </Reference>
@ -55,6 +56,12 @@
<Reference Include="System.Xml.Linq"> <Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="Vulkan">
<HintPath>..\packages\VulkanSharp.0.1.8\lib\net452\Vulkan.dll</HintPath>
</Reference>
<Reference Include="Vulkan.Windows">
<HintPath>..\packages\VulkanSharp.0.1.8\lib\net452\Vulkan.Windows.dll</HintPath>
</Reference>
<Reference Include="WindowsBase"> <Reference Include="WindowsBase">
<RequiredTargetFramework>3.0</RequiredTargetFramework> <RequiredTargetFramework>3.0</RequiredTargetFramework>
</Reference> </Reference>