aboutsummaryrefslogtreecommitdiff
path: root/pd/Atom.cs
blob: 7e0affa88e152ba6622e2561725259528801c1d1 (plain)
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
using System;
using System.Runtime.InteropServices; // for structures

namespace PureData
{
	public enum AtomType {Null = 0, Float=1, Symbol=2, List=3, Bang=4};

	//[StructLayout (LayoutKind.Explicit)]
	[StructLayout (LayoutKind.Sequential)]
	public struct Atom 
	{
		public AtomType type;
		public float float_value;
		public string string_value;
		public Atom(float f)
		{
			this.type = AtomType.Float;
			this.float_value = f;
			this.string_value = "float";
		}
		public Atom(string s)
		{
			this.type = AtomType.Symbol;
			this.float_value = 0;
			this.string_value = s;
		}
	}
}