Add a method to get the first DataType
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Wed, 23 Aug 2017 20:44:32 +0000 (22:44 +0200)
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>
Wed, 23 Aug 2017 20:58:05 +0000 (22:58 +0200)
Also put a comment about the ordering of DataTypes.

libs/ardour/ardour/data_type.h

index bc59aebeb640e373264237faab496775c6f18d96..df241d58994acb0e8cba378d3911b9686ec9566f 100644 (file)
@@ -44,6 +44,9 @@ public:
         * types are added, so this number is NOT suitable for serialization,
         * network, or binary anything.
         *
+        * Some heuristics in Ardour's UI assume that the DataTypes are ordered
+        * from most to least likely to be the main intended type of a route.
+        *
         * WARNING: The number of non-NIL entries here must match num_types.
         */
        enum Symbol {
@@ -61,6 +64,8 @@ public:
        : _symbol(symbol)
        {}
 
+       static DataType front() { return DataType((Symbol) 0); }
+
        /** Construct from a string (Used for loading from XML and Ports)
         * The string can be as in an XML file (eg "audio" or "midi"), or a
         */