diff options
author | David Robillard <d@drobilla.net> | 2006-08-01 21:33:25 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-08-01 21:33:25 +0000 |
commit | 959438031cf5fe15fef1145c6e5970fdba4e2f35 (patch) | |
tree | e4883f0281d492e45c1a973eac0fc86979d8ac23 /libs/ardour/ardour/buffer.h | |
parent | 14f461218121d2b0d68158d7061cbaa375d827e8 (diff) |
Moved DataType into it's own class (resolved a name clash on ARDOUR::MIDI
which was a show stopper for gcc 3.3)
Also fixed a few warnings in fft_graph.cc
git-svn-id: svn://localhost/ardour2/trunk@739 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/buffer.h')
-rw-r--r-- | libs/ardour/ardour/buffer.h | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/libs/ardour/ardour/buffer.h b/libs/ardour/ardour/buffer.h index 3e4a119710..8a88802ecb 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,7 +76,7 @@ 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) |