Fix various MIDI corruption bugs.
[ardour.git] / libs / ardour / ardour / types.h
index 05956336b66e66b235a22f10c47dfd753f841fc0..55655e9e261b5328e84d9efa3a0a0409ce76e47c 100644 (file)
@@ -30,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 {
 
@@ -57,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,
@@ -75,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 {
@@ -117,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;
@@ -241,7 +271,8 @@ namespace ARDOUR {
 
        enum EditMode {
                Slide,
-               Splice
+               Splice,
+               Lock
        };
 
        enum RegionPoint { 
@@ -263,13 +294,20 @@ namespace ARDOUR {
        enum MonitorModel {
                HardwareMonitoring,
                SoftwareMonitoring,
-               ExternalMonitoring,
+               ExternalMonitoring
+       };
+
+       enum DenormalModel {
+               DenormalNone,
+               DenormalFTZ,
+               DenormalDAZ,
+               DenormalFTZDAZ
        };
 
        enum RemoteModel {
                UserOrdered,
                MixerOrdered,
-               EditorOrdered,
+               EditorOrdered
        };
 
        enum CrossfadeModel {
@@ -302,7 +340,8 @@ namespace ARDOUR {
 
        enum SampleFormat {
                FormatFloat = 0,
-               FormatInt24
+               FormatInt24,
+               FormatInt16
        };
 
 
@@ -326,6 +365,7 @@ namespace ARDOUR {
        enum PluginType {
                AudioUnit,
                LADSPA,
+               LV2,
                VST
        };
 
@@ -345,7 +385,29 @@ namespace ARDOUR {
                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
 
@@ -362,6 +424,9 @@ 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)