1/*
2 * Copyright (c) 1999-2000, Eric Moon.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 *    notice, this list of conditions, and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the above copyright
13 *    notice, this list of conditions, and the following disclaimer in the
14 *    documentation and/or other materials provided with the distribution.
15 *
16 * 3. The name of the author may not be used to endorse or promote products
17 *    derived from this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
27 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31
32// IAudioFilterOpFactory.h
33// * PURPOSE
34//   An interface to an 'algorithm finder' object.  Implementations
35//   of IFAudioilterOpFactory are given format and parameter information,
36//   and are required to return the best-matching algorithm (IAudioFilterOp
37//   implementation) -- or 0 if no algorithm can handle the given
38//   formats.
39//
40//   One subclass of IAudioFilterOpFactory should exist for each
41//   algorithm family, since create() provides no way to select a
42//   particular algorithm.  The stock create() should produce an
43//   operation initialized to acceptible defaults, but you can
44//   always overload create() to provide more options.
45//
46// * UP IN THE AIR +++++
47//   - query mechanism -- determine if a format/parameter change
48//     will require an algorithm switch?
49//   - explicit parameter support?  seems a better approach than
50//     overloading the create() method with parameters for each
51//     type of filter operation... ?
52//
53// * HISTORY
54//   e.moon		26aug99		Begun.
55
56#ifndef __IAudioFilterOpFactory_H__
57#define __IAudioFilterOpFactory_H__
58
59#include <MediaDefs.h>
60
61class IAudioFilterOp;
62
63class IAudioFilterOpFactory {
64public:											// *** INTERFACE
65	// The basic create method.  subclasses devoted to producing
66	// more specialized audio-filter operations may want to override
67	// this with further arguments specific to the task at hand.
68	// Return 0 if no algorithm could be found for the given format.
69
70	virtual IAudioFilterOp* create(
71		const media_raw_audio_format&		sourceFormat,
72		const media_raw_audio_format&		destinationFormat) =0;
73
74public:											// *** HOOKS
75	virtual ~IAudioFilterOpFactory() {}
76
77};
78
79#endif /*__IAudioFilterOpFactory_H__*/
80