summaryrefslogtreecommitdiffstats
path: root/src/common/interface
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/interface')
-rw-r--r--src/common/interface/Port.hpp4
-rw-r--r--src/common/interface/PortType.hpp (renamed from src/common/interface/DataType.hpp)31
2 files changed, 15 insertions, 20 deletions
diff --git a/src/common/interface/Port.hpp b/src/common/interface/Port.hpp
index 884b10e3..c7029095 100644
--- a/src/common/interface/Port.hpp
+++ b/src/common/interface/Port.hpp
@@ -20,7 +20,7 @@
#include <stdint.h>
#include "GraphObject.hpp"
-#include "DataType.hpp"
+#include "PortType.hpp"
namespace Raul { class Atom; }
@@ -39,7 +39,7 @@ class Port : public virtual GraphObject
public:
virtual uint32_t index() const = 0;
virtual bool is_input() const = 0;
- virtual Shared::DataType type() const = 0;
+ virtual Shared::PortType type() const = 0;
virtual const Raul::Atom& value() const = 0;
};
diff --git a/src/common/interface/DataType.hpp b/src/common/interface/PortType.hpp
index dc2726df..77211b71 100644
--- a/src/common/interface/DataType.hpp
+++ b/src/common/interface/PortType.hpp
@@ -15,8 +15,8 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef DATATYPE_H
-#define DATATYPE_H
+#ifndef PORTTYPE_H
+#define PORTTYPE_H
#include <raul/URI.hpp>
@@ -24,15 +24,13 @@ namespace Ingen {
namespace Shared {
-/** A data type that can be stored in a Port.
+/** The type of a port.
*
- * This type refers to the type of the entire buffer, mirroring LV2,
- * e.g. :AudioPort and :ControlPort both are really 32-bit floating point,
- * but they are different port types.
- *
- * FIXME: Event/MIDI/OSC kludges.
+ * This type refers to the type of the port itself (not necessarily the type
+ * of its contents). Ports with different types can contain the same type of
+ * data, but may e.g. have different access semantics.
*/
-class DataType {
+class PortType {
public:
enum Symbol {
@@ -40,13 +38,10 @@ public:
AUDIO = 1,
CONTROL = 2,
EVENTS = 3,
- //MIDI = 4,
- //OSC = 5,
- //STRING = 6,
- VALUE = 7
+ VALUE = 7,
};
- DataType(const Raul::URI& uri)
+ PortType(const Raul::URI& uri)
: _symbol(UNKNOWN)
{
if (uri.str() == type_uri(AUDIO)) {
@@ -60,7 +55,7 @@ public:
}
}
- DataType(Symbol symbol)
+ PortType(Symbol symbol)
: _symbol(symbol)
{}
@@ -69,8 +64,8 @@ public:
inline bool operator==(const Symbol& symbol) const { return (_symbol == symbol); }
inline bool operator!=(const Symbol& symbol) const { return (_symbol != symbol); }
- inline bool operator==(const DataType& type) const { return (_symbol == type._symbol); }
- inline bool operator!=(const DataType& type) const { return (_symbol != type._symbol); }
+ inline bool operator==(const PortType& type) const { return (_symbol == type._symbol); }
+ inline bool operator!=(const PortType& type) const { return (_symbol != type._symbol); }
inline bool is_audio() { return _symbol == AUDIO; }
inline bool is_control() { return _symbol == CONTROL; }
@@ -99,4 +94,4 @@ private:
} // namespace Shared
} // namespace Ingen
-#endif // DATATYPE_H
+#endif // PORTTYPE_H