-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMDOption.cs
executable file
·50 lines (43 loc) · 1.42 KB
/
CMDOption.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
namespace ffteq
{
abstract class CMDOptionParam
{
abstract public string Name { get; }
abstract public string Description { get; }
/// <returns>
/// Is string s valid as this argument?
/// </returns>
abstract public bool Validate(String s);
}
class CMDOptionParamDouble : CMDOptionParam
{
public double Value { private set; get; }
private string name;
private string description;
public override string Name { get { return name; } }
public override string Description { get { return description; } }
public CMDOptionParamDouble(string name, string description)
{
this.name = name;
this.description = description;
}
public override bool Validate(String s)
{
double v;
return Double.TryParse(s, out v);
}
}
abstract class CMDOption
{
abstract public string Name { get; }
abstract public string Description { get; }
abstract public CMDOptionParam[] Params { get; }
public int ParamNum { get { return Params.Length; } }
/// <summary>
/// Shall return signal with the same number of samples and sample
/// rate. The signal should be processed by an effect.
/// </summary>
abstract public Signal Execute(Signal inSignal, string[] args);
}
}