xref: /haiku/src/apps/cortex/addons/common/IAudioOpFactory.h (revision d2e1e872611179c9cfaa43ce11bd58b1e3554e4b)
1 // IAudioOpFactory.h
2 // * PURPOSE
3 //   An interface to an 'algorithm finder' object.  Implementations
4 //   of IAudioOpFactory are given format and parameter information,
5 //   and are required to return the best-matching algorithm (IAudioOp
6 //   implementation) -- or 0 if no algorithm can handle the given
7 //   formats.
8 //
9 //   One subclass of IAudioOpFactory should exist for each
10 //   algorithm family, since create() provides no way to select a
11 //   particular algorithm.  The stock create() should produce an
12 //   operation initialized to acceptible defaults, but you can
13 //   always overload create() to provide more options.
14 //
15 // * UP IN THE AIR +++++
16 //   - query mechanism -- determine if a format/parameter change
17 //     will require an algorithm switch?
18 //   - explicit parameter support?  seems a better approach than
19 //     overloading the create() method with parameters for each
20 //     type of filter operation... ?
21 //
22 // * HISTORY
23 //   e.moon		26aug99		Begun.
24 
25 #ifndef __IAudioOpFactory_H__
26 #define __IAudioOpFactory_H__
27 
28 #include <MediaDefs.h>
29 
30 class IAudioOp;
31 class IAudioOpHost;
32 class IParameterSet;
33 
34 class IAudioOpFactory {
35 public:											// *** INTERFACE
36 	// The basic operation-creation method.
37 	// Return 0 if no algorithm could be found for the given format.
38 
39 	virtual IAudioOp* createOp(
40 		IAudioOpHost*										host,
41 		const media_raw_audio_format&		inputFormat,
42 		const media_raw_audio_format&		outputFormat) =0;
43 
44 	// Return an IParameter object for the category of
45 	// operation you create.
46 
47 	virtual IParameterSet* createParameterSet() =0;
48 
49 public:											// *** HOOKS
50 	virtual ~IAudioOpFactory() {}
51 };
52 
53 #endif /*__IAudioOpFactory_H__*/
54