Fix various MIDI corruption bugs.
[ardour.git] / libs / ardour / ardour / types.h
index 1138b5208f462b4ead8f9006c2341c5cadeb8f37..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__
 typedef int intptr_t;
 #endif
 
+/* eventually, we'd like everything (including JACK) to 
+   move to this. for now, its a dedicated type.
+*/
+
+typedef int64_t                    nframes64_t;
+
 namespace ARDOUR {
 
        class Source;
@@ -54,8 +59,7 @@ namespace ARDOUR {
        typedef uint64_t                    microseconds_t;
        typedef uint32_t                    nframes_t;
 
-       typedef jack_midi_event_t MidiEvent;
-       typedef unsigned char     RawMidi;
+       typedef unsigned char Byte;
 
        enum IOChange {
                NoChange = 0,
@@ -74,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 {
@@ -116,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;
@@ -143,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 {
@@ -228,7 +271,8 @@ namespace ARDOUR {
 
        enum EditMode {
                Slide,
-               Splice
+               Splice,
+               Lock
        };
 
        enum RegionPoint { 
@@ -250,7 +294,20 @@ namespace ARDOUR {
        enum MonitorModel {
                HardwareMonitoring,
                SoftwareMonitoring,
-               ExternalMonitoring,
+               ExternalMonitoring
+       };
+
+       enum DenormalModel {
+               DenormalNone,
+               DenormalFTZ,
+               DenormalDAZ,
+               DenormalFTZDAZ
+       };
+
+       enum RemoteModel {
+               UserOrdered,
+               MixerOrdered,
+               EditorOrdered
        };
 
        enum CrossfadeModel {
@@ -283,7 +340,8 @@ namespace ARDOUR {
 
        enum SampleFormat {
                FormatFloat = 0,
-               FormatInt24
+               FormatInt24,
+               FormatInt16
        };
 
 
@@ -307,6 +365,7 @@ namespace ARDOUR {
        enum PluginType {
                AudioUnit,
                LADSPA,
+               LV2,
                VST
        };
 
@@ -322,11 +381,34 @@ namespace ARDOUR {
        };
 
        enum ShuttleUnits {
-               Percentage,
+               Percentage,
                Semitones
        };
 
        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
 
 std::istream& operator>>(std::istream& o, ARDOUR::SampleFormat& sf);
@@ -334,12 +416,15 @@ 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;