root/juggler/tags/1.0.5/Sound/vjSoundFactory.h

Revision 2828, 3.8 kB (checked in by patrickh, 8 years ago)

Updated the copyright to what ISU's lawyers decided they want now.
The vast majority of this was done using Kevin's auto-copyright.pl script
which definitely made this easier. All the copyright blocks now have
begin and end tags so that if and when we have to update the copyright
information again, it will be even simpler.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
2  *
3  * VR Juggler is (C) Copyright 1998, 1999, 2000 by Iowa State University
4  *
5  * Original Authors:
6  *   Allen Bierbaum, Christopher Just,
7  *   Patrick Hartling, Kevin Meinert,
8  *   Carolina Cruz-Neira, Albert Baker
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Library General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU Library General Public
21  * License along with this library; if not, write to the
22  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23  * Boston, MA 02111-1307, USA.
24  *
25  * -----------------------------------------------------------------
26  * File:          $RCSfile$
27  * Date modified: $Date$
28  * Version:       $Revision$
29  * -----------------------------------------------------------------
30  *
31  *************** <auto-copyright.pl END do not edit this line> ***************/
32
33 #ifndef VJ_SOUND_FACTORY
34 #define VJ_SOUND_FACTORY
35
36 #include <Sound/vjSoundEngine.h>
37 #include <Sound/vjSound.h>
38 #include <Kernel/vjDebug.h>
39 #include <vector>
40 #include <typeinfo>
41 #include <Utils/vjSingleton.h>
42
43 //: soundengines use the SEC to register themselves with the sound factory
44 class vjSoundEngineConstructorBase;
45
46
47 //: use the vjSoundFactory factory to create a new sound engine.
48 // do not create an engine directly.
49 //!PUBLIC_API:
50 class vjSoundFactory
51 {
52 public:
53    // pass in a description of the sound engine (like sl, aw, nosound)
54    // pass in a config file name to go with that sound engine.
55    // returns a non-NULL pointer on success, NULL on failure.
56    //static SoundEngine* newEngine( const std::string& description, const char* const setupFile = NULL );
57
58         //: Query if the factory knows about the given sound engine
59    //!PRE: chunk != NULL, chunk is a valid chunk
60    //!ARGS: chunk - chunk we are requesting about knowledge to create
61    //!RETURNS: true - factory knows how to create the engine
62    //+          false - factory does not know how to create the engine
63    bool recognizeEngine(vjConfigChunk* chunk);
64
65    //: Load the specified device
66    //!PRE: recognizeDevice(chunk) == true
67    //!ARGS: chunk - specification of the device to load
68    //!RETURNS: null - Device failed to load
69    //+         other - Pointer to the loaded device
70    vjSoundEngine* loadEngine(vjConfigChunk* chunk);
71
72
73 public:
74    // register a creator to the factory.
75    // this is intended to be used by each api's registration method
76    void registerConstructor( vjSoundEngineConstructorBase* constructor );
77
78    // TODO: add a removeCreator function.
79 protected:
80    /*
81         // returns a creator mased on some description
82    // pointer to the found creator is returned
83    // success value is also returned, true if one is found.
84    bool lookupCreator( const std::string& description, SoundEngineCreator* &sec );
85         */
86
87         //: Find a constructor for the given device type
88    //!RETURNS: -1 - Not found
89    //+            - Index of the constructorck
90    int   findConstructor(vjConfigChunk* chunk);
91
92 protected:
93    // regged soundengines...
94    std::vector< vjSoundEngineConstructorBase* > mConstructors;
95
96 protected:
97    //: Constructor.
98    vjSoundFactory();
99
100 vjSingletonHeader(vjSoundFactory);
101 /*
102 public:
103    //: Get instance of singleton object
104    static vjSoundFactory* instance()
105    {
106       if (_instance == NULL)
107          _instance = new vjSoundFactory;
108       return _instance;
109    }
110
111 private:
112    static vjSoundFactory* _instance;   //: The instance
113    */
114 };
115
116 #endif
Note: See TracBrowser for help on using the browser.