punk@16
|
1
|
punk@16
|
2 // The MIT License
|
punk@16
|
3
|
punk@16
|
4 // Copyright (c) 2009 Massachusetts Institute of Technology
|
punk@16
|
5
|
punk@16
|
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
punk@16
|
7 // of this software and associated documentation files (the "Software"), to deal
|
punk@16
|
8 // in the Software without restriction, including without limitation the rights
|
punk@16
|
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
punk@16
|
10 // copies of the Software, and to permit persons to whom the Software is
|
punk@16
|
11 // furnished to do so, subject to the following conditions:
|
punk@16
|
12
|
punk@16
|
13 // The above copyright notice and this permission notice shall be included in
|
punk@16
|
14 // all copies or substantial portions of the Software.
|
punk@16
|
15
|
punk@16
|
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
punk@16
|
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
punk@16
|
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
punk@16
|
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
punk@16
|
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
punk@16
|
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
punk@16
|
22 // THE SOFTWARE.
|
punk@16
|
23
|
punk@16
|
24 // Author: Kermin Fleming kfleming@mit.edu
|
punk@16
|
25
|
punk@16
|
26 import Connectable::*;
|
punk@16
|
27 import GetPut::*;
|
punk@16
|
28 import ClientServer::*;
|
punk@16
|
29
|
punk@16
|
30 typedef Int#(16) Sample;
|
punk@16
|
31
|
punk@16
|
32 typedef enum {
|
punk@16
|
33 EndOfFile = 0,
|
punk@16
|
34 Data = 1
|
punk@16
|
35 } AudioProcessorControl deriving (Bits,Eq);
|
punk@16
|
36
|
punk@16
|
37
|
punk@16
|
38 typedef struct {
|
punk@16
|
39 Sample left;
|
punk@16
|
40 Sample right;
|
punk@16
|
41 } StereoSample deriving (Bits,Eq);
|
punk@16
|
42
|
punk@16
|
43 typedef union tagged{
|
punk@16
|
44 Sample Sample;
|
punk@16
|
45 void EndOfFile;
|
punk@16
|
46 } AudioProcessorUnit deriving (Bits,Eq);
|
punk@16
|
47
|
punk@16
|
48 interface AudioPipeline;
|
punk@16
|
49 interface Put#(AudioProcessorUnit) sampleInput;
|
punk@16
|
50 interface Get#(AudioProcessorUnit) sampleOutput;
|
punk@16
|
51 endinterface
|
punk@16
|
52
|