diff options
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r-- | libs/ardour/ardour/audio_unit.h | 30 | ||||
-rw-r--r-- | libs/ardour/ardour/audioengine.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/buffer.h | 58 | ||||
-rw-r--r-- | libs/ardour/ardour/data_type.h | 79 | ||||
-rw-r--r-- | libs/ardour/ardour/io.h | 7 | ||||
-rw-r--r-- | libs/ardour/ardour/plugin.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/plugin_manager.h | 16 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 8 |
10 files changed, 138 insertions, 70 deletions
diff --git a/libs/ardour/ardour/audio_unit.h b/libs/ardour/ardour/audio_unit.h index 88d311be44..ec437109a4 100644 --- a/libs/ardour/ardour/audio_unit.h +++ b/libs/ardour/ardour/audio_unit.h @@ -21,15 +21,41 @@ #ifndef __ardour_audio_unit_h__ #define __ardour_audio_unit_h__ +#include <list> + #include <ardour/plugin.h> +#include <boost/shared_ptr.hpp> + +struct ComponentDescription; + namespace ARDOUR { -class AudioUnit : public ARDOUR::Plugin +class AUPlugin : public ARDOUR::Plugin { + public: + AUPlugin (AudioEngine& engine, Session& session) : Plugin(engine, session) {}; + virtual ~AUPlugin () {}; +}; + +class AUPluginInfo : public PluginInfo { + public: + typedef boost::shared_ptr<ComponentDescription> CompDescPtr; + AUPluginInfo () { }; + ~AUPluginInfo () { }; + + CompDescPtr desc; + + static PluginInfoList discover (); + + private: + friend class PluginManager; }; +typedef boost::shared_ptr<AUPluginInfo> AUPluginInfoPtr; + } // namespace ARDOUR -#endif // __ardour_audio_unit_h__
\ No newline at end of file +#endif // __ardour_audio_unit_h__ + diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 81370e379c..e7500fc7a2 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -35,6 +35,7 @@ #include <jack/jack.h> #include <jack/transport.h> #include <ardour/types.h> +#include <ardour/data_type.h> namespace ARDOUR { diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h index cd36a06e36..1321f6c107 100644 --- a/libs/ardour/ardour/buffer.h +++ b/libs/ardour/ardour/buffer.h @@ -1,6 +1,5 @@ /* Copyright (C) 2006 Paul Davis - Written by Dave Robillard, 2006 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -24,7 +23,7 @@ #include <cstdlib> // for posix_memalign #include <cassert> #include <ardour/types.h> -#include <jack/jack.h> +#include <ardour/data_type.h> namespace ARDOUR { @@ -60,44 +59,7 @@ public: /** Type of this buffer. * Based on this you can static cast a Buffer* to the desired type. */ - virtual DataType type() const { return _type; } - - /** Jack type (eg JACK_DEFAULT_AUDIO_TYPE) */ - const char* jack_type() const { return type_to_jack_type(type()); } - - /** String type as saved in session XML files (eg "audio" or "midi") */ - const char* type_string() const { return type_to_string(type()); } - - /* The below static methods need to be separate from the above methods - * because the conversion is needed in places where there's no Buffer. - * These should probably live somewhere else... - */ - - static const char* type_to_jack_type(DataType t) { - switch (t) { - case AUDIO: return JACK_DEFAULT_AUDIO_TYPE; - case MIDI: return JACK_DEFAULT_MIDI_TYPE; - default: return ""; - } - } - - static const char* type_to_string(DataType t) { - switch (t) { - case AUDIO: return "audio"; - case MIDI: return "midi"; - default: return "unknown"; // reeeally shouldn't ever happen - } - } - - /** Used for loading from XML (route default types etc) */ - static DataType type_from_string(const string& str) { - if (str == "audio") - return AUDIO; - else if (str == "midi") - return MIDI; - else - return NIL; - } + DataType type() const { return _type; } protected: DataType _type; @@ -114,12 +76,12 @@ class AudioBuffer : public Buffer { public: AudioBuffer(size_t capacity) - : Buffer(AUDIO, capacity) + : Buffer(DataType::AUDIO, capacity) , _data(NULL) { _size = capacity; // For audio buffers, size = capacity (always) #ifdef NO_POSIX_MEMALIGN - b = (Sample *) malloc(sizeof(Sample) * capacity); + _data = (Sample *) malloc(sizeof(Sample) * capacity); #else posix_memalign((void**)_data, 16, sizeof(Sample) * capacity); #endif @@ -135,7 +97,7 @@ private: AudioBuffer(const AudioBuffer& copy); AudioBuffer& operator=(const AudioBuffer& copy); - Sample* const _data; ///< Actual buffer contents + Sample* _data; ///< Actual buffer contents }; @@ -145,17 +107,17 @@ class MidiBuffer : public Buffer { public: MidiBuffer(size_t capacity) - : Buffer(MIDI, capacity) + : Buffer(DataType::MIDI, capacity) , _data(NULL) { + _size = capacity; // For audio buffers, size = capacity (always) #ifdef NO_POSIX_MEMALIGN - b = (Sample *) malloc(sizeof(RawMidi) * capacity); + _data = (RawMidi *) malloc(sizeof(RawMidi) * capacity); #else posix_memalign((void**)_data, 16, sizeof(RawMidi) * capacity); #endif assert(_data); - assert(_size == 0); - memset(_data, 0, sizeof(Sample) * capacity); + memset(_data, 0, sizeof(RawMidi) * capacity); } const RawMidi* data() const { return _data; } @@ -166,7 +128,7 @@ private: MidiBuffer(const MidiBuffer& copy); MidiBuffer& operator=(const MidiBuffer& copy); - RawMidi* const _data; ///< Actual buffer contents + RawMidi* _data; ///< Actual buffer contents }; diff --git a/libs/ardour/ardour/data_type.h b/libs/ardour/ardour/data_type.h new file mode 100644 index 0000000000..d49ed108cd --- /dev/null +++ b/libs/ardour/ardour/data_type.h @@ -0,0 +1,79 @@ +/* + Copyright (C) 2006 Paul Davis + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef __ardour_data_type_h__ +#define __ardour_data_type_h__ + +#include <jack/jack.h> + +namespace ARDOUR { + +class DataType +{ +public: + enum Symbol { + NIL = 0, + AUDIO, + MIDI + }; + + DataType(const Symbol& symbol) + : _symbol(symbol) + {} + + /** Construct from a string (Used for loading from XML) */ + DataType(const string& str) { + if (str == "audio") + _symbol = AUDIO; + //else if (str == "midi") + // _symbol = MIDI; + else + _symbol = NIL; + } + + bool operator==(const Symbol symbol) { return _symbol == symbol; } + bool operator!=(const Symbol symbol) { return _symbol != symbol; } + + /** Get the Jack type this DataType corresponds to */ + const char* to_jack_type() { + switch (_symbol) { + case AUDIO: return JACK_DEFAULT_AUDIO_TYPE; + //case MIDI: return JACK_DEFAULT_MIDI_TYPE; + default: return ""; + } + } + + /** Inverse of the from-string constructor */ + const char* to_string() { + switch (_symbol) { + case AUDIO: return "audio"; + //case MIDI: return "midi"; + default: return "unknown"; // reeeally shouldn't ever happen + } + } + +private: + Symbol _symbol; +}; + + + +} // namespace ARDOUR + +#endif // __ardour_data_type_h__ + diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index 35b20f655e..b116a58b97 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -39,6 +39,7 @@ #include <ardour/state_manager.h> #include <ardour/curve.h> #include <ardour/types.h> +#include <ardour/data_type.h> using std::string; using std::vector; @@ -67,7 +68,7 @@ class IO : public Stateful, public ARDOUR::StateManager IO (Session&, string name, int input_min = -1, int input_max = -1, int output_min = -1, int output_max = -1, - DataType default_type = AUDIO); + DataType default_type = DataType::AUDIO); virtual ~IO(); @@ -116,8 +117,8 @@ class IO : public Stateful, public ARDOUR::StateManager Connection *input_connection() const { return _input_connection; } Connection *output_connection() const { return _output_connection; } - int add_input_port (string source, void *src, DataType type = NIL); - int add_output_port (string destination, void *src, DataType type = NIL); + int add_input_port (string source, void *src, DataType type = DataType::NIL); + int add_output_port (string destination, void *src, DataType type = DataType::NIL); int remove_input_port (Port *, void *src); int remove_output_port (Port *, void *src); diff --git a/libs/ardour/ardour/plugin.h b/libs/ardour/ardour/plugin.h index 97708065e4..86666c19af 100644 --- a/libs/ardour/ardour/plugin.h +++ b/libs/ardour/ardour/plugin.h @@ -73,6 +73,9 @@ class PluginInfo { uint32_t index; }; +typedef boost::shared_ptr<PluginInfo> PluginInfoPtr; +typedef std::list<PluginInfoPtr> PluginInfoList; + class Plugin : public Stateful, public sigc::trackable { diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h index ca378dee98..8543ad5285 100644 --- a/libs/ardour/ardour/plugin_manager.h +++ b/libs/ardour/ardour/plugin_manager.h @@ -8,6 +8,8 @@ #include <boost/shared_ptr.hpp> #include <ardour/types.h> +#include <ardour/plugin.h> +#include <ardour/audio_unit.h> namespace ARDOUR { @@ -21,24 +23,24 @@ class PluginManager { PluginManager (ARDOUR::AudioEngine&); ~PluginManager (); - std::list<PluginInfo*> &vst_plugin_info () { return _vst_plugin_info; } - std::list<PluginInfo*> &ladspa_plugin_info () { return _ladspa_plugin_info; } - std::list<PluginInfo*> &au_plugin_info () { return _au_plugin_info; } + ARDOUR::PluginInfoList &vst_plugin_info () { return _vst_plugin_info; } + ARDOUR::PluginInfoList &ladspa_plugin_info () { return _ladspa_plugin_info; } + ARDOUR::PluginInfoList &au_plugin_info () { return _au_plugin_info; } void refresh (); int add_ladspa_directory (std::string dirpath); int add_vst_directory (std::string dirpath); - boost::shared_ptr<Plugin> load (ARDOUR::Session& s, PluginInfo* info); + boost::shared_ptr<Plugin> load (ARDOUR::Session& s, PluginInfoPtr info); static PluginManager* the_manager() { return _manager; } private: ARDOUR::AudioEngine& _engine; - std::list<PluginInfo*> _vst_plugin_info; - std::list<PluginInfo*> _ladspa_plugin_info; - std::list<PluginInfo*> _au_plugin_info; + ARDOUR::PluginInfoList _vst_plugin_info; + ARDOUR::PluginInfoList _ladspa_plugin_info; + ARDOUR::PluginInfoList _au_plugin_info; std::map<uint32_t, std::string> rdf_type; std::string ladspa_path; diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index ea4a2374d4..8271c1cf6a 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -70,7 +70,7 @@ class Route : public IO Route (Session&, std::string name, int input_min, int input_max, int output_min, int output_max, - Flag flags = Flag(0), DataType default_type = AUDIO); + Flag flags = Flag(0), DataType default_type = DataType::AUDIO); Route (Session&, const XMLNode&); virtual ~Route(); diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index 707ead1573..f16e9d29d9 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -31,7 +31,7 @@ class RouteGroup; class Track : public Route { public: - Track (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal, DataType default_type = AUDIO); + Track (Session&, string name, Route::Flag f = Route::Flag (0), TrackMode m = Normal, DataType default_type = DataType::AUDIO); virtual ~Track (); @@ -91,7 +91,7 @@ class Track : public Route sigc::signal<void> FreezeChange; protected: - Track (Session& sess, const XMLNode& node, DataType default_type = AUDIO); + Track (Session& sess, const XMLNode& node, DataType default_type = DataType::AUDIO); virtual XMLNode& state (bool full) = 0; diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h index eb86470ebc..c30c103d3f 100644 --- a/libs/ardour/ardour/types.h +++ b/libs/ardour/ardour/types.h @@ -195,7 +195,7 @@ namespace ARDOUR { Splice }; - enum RegionPoint { + enum RegionPoint { Start, End, SyncPoint @@ -245,12 +245,6 @@ namespace ARDOUR { PeakDatum min; PeakDatum max; }; - - enum DataType { - NIL = 0, - AUDIO, - MIDI - }; } std::istream& operator>>(std::istream& o, ARDOUR::SampleFormat& sf); |