summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-08-31 19:17:00 +0000
committerDavid Robillard <d@drobilla.net>2006-08-31 19:17:00 +0000
commit017e16c530bb1a9f186aa81893089dc79b4ddc24 (patch)
tree0b4343d96214148623cf631c4cd513026de69a6e /libs/ardour/ardour
parent0c3d8378f3a3a7333f3095e67050b62022281275 (diff)
Merged with trunk R879
git-svn-id: svn://localhost/ardour2/branches/midi@880 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audioengine.h2
-rw-r--r--libs/ardour/ardour/configuration.h6
-rw-r--r--libs/ardour/ardour/configuration_vars.h1
-rw-r--r--libs/ardour/ardour/port.h6
-rw-r--r--libs/ardour/ardour/region.h3
-rw-r--r--libs/ardour/ardour/session.h50
-rw-r--r--libs/ardour/ardour/source.h3
-rw-r--r--libs/ardour/ardour/utils.h7
8 files changed, 67 insertions, 11 deletions
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h
index db814bbb5f..5f9e53380f 100644
--- a/libs/ardour/ardour/audioengine.h
+++ b/libs/ardour/ardour/audioengine.h
@@ -72,6 +72,8 @@ class AudioEngine : public sigc::trackable
int usecs_per_cycle () const { return _usecs_per_cycle; }
+ bool get_sync_offset (jack_nframes_t& offset) const;
+
jack_nframes_t frames_since_cycle_start () {
if (!_running || !_jack) return 0;
return jack_frames_since_cycle_start (_jack);
diff --git a/libs/ardour/ardour/configuration.h b/libs/ardour/ardour/configuration.h
index dd689e9a2d..8d51343ffb 100644
--- a/libs/ardour/ardour/configuration.h
+++ b/libs/ardour/ardour/configuration.h
@@ -63,16 +63,18 @@ class Configuration : public Stateful
XMLNode* control_protocol_state () { return _control_protocol_state; }
+ sigc::signal<void,const char*> ParameterChanged;
+
/* define accessor methods */
#undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL
#define CONFIG_VARIABLE(Type,var,name,value) \
Type get_##var () const { return var.get(); } \
- void set_##var (Type val) { var.set (val); var.set_is_user (user_configuration); }
+ void set_##var (Type val) { var.set (val); var.set_is_user (user_configuration); ParameterChanged (name); }
#define CONFIG_VARIABLE_SPECIAL(Type,var,name,value,mutator) \
Type get_##var () const { return var.get(); } \
- void set_##var (Type val) { var.set (val); var.set_is_user (user_configuration); }
+ void set_##var (Type val) { var.set (val); var.set_is_user (user_configuration); ParameterChanged (name); }
#include "ardour/configuration_vars.h"
#undef CONFIG_VARIABLE
#undef CONFIG_VARIABLE_SPECIAL
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index 85c7897026..5222eefb0a 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -21,6 +21,7 @@ CONFIG_VARIABLE(bool, use_hardware_monitoring, "use-hardware-monitoring", false)
CONFIG_VARIABLE(bool, use_sw_monitoring, "use-sw-monitoring", false)
CONFIG_VARIABLE(bool, use_external_monitoring, "use-external-monitoring", true)
CONFIG_VARIABLE(bool, jack_time_master, "jack-time-master", true)
+CONFIG_VARIABLE(bool, use_video_sync, "use-video-sync", false)
CONFIG_VARIABLE(bool, trace_midi_input, "trace-midi-input", false)
CONFIG_VARIABLE(bool, trace_midi_output, "trace-midi-output", false)
CONFIG_VARIABLE(bool, plugins_stop_with_transport, "plugins-stop-with-transport", false)
diff --git a/libs/ardour/ardour/port.h b/libs/ardour/ardour/port.h
index 5da254b6df..a436722cb0 100644
--- a/libs/ardour/ardour/port.h
+++ b/libs/ardour/ardour/port.h
@@ -106,7 +106,13 @@ class Port : public sigc::trackable {
}
void ensure_monitor_input (bool yn) {
+
+#ifdef WITH_JACK_PORT_ENSURE_MONITOR
jack_port_ensure_monitor (_port, yn);
+#else
+ jack_port_request_monitor(_port, yn);
+#endif
+
}
/*XXX completely bloody useless imho*/
diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h
index 1abba574f1..c3e93fc7ae 100644
--- a/libs/ardour/ardour/region.h
+++ b/libs/ardour/ardour/region.h
@@ -23,6 +23,7 @@
#include <vector>
#include <boost/shared_ptr.hpp>
+#include <boost/enable_shared_from_this.hpp>
#include <pbd/undo.h>
#include <pbd/statefuldestructible.h>
@@ -58,7 +59,7 @@ struct RegionState : public StateManager::State
mutable RegionEditState _first_edit;
};
-class Region : public PBD::StatefulDestructible, public StateManager
+class Region : public PBD::StatefulDestructible, public StateManager, public boost::enable_shared_from_this<Region>
{
public:
typedef std::vector<boost::shared_ptr<Source> > SourceList;
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 47b6c163ef..09fd01baec 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -374,6 +374,8 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
jack_nframes_t last_transport_start() const { return _last_roll_location; }
void goto_end () { request_locate (end_location->start(), false);}
void goto_start () { request_locate (start_location->start(), false); }
+ void set_session_start (jack_nframes_t start) { start_location->set_start(start); }
+ void set_session_end (jack_nframes_t end) { end_location->set_start(end); _end_location_is_free = false; }
void use_rf_shuttle_speed ();
void request_transport_speed (float speed);
void request_overwrite_buffer (Diskstream*);
@@ -392,8 +394,9 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
jack_nframes_t current_end_frame() const { return end_location->start(); }
jack_nframes_t current_start_frame() const { return start_location->start(); }
jack_nframes_t frame_rate() const { return _current_frame_rate; }
- double frames_per_smpte_frame() const { return _frames_per_smpte_frame; }
jack_nframes_t frames_per_hour() const { return _frames_per_hour; }
+
+ double frames_per_smpte_frame() const { return _frames_per_smpte_frame; }
jack_nframes_t smpte_frames_per_hour() const { return _smpte_frames_per_hour; }
/* Locations */
@@ -432,7 +435,8 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
MidiFeedback,
MidiControl,
TranzportControl,
- Feedback
+ Feedback,
+ SmpteMode,
};
sigc::signal<void,ControlType> ControlChanged;
@@ -593,6 +597,7 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
float shuttle_speed_threshold;
float rf_speed;
float smpte_frames_per_second;
+ float video_pullup;
bool smpte_drop_frames;
AnyTime preroll;
AnyTime postroll;
@@ -602,7 +607,35 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
jack_nframes_t transport_frame () const {return _transport_frame; }
jack_nframes_t audible_frame () const;
+ enum SmpteFormat {
+ smpte_23976,
+ smpte_24,
+ smpte_24976,
+ smpte_25,
+ smpte_2997,
+ smpte_2997drop,
+ smpte_30,
+ smpte_30drop,
+ smpte_5994,
+ smpte_60,
+ };
+
+ enum PullupFormat {
+ pullup_Plus4Plus1,
+ pullup_Plus4,
+ pullup_Plus4Minus1,
+ pullup_Plus1,
+ pullup_None,
+ pullup_Minus1,
+ pullup_Minus4Plus1,
+ pullup_Minus4,
+ pullup_Minus4Minus1,
+ };
+
int set_smpte_type (float fps, bool drop_frames);
+ int set_video_pullup (float pullup);
+
+ void sync_time_vars();
void bbt_time (jack_nframes_t when, BBT_Time&);
void smpte_to_sample( SMPTE::Time& smpte, jack_nframes_t& sample, bool use_offset, bool use_subframes ) const;
@@ -621,8 +654,11 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
jack_nframes_t convert_to_frames_at (jack_nframes_t position, AnyTime&);
+ static sigc::signal<void> StartTimeChanged;
+ static sigc::signal<void> EndTimeChanged;
static sigc::signal<void> SMPTEOffsetChanged;
- sigc::signal<void> SMPTETypeChanged;
+ static sigc::signal<void> SMPTETypeChanged;
+ static sigc::signal<void> PullupChanged;
void request_slave_source (SlaveSource, jack_nframes_t pos = 0);
SlaveSource slave_source() const { return _slave_type; }
@@ -1074,7 +1110,9 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
mutable gint processing_prohibited;
process_function_type process_function;
process_function_type last_process_function;
- jack_nframes_t _current_frame_rate;
+ bool waiting_for_sync_offset;
+ jack_nframes_t _base_frame_rate;
+ jack_nframes_t _current_frame_rate; //this includes video pullup offset
int transport_sub_state;
mutable gint _record_status;
jack_nframes_t _transport_frame;
@@ -1176,6 +1214,8 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
return false;
}
+ bool maybe_sync_start (jack_nframes_t&, jack_nframes_t&);
+
void check_declick_out ();
MIDI::MachineControl* mmc;
@@ -1817,6 +1857,8 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
void add_controllable (PBD::Controllable*);
void remove_controllable (PBD::Controllable*);
+
+ void handle_configuration_change (const char*);
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h
index 1728cdb477..a18250fff2 100644
--- a/libs/ardour/ardour/source.h
+++ b/libs/ardour/ardour/source.h
@@ -24,7 +24,6 @@
#include <string>
#include <sigc++/signal.h>
-#include <boost/enable_shared_from_this.hpp>
#include <pbd/statefuldestructible.h>
@@ -33,7 +32,7 @@
namespace ARDOUR {
-class Source : public PBD::StatefulDestructible, public sigc::trackable, public boost::enable_shared_from_this<Source>
+class Source : public PBD::StatefulDestructible, public sigc::trackable
{
public:
Source (std::string name, DataType type);
diff --git a/libs/ardour/ardour/utils.h b/libs/ardour/ardour/utils.h
index ee4482d260..214e74156c 100644
--- a/libs/ardour/ardour/utils.h
+++ b/libs/ardour/ardour/utils.h
@@ -25,7 +25,7 @@
#include <string>
#include <cmath>
-#ifdef HAVE_COREAUDIO
+#if defined(HAVE_COREAUDIO) || defined(HAVE_AUDIOUNITS)
#include <CoreFoundation/CoreFoundation.h>
#endif
@@ -57,8 +57,11 @@ int touch_file(std::string path);
std::string region_name_from_path (std::string path);
std::string path_expand (std::string);
-#ifdef HAVE_COREAUDIO
+void compute_equal_power_fades (jack_nframes_t nframes, float* in, float* out);
+
+#if defined(HAVE_COREAUDIO) || defined(HAVE_AUDIOUNITS)
std::string CFStringRefToStdString(CFStringRef stringRef);
#endif // HAVE_COREAUDIO
#endif /* __ardour_utils_h__ */
+