- virtual Type 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 */
- static const char* type_to_jack_type(Type 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(Type 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 Type type_from_string(const string& str) {
- if (str == "audio")
- return AUDIO;
- else if (str == "midi")
- return MIDI;
- else
- return NIL;
- }
-
-protected:
- Type _type;
- size_t _capacity;
- size_t _size;
-};