Fix various MIDI corruption bugs.
[ardour.git] / libs / ardour / ardour / types.h
index 32b3231c4e3e6b1eca0f7c64972f3e3f0ec62e54..55655e9e261b5328e84d9efa3a0a0409ce76e47c 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #ifndef __ardour_types_h__
@@ -31,6 +30,7 @@
 
 #include <inttypes.h>
 #include <jack/types.h>
+#include <jack/midiport.h>
 #include <control_protocol/smpte.h>
 #include <pbd/id.h>
 
 typedef int intptr_t;
 #endif
 
-/* at some point move this into the ARDOUR namespace,
-   but for now its outside because it replaces the
-   old global "jack_nframes_t"
+/* eventually, we'd like everything (including JACK) to 
+   move to this. for now, its a dedicated type.
 */
 
-typedef uint32_t                    nframes_t;
+typedef int64_t                    nframes64_t;
 
 namespace ARDOUR {
 
@@ -58,6 +57,9 @@ namespace ARDOUR {
        typedef float                       gain_t;
        typedef uint32_t                    layer_t;
        typedef uint64_t                    microseconds_t;
+       typedef uint32_t                    nframes_t;
+
+       typedef unsigned char Byte;
 
        enum IOChange {
                NoChange = 0,
@@ -76,12 +78,23 @@ namespace ARDOUR {
        OverlapType coverage (nframes_t start_a, nframes_t end_a,
                              nframes_t start_b, nframes_t end_b);
 
+       /** See parameter.h
+        * XXX: I don't think/hope these hex values matter anymore.
+        */
        enum AutomationType {
+               NullAutomation = 0x0,
                GainAutomation = 0x1,
                PanAutomation = 0x2,
                PluginAutomation = 0x4,
                SoloAutomation = 0x8,
-               MuteAutomation = 0x10
+               MuteAutomation = 0x10,
+               MidiCCAutomation = 0x20,
+               MidiPgmChangeAutomation = 0x21,
+               MidiPitchBenderAutomation = 0x22,
+               MidiChannelAftertouchAutomation = 0x23,
+               FadeInAutomation = 0x40,
+               FadeOutAutomation = 0x80,
+               EnvelopeAutomation = 0x100
        };
 
        enum AutoState {
@@ -118,6 +131,22 @@ namespace ARDOUR {
                Destructive
        };
        
+       enum NoteMode {
+               Sustained,
+               Percussive
+       };
+       
+       enum ChannelMode {
+               AllChannels = 0, ///< Pass through all channel information unmodified
+               FilterChannels,  ///< Ignore events on certain channels
+               ForceChannel     ///< Force all events to a certain channel
+       };
+
+       enum EventTimeUnit {
+               Frames,
+               Beats
+       };
+       
        struct BBT_Time {
            uint32_t bars;
            uint32_t beats;
@@ -145,6 +174,18 @@ namespace ARDOUR {
            }
            
        };
+       enum SmpteFormat {
+               smpte_23976,
+               smpte_24,
+               smpte_24976,
+               smpte_25,
+               smpte_2997,
+               smpte_2997drop,
+               smpte_30,
+               smpte_30drop,
+               smpte_5994,
+               smpte_60
+       };
 
        struct AnyTime {
            enum Type {
@@ -230,7 +271,8 @@ namespace ARDOUR {
 
        enum EditMode {
                Slide,
-               Splice
+               Splice,
+               Lock
        };
 
        enum RegionPoint { 
@@ -252,7 +294,20 @@ namespace ARDOUR {
        enum MonitorModel {
                HardwareMonitoring,
                SoftwareMonitoring,
-               ExternalMonitoring,
+               ExternalMonitoring
+       };
+
+       enum DenormalModel {
+               DenormalNone,
+               DenormalFTZ,
+               DenormalDAZ,
+               DenormalFTZDAZ
+       };
+
+       enum RemoteModel {
+               UserOrdered,
+               MixerOrdered,
+               EditorOrdered
        };
 
        enum CrossfadeModel {
@@ -285,7 +340,8 @@ namespace ARDOUR {
 
        enum SampleFormat {
                FormatFloat = 0,
-               FormatInt24
+               FormatInt24,
+               FormatInt16
        };
 
 
@@ -309,6 +365,7 @@ namespace ARDOUR {
        enum PluginType {
                AudioUnit,
                LADSPA,
+               LV2,
                VST
        };
 
@@ -324,11 +381,33 @@ namespace ARDOUR {
        };
 
        enum ShuttleUnits {
-               Percentage,
+               Percentage,
                Semitones
        };
 
-       typedef std::vector<boost::shared_ptr<AudioSource> > SourceList;
+       typedef std::vector<boost::shared_ptr<Source> > SourceList;
+
+       enum SrcQuality {
+               SrcBest,
+               SrcGood,
+               SrcQuick,
+               SrcFast,
+               SrcFastest
+       };
+
+       struct TimeFXRequest : public InterThreadInfo {
+               TimeFXRequest() : time_fraction(0), pitch_fraction(0),
+                       quick_seek(false), antialias(false),  opts(0) {}
+           float time_fraction;
+           float pitch_fraction;
+           /* SoundTouch */
+           bool  quick_seek; 
+           bool  antialias;  
+           /* RubberBand */
+           int   opts; // really RubberBandStretcher::Options
+       };
+
+       typedef std::list<nframes64_t> AnalysisFeatureList;
 
 } // namespace ARDOUR
 
@@ -337,12 +416,17 @@ std::istream& operator>>(std::istream& o, ARDOUR::HeaderFormat& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::AutoConnectOption& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::EditMode& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::MonitorModel& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::RemoteModel& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::SoloModel& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::LayerModel& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::CrossfadeModel& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::SlaveSource& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::ShuttleBehaviour& sf);
 std::istream& operator>>(std::istream& o, ARDOUR::ShuttleUnits& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::SmpteFormat& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::DenormalModel& sf);
+
+using ARDOUR::nframes_t;
 
 static inline nframes_t
 session_frame_to_track_frame (nframes_t session_frame, double speed)