merge from 2.0-ongoing @ 3581
[ardour.git] / libs / ardour / ardour / ardour.h
1 /*
2     Copyright (C) 1999 Paul Davis
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __ardour_ardour_h__
21 #define __ardour_ardour_h__
22
23 #include <map>
24 #include <string>
25
26 #include <limits.h>
27 #include <signal.h>
28
29 #include <pbd/error.h>
30 #include <pbd/failed_constructor.h>
31
32 #include <ardour/configuration.h>
33 #include <ardour/types.h>
34
35 // #include <jack/jack.h> need this to inline jack_get_microseconds
36
37 namespace MIDI {
38         class MachineControl;
39         class Port;
40 }
41
42 namespace ARDOUR {
43
44         class AudioEngine;
45         class OSC;
46
47         extern OSC* osc;
48
49         static const nframes_t max_frames = JACK_MAX_FRAMES;
50         extern sigc::signal<void,std::string> BootMessage;
51
52         int init (bool with_vst, bool try_optimization);
53         int cleanup ();
54
55         std::string get_ardour_revision ();
56
57         void find_bindings_files (std::map<std::string,std::string>&);
58
59         const layer_t max_layer = UCHAR_MAX;
60
61         microseconds_t get_microseconds ();
62 /*      {
63         JACK has exported this functionality for a long time now 
64         but inlining this causes problems
65         return (microseconds_t) jack_get_time();
66         }
67 */
68         Change new_change ();
69
70         extern Change StartChanged;
71         extern Change LengthChanged;
72         extern Change PositionChanged;
73         extern Change NameChanged;
74         extern Change BoundsChanged;
75
76         struct LocaleGuard {
77             LocaleGuard (const char*);
78             ~LocaleGuard ();
79             const char* old;
80         };
81
82         static const double SHUTTLE_FRACT_SPEED1=0.48412291827; /* derived from A1,A2 */
83
84         void setup_fpu ();
85 }
86
87 /* how do we make these be within the Ardour namespace? */
88
89 extern MIDI::Port* default_mmc_port;
90 extern MIDI::Port* default_mtc_port;
91 extern MIDI::Port* default_midi_port;
92 extern MIDI::Port *default_midi_clock_port;
93
94 #endif /* __ardour_ardour_h__ */
95