along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#ifndef __ardour_session_h__
#include <stack>
#include <boost/weak_ptr.hpp>
+#include <boost/dynamic_bitset.hpp>
#include <stdint.h>
class Region;
class Playlist;
class VSTPlugin;
-class ControlProtocolManager;
+class ControlProtocolInfo;
struct AudioExportSpecification;
struct RouteGroup;
using std::map;
using std::set;
-class Session : public sigc::trackable, public PBD::StatefulDestructible
+class Session : public PBD::StatefulDestructible
{
private:
- typedef std::pair<boost::shared_ptr<Route>,bool> RouteBooleanState;
+ typedef std::pair<boost::weak_ptr<Route>,bool> RouteBooleanState;
typedef vector<RouteBooleanState> GlobalRouteBooleanState;
- typedef std::pair<boost::shared_ptr<Route>,MeterPoint> RouteMeterState;
+ typedef std::pair<boost::weak_ptr<Route>,MeterPoint> RouteMeterState;
typedef vector<RouteMeterState> GlobalRouteMeterState;
public:
SetDiskstreamSpeed,
Locate,
LocateRoll,
+ LocateRollLocate,
SetLoop,
PunchIn,
PunchOut,
Type type;
Action action;
- nframes_t action_frame;
- nframes_t target_frame;
+ nframes_t action_frame;
+ nframes_t target_frame;
float speed;
union {
void* ptr;
bool yes_or_no;
+ nframes_t target2_frame;
SlaveSource slave;
- Route* route;
};
- boost::shared_ptr<Region> region;
+ boost::shared_ptr<Region> region;
list<AudioRange> audio_range;
list<MusicRange> music_range;
/* creating from an XML file */
Session (AudioEngine&,
- string fullpath,
- string snapshot_name,
- string* mix_template = 0);
+ const string& fullpath,
+ const string& snapshot_name,
+ string mix_template = "");
/* creating a new Session */
string name() const { return _name; }
string snap_name() const { return _current_snapshot_name; }
string raid_path () const;
+ string export_dir () const;
void set_snap_name ();
-
+
+ bool writable() const { return _writable; }
void set_dirty ();
void set_clean ();
bool dirty() const { return _state_of_the_state & Dirty; }
+ void set_deletion_in_progress ();
+ bool deletion_in_progress() const { return _state_of_the_state & Deletion; }
sigc::signal<void> DirtyChanged;
+ static sigc::signal<void> AutoBindingOn;
+ static sigc::signal<void> AutoBindingOff;
+
+ static sigc::signal<void,std::string> Dialog;
+
std::string sound_dir (bool with_path = true) const;
std::string peak_dir () const;
std::string dead_sound_dir () const;
std::string automation_dir () const;
+ std::string analysis_dir() const;
+
+ int ensure_subdirs ();
- string peak_path_from_audio_path (string) const;
+ Glib::ustring peak_path (Glib::ustring) const;
static string suffixed_search_path (std::string suffix, bool data);
static string control_protocol_path ();
static string template_path ();
+ static string route_template_path ();
static string template_dir ();
- static void get_template_list (list<string>&);
+ static string route_template_dir ();
+ static void get_template_list (std::list<std::string>&);
+
+ struct RouteTemplateInfo {
+ std::string name;
+ std::string path;
+ };
+
+ static void get_route_templates (std::vector<RouteTemplateInfo>&);
static string change_audio_path_by_name (string oldpath, string oldname, string newname, bool destructive);
string audio_path_from_name (string, uint32_t nchans, uint32_t chan, bool destructive);
bool operator() (boost::shared_ptr<Route>, boost::shared_ptr<Route> b);
};
+ void sync_order_keys (const char* base);
+
template<class T> void foreach_route (T *obj, void (T::*func)(Route&));
template<class T> void foreach_route (T *obj, void (T::*func)(boost::shared_ptr<Route>));
template<class T, class A> void foreach_route (T *obj, void (T::*func)(Route&, A), A arg);
void disable_record (bool rt_context, bool force = false);
void step_back_from_record ();
+ void maybe_write_autosave ();
+
/* Proxy signal for region hidden changes */
sigc::signal<void,boost::shared_ptr<Region> > RegionHiddenChange;
/* Record status signals */
- sigc::signal<void> RecordStateChanged;
+ sigc::signal<void> RecordStateChanged;
/* Transport mechanism signals */
sigc::signal<void> TransportStateChange; /* generic */
sigc::signal<void,nframes_t> PositionChanged; /* sent after any non-sequential motion */
sigc::signal<void> DurationChanged;
- sigc::signal<void> HaltOnXrun;
+ sigc::signal<void,nframes_t> Xrun;
+ sigc::signal<void> TransportLooped;
sigc::signal<void,RouteList&> RouteAdded;
- void request_roll ();
+ void request_roll_at_and_return (nframes_t start, nframes_t return_to);
void request_bounded_roll (nframes_t start, nframes_t end);
void request_stop (bool abort = false);
void request_locate (nframes_t frame, bool with_roll = false);
- void request_play_loop (bool yn);
+
+ void request_play_loop (bool yn, bool leave_rolling = false);
+ bool get_play_loop () const { return play_loop; }
+
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 (nframes_t start) { start_location->set_start(start); }
void set_session_end (nframes_t end) { end_location->set_start(end); _end_location_is_free = false; }
void use_rf_shuttle_speed ();
+ void allow_auto_play (bool yn);
void request_transport_speed (float speed);
void request_overwrite_buffer (Diskstream*);
void request_diskstream_speed (Diskstream&, float speed);
nframes_t get_maximum_extent () const;
nframes_t current_end_frame() const { return end_location->start(); }
nframes_t current_start_frame() const { return start_location->start(); }
+ // "actual" sample rate of session, set by current audioengine rate, pullup/down etc.
nframes_t frame_rate() const { return _current_frame_rate; }
+ // "native" sample rate of session, regardless of current audioengine rate, pullup/down etc
+ nframes_t nominal_frame_rate() const { return _nominal_frame_rate; }
nframes_t frames_per_hour() const { return _frames_per_hour; }
double frames_per_smpte_frame() const { return _frames_per_smpte_frame; }
nframes_t smpte_frames_per_hour() const { return _smpte_frames_per_hour; }
+ MIDI::byte get_mtc_smpte_bits() const {
+ return mtc_smpte_bits; /* encoding of SMTPE type for MTC */
+ }
+
+ float smpte_frames_per_second() const;
+ bool smpte_drop_frames() const;
+
/* Locations */
Locations *locations() { return &_locations; }
void set_auto_punch_location (Location *);
void set_auto_loop_location (Location *);
+ int location_name(string& result, string base = string(""));
void reset_input_monitor_state ();
int save_template (string template_name);
int save_history (string snapshot_name = "");
int restore_history (string snapshot_name);
+ void remove_state (string snapshot_name);
+ void rename_state (string old_name, string new_name);
+ void remove_pending_capture_state ();
static int rename_template (string old_name, string new_name);
-
static int delete_template (string name);
sigc::signal<void,string> StateSaved;
XMLNode& get_state();
int set_state(const XMLNode& node); // not idempotent
XMLNode& get_template();
-
+
void add_instant_xml (XMLNode&, const std::string& dir);
enum StateOfTheState {
std::list<boost::shared_ptr<AudioTrack> > new_audio_track (int input_channels, int output_channels, TrackMode mode = Normal, uint32_t how_many = 1);
RouteList new_audio_route (int input_channels, int output_channels, uint32_t how_many);
+ RouteList new_route_from_template (uint32_t how_many, const std::string& template_path);
+
+ /* this is a hack put in to support work on video tracks by Robin Gareus. Nobody
+ should assume that this works yet (February 2009)
+ */
+
+ boost::shared_ptr<Route> new_video_track (string name);
void remove_route (boost::shared_ptr<Route>);
void resort_routes ();
void resort_routes_using (boost::shared_ptr<RouteList>);
+ void set_remote_control_ids();
+
AudioEngine &engine() { return _engine; };
int32_t max_level;
nframes_t transport_frame () const {return _transport_frame; }
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,
- };
+ nframes64_t requested_return_frame() const { return _requested_return_frame; }
enum PullupFormat {
pullup_Plus4Plus1,
pullup_Minus1,
pullup_Minus4Plus1,
pullup_Minus4,
- pullup_Minus4Minus1,
+ pullup_Minus4Minus1
};
- int set_smpte_type (float fps, bool drop_frames);
-
+ int set_smpte_format (SmpteFormat);
void sync_time_vars();
void bbt_time (nframes_t when, BBT_Time&);
bool transport_stopped() const { return _transport_speed == 0.0f; }
bool transport_rolling() const { return _transport_speed != 0.0f; }
+ void set_silent (bool yn);
+ bool silent () { return _silent; }
+
int jack_slave_sync (nframes_t);
TempoMap& tempo_map() { return *_tempo_map; }
/* region info */
- sigc::signal<void,boost::shared_ptr<AudioRegion> > AudioRegionAdded;
- sigc::signal<void,boost::shared_ptr<AudioRegion> > AudioRegionRemoved;
+ void add_regions (std::vector<boost::shared_ptr<Region> >&);
- int region_name (string& result, string base = string(""), bool newlevel = false) const;
+ sigc::signal<void,boost::weak_ptr<AudioRegion> > AudioRegionAdded;
+ sigc::signal<void,std::vector<boost::weak_ptr<AudioRegion> >& > AudioRegionsAdded;
+ sigc::signal<void,boost::weak_ptr<AudioRegion> > AudioRegionRemoved;
+
+ int region_name (string& result, string base = string(""), bool newlevel = false);
string new_region_name (string);
string path_from_region_name (string name, string identifier);
- boost::shared_ptr<AudioRegion> find_whole_file_parent (boost::shared_ptr<AudioRegion>);
+ boost::shared_ptr<AudioRegion> find_whole_file_parent (boost::shared_ptr<AudioRegion const>);
void find_equivalent_playlist_regions (boost::shared_ptr<Region>, std::vector<boost::shared_ptr<Region> >& result);
boost::shared_ptr<AudioRegion> XMLRegionFactory (const XMLNode&, bool full);
string doing_what;
/* control info */
- bool multichan;
- bool sample_convert;
+ uint32_t total;
+ uint32_t count;
+ SrcQuality quality;
volatile bool freeze;
- string pathname;
+ std::vector<Glib::ustring> paths;
+ bool replace_existing_source;
/* result */
- std::vector<boost::shared_ptr<AudioRegion> > new_regions;
-
+ SourceList sources;
};
- int import_audiofile (import_status&);
+ void import_audiofiles (import_status&);
bool sample_rate_convert (import_status&, string infile, string& outfile);
string build_tmp_convert_name (string file);
SlaveSource post_export_slave;
nframes_t post_export_position;
- int start_audio_export (ARDOUR::AudioExportSpecification&);
- int stop_audio_export (ARDOUR::AudioExportSpecification&);
-
+ int pre_export ();
+ int start_audio_export (ARDOUR::AudioExportSpecification&);
+ int stop_audio_export (ARDOUR::AudioExportSpecification&);
+ void finalize_audio_export ();
+ static sigc::signal<void, std::string, std::string> Exported;
+
void add_source (boost::shared_ptr<Source>);
void remove_source (boost::weak_ptr<Source>);
- int cleanup_audio_file_source (boost::shared_ptr<AudioFileSource>);
struct cleanup_report {
vector<string> paths;
- int32_t space;
+ int64_t space;
};
int cleanup_sources (cleanup_report&);
this playlist.
*/
- sigc::signal<int,ARDOUR::Playlist*> AskAboutPlaylistDeletion;
+ sigc::signal<int,boost::shared_ptr<ARDOUR::Playlist> > AskAboutPlaylistDeletion;
+
+ /* handlers should return 0 for "ignore the rate mismatch"
+ and !0 for "do not use this session"
+ */
+
+ static sigc::signal<int,nframes_t, nframes_t> AskAboutSampleRateMismatch;
+ class SRMismatchRejected : public std::exception {
+ public:
+ SRMismatchRejected () {}
+ const char* what() const throw() { return "Sample rate mismatch rejected"; }
+ };
/* handlers should return !0 for use pending state, 0 for
ignore it.
static sigc::signal<int> AskAboutPendingState;
- sigc::signal<void,boost::shared_ptr<Source> > SourceAdded;
- sigc::signal<void,boost::shared_ptr<Source> > SourceRemoved;
-
boost::shared_ptr<AudioFileSource> create_audio_source_for_session (ARDOUR::AudioDiskstream&, uint32_t which_channel, bool destructive);
boost::shared_ptr<Source> source_by_id (const PBD::ID&);
+ boost::shared_ptr<Source> source_by_path_and_channel (const Glib::ustring&, uint16_t);
/* playlist management */
- Playlist* playlist_by_name (string name);
- void add_playlist (Playlist *);
- sigc::signal<void,Playlist*> PlaylistAdded;
- sigc::signal<void,Playlist*> PlaylistRemoved;
+ boost::shared_ptr<Playlist> playlist_by_name (string name);
+ void add_playlist (boost::shared_ptr<Playlist>);
+ sigc::signal<void,boost::shared_ptr<Playlist> > PlaylistAdded;
+ sigc::signal<void,boost::shared_ptr<Playlist> > PlaylistRemoved;
uint32_t n_playlists() const;
- template<class T> void foreach_playlist (T *obj, void (T::*func)(Playlist *));
+ template<class T> void foreach_playlist (T *obj, void (T::*func)(boost::shared_ptr<Playlist>));
+ void get_playlists (std::vector<boost::shared_ptr<Playlist> >&);
/* named selections */
/* flattening stuff */
- int write_one_audio_track (AudioTrack&, nframes_t start, nframes_t cnt, bool overwrite, vector<boost::shared_ptr<AudioSource> >&,
- InterThreadInfo& wot);
+ boost::shared_ptr<Region> write_one_audio_track (AudioTrack&, nframes_t start, nframes_t end, bool overwrite, vector<boost::shared_ptr<AudioSource> >&, InterThreadInfo& wot, bool enable_processing = true);
int freeze (InterThreadInfo&);
/* session-wide solo/mute/rec-enable */
void set_all_mute (bool);
sigc::signal<void,bool> SoloActive;
+ sigc::signal<void> SoloChanged;
void record_disenable_all ();
void record_enable_all ();
uint32_t n_plugin_inserts() const { return _plugin_inserts.size(); }
uint32_t n_sends() const { return _sends.size(); }
- string next_send_name();
- string next_insert_name();
-
+ static void set_disable_all_loaded_plugins (bool yn) {
+ _disable_all_loaded_plugins = yn;
+ }
+ static bool get_disable_all_loaded_plugins() {
+ return _disable_all_loaded_plugins;
+ }
+
+ uint32_t next_send_id();
+ uint32_t next_insert_id();
+ void mark_send_id (uint32_t);
+ void mark_insert_id (uint32_t);
+
/* s/w "RAID" management */
nframes_t available_capture_duration();
void deliver_midi (MIDI::Port*, MIDI::byte*, int32_t size);
+ void set_mmc_receive_device_id (uint32_t id);
+ void set_mmc_send_device_id (uint32_t id);
+
/* Scrubbing */
void start_scrub (nframes_t where);
/* History (for editors, mixers, UIs etc.) */
void undo (uint32_t n) {
- history.undo (n);
+ _history.undo (n);
}
+
void redo (uint32_t n) {
- history.redo (n);
+ _history.redo (n);
}
- uint32_t undo_depth() const { return history.undo_depth(); }
- uint32_t redo_depth() const { return history.redo_depth(); }
- string next_undo() const { return history.next_undo(); }
- string next_redo() const { return history.next_redo(); }
+ UndoHistory& history() { return _history; }
+
+ uint32_t undo_depth() const { return _history.undo_depth(); }
+ uint32_t redo_depth() const { return _history.redo_depth(); }
+ string next_undo() const { return _history.next_undo(); }
+ string next_redo() const { return _history.next_redo(); }
void begin_reversible_command (string cmd_name);
void commit_reversible_command (Command* cmd = 0);
current_trans->add_command (cmd);
}
- std::map<PBD::ID, PBD::StatefulDestructible*> registry;
+ std::map<PBD::ID, PBD::StatefulThingWithGoingAway*> registry;
// these commands are implemented in libs/ardour/session_command.cc
- Command *memento_command_factory(XMLNode *n);
- void register_with_memento_command_factory(PBD::ID, PBD::StatefulDestructible *);
+ Command* memento_command_factory(XMLNode* n);
+ void register_with_memento_command_factory(PBD::ID, PBD::StatefulThingWithGoingAway*);
+
+ Command* global_state_command_factory (const XMLNode& n);
+
+ class GlobalRouteStateCommand : public Command
+ {
+ public:
+ GlobalRouteStateCommand (Session&, void*);
+ GlobalRouteStateCommand (Session&, const XMLNode& node);
+ int set_state (const XMLNode&);
+ XMLNode& get_state ();
+
+ protected:
+ GlobalRouteBooleanState before, after;
+ Session& sess;
+ void* src;
+
+ };
- class GlobalSoloStateCommand : public Command
+ class GlobalSoloStateCommand : public GlobalRouteStateCommand
{
- GlobalRouteBooleanState before, after;
- Session &sess;
- void *src;
- public:
- GlobalSoloStateCommand(Session &, void *src);
- void operator()();
- void undo();
- XMLNode &get_state();
- void mark();
+ public:
+ GlobalSoloStateCommand (Session &, void *src);
+ GlobalSoloStateCommand (Session&, const XMLNode&);
+ void operator()(); //redo
+ void undo();
+ XMLNode &get_state();
+ void mark();
};
- class GlobalMuteStateCommand : public Command
+ class GlobalMuteStateCommand : public GlobalRouteStateCommand
{
- GlobalRouteBooleanState before, after;
- Session &sess;
- void *src;
- public:
- GlobalMuteStateCommand(Session &, void *src);
- void operator()();
- void undo();
- XMLNode &get_state();
- void mark();
+ public:
+ GlobalMuteStateCommand(Session &, void *src);
+ GlobalMuteStateCommand (Session&, const XMLNode&);
+ void operator()(); // redo
+ void undo();
+ XMLNode &get_state();
+ void mark();
};
- class GlobalRecordEnableStateCommand : public Command
+ class GlobalRecordEnableStateCommand : public GlobalRouteStateCommand
{
- GlobalRouteBooleanState before, after;
- Session &sess;
- void *src;
- public:
- GlobalRecordEnableStateCommand(Session &, void *src);
- void operator()();
- void undo();
- XMLNode &get_state();
- void mark();
+ public:
+ GlobalRecordEnableStateCommand(Session &, void *src);
+ GlobalRecordEnableStateCommand (Session&, const XMLNode&);
+ void operator()(); // redo
+ void undo();
+ XMLNode &get_state();
+ void mark();
};
class GlobalMeteringStateCommand : public Command
{
- GlobalRouteMeterState before, after;
- Session &sess;
- void *src;
- public:
- GlobalMeteringStateCommand(Session &, void *src);
- void operator()();
- void undo();
- XMLNode &get_state();
- void mark();
+ public:
+ GlobalMeteringStateCommand(Session &, void *src);
+ GlobalMeteringStateCommand (Session&, const XMLNode&);
+ void operator()();
+ void undo();
+ XMLNode &get_state();
+ int set_state (const XMLNode&);
+ void mark();
+
+ protected:
+ Session& sess;
+ void* src;
+ GlobalRouteMeterState before;
+ GlobalRouteMeterState after;
};
/* clicking */
boost::shared_ptr<IO> click_io() { return _click_io; }
- /* tempo FX */
-
- struct TimeStretchRequest {
- boost::shared_ptr<ARDOUR::AudioRegion> region;
- float fraction; /* session: read ; GUI: write */
- float progress; /* session: write ; GUI: read */
- bool running; /* read/write */
- bool quick_seek; /* GUI: write */
- bool antialias; /* GUI: write */
-
- TimeStretchRequest () {}
- };
-
- boost::shared_ptr<AudioRegion> tempoize_region (TimeStretchRequest&);
-
- /* need to call this whenever we change native file formats */
-
- void reset_native_file_format();
-
/* disk, buffer loads */
uint32_t playback_load ();
void reset_playback_load_min ();
void reset_capture_load_min ();
- float read_data_rate () const;
+ float read_data_rate () const; // in usec
float write_data_rate () const;
/* ranges */
void set_audio_range (list<AudioRange>&);
void set_music_range (list<MusicRange>&);
- void request_play_range (bool yn);
+ void request_play_range (bool yn, bool leave_rolling = false);
bool get_play_range () const { return _play_range; }
/* favorite dirs */
void* ptr,
float opt);
- typedef float (*compute_peak_t) (Sample *, nframes_t, float);
+ typedef float (*compute_peak_t) (Sample *, nframes_t, float);
+ typedef void (*find_peaks_t) (Sample *, nframes_t, float *, float*);
typedef void (*apply_gain_to_buffer_t) (Sample *, nframes_t, float);
typedef void (*mix_buffers_with_gain_t) (Sample *, Sample *, nframes_t, float);
typedef void (*mix_buffers_no_gain_t) (Sample *, Sample *, nframes_t);
- static compute_peak_t compute_peak;
+ static compute_peak_t compute_peak;
+ static find_peaks_t find_peaks;
static apply_gain_to_buffer_t apply_gain_to_buffer;
static mix_buffers_with_gain_t mix_buffers_with_gain;
static mix_buffers_no_gain_t mix_buffers_no_gain;
PBD::Controllable* controllable_by_id (const PBD::ID&);
+ void add_controllable (PBD::Controllable*);
+ void remove_controllable (PBD::Controllable*);
+
protected:
friend class AudioEngine;
void set_block_size (nframes_t nframes);
void update_latency_compensation (bool, bool);
private:
- int create (bool& new_session, string* mix_template, nframes_t initial_length);
+ int create (bool& new_session, const string& mix_template, nframes_t initial_length);
+ void destroy ();
+
+ nframes_t compute_initial_length ();
+
+ bool _writable;
static const char* _template_suffix;
static const char* _statefile_suffix;
typedef void (Session::*process_function_type)(nframes_t);
- AudioEngine &_engine;
- mutable gint processing_prohibited;
+ AudioEngine& _engine;
+ mutable gint processing_prohibited;
process_function_type process_function;
process_function_type last_process_function;
bool waiting_for_sync_offset;
- nframes_t _base_frame_rate;
- nframes_t _current_frame_rate; //this includes video pullup offset
+ nframes_t _base_frame_rate;
+ nframes_t _current_frame_rate; //this includes video pullup offset
+ nframes_t _nominal_frame_rate; //ignores audioengine setting, "native" SR
int transport_sub_state;
- mutable gint _record_status;
- nframes_t _transport_frame;
+ mutable gint _record_status;
+ volatile nframes_t _transport_frame;
Location* end_location;
Location* start_location;
- Slave *_slave;
+ Slave* _slave;
+ bool _silent;
volatile float _transport_speed;
volatile float _desired_transport_speed;
float _last_transport_speed;
- nframes_t _last_slave_transport_frame;
- nframes_t maximum_output_latency;
- nframes_t last_stop_frame;
+ bool auto_play_legal;
+ nframes_t _last_slave_transport_frame;
+ nframes_t maximum_output_latency;
+ nframes_t last_stop_frame;
+ volatile nframes64_t _requested_return_frame;
vector<Sample *> _passthru_buffers;
vector<Sample *> _silent_buffers;
vector<Sample *> _send_buffers;
- nframes_t current_block_size;
- nframes_t _worst_output_latency;
- nframes_t _worst_input_latency;
- nframes_t _worst_track_latency;
+ nframes_t current_block_size;
+ nframes_t _worst_output_latency;
+ nframes_t _worst_input_latency;
+ nframes_t _worst_track_latency;
bool _have_captured;
float _meter_hold;
float _meter_falloff;
void process_with_events (nframes_t);
void process_audition (nframes_t);
int process_export (nframes_t, ARDOUR::AudioExportSpecification*);
-
+
+ void block_processing() { g_atomic_int_set (&processing_prohibited, 1); }
+ void unblock_processing() { g_atomic_int_set (&processing_prohibited, 0); }
+ bool processing_blocked() const { return g_atomic_int_get (&processing_prohibited); }
+
/* slave tracking */
static const int delta_accumulator_size = 25;
nframes_t slave_wait_end;
void reset_slave_state ();
- bool follow_slave (nframes_t, nframes_t);
- void set_slave_source (SlaveSource);
+ bool follow_slave (nframes_t);
+ void set_slave_source (SlaveSource, bool stop_transport = true);
bool _exporting;
- int prepare_to_export (ARDOUR::AudioExportSpecification&);
+ int prepare_to_export (ARDOUR::AudioExportSpecification&);
void prepare_diskstreams ();
void commit_diskstreams (nframes_t, bool& session_requires_butler);
- int process_routes (nframes_t, nframes_t);
- int silent_process_routes (nframes_t, nframes_t);
+ int process_routes (nframes_t);
+ int silent_process_routes (nframes_t);
bool get_rec_monitors_input () {
if (actively_recording()) {
return false;
}
- bool maybe_sync_start (nframes_t&, nframes_t&);
+ bool maybe_sync_start (nframes_t&);
void check_declick_out ();
void hookup_io ();
void when_engine_running ();
- sigc::connection first_time_running;
void graph_reordered ();
string _current_snapshot_name;
bool pending_abort;
bool pending_auto_loop;
- Sample* butler_mixdown_buffer;
- float* butler_gain_buffer;
pthread_t butler_thread;
Glib::Mutex butler_request_lock;
Glib::Cond butler_paused;
bool butler_should_run;
mutable gint butler_should_do_transport_work;
int butler_request_pipe[2];
+
+ inline bool transport_work_requested() const { return g_atomic_int_get(&butler_should_do_transport_work); }
struct ButlerRequest {
enum Type {
void mmc_record_pause (MIDI::MachineControl &);
void mmc_record_strobe (MIDI::MachineControl &);
void mmc_record_exit (MIDI::MachineControl &);
- void mmc_track_record_status (MIDI::MachineControl &,
- uint32_t track, bool enabled);
+ void mmc_track_record_status (MIDI::MachineControl &, uint32_t track, bool enabled);
void mmc_fast_forward (MIDI::MachineControl &);
void mmc_rewind (MIDI::MachineControl &);
void mmc_locate (MIDI::MachineControl &, const MIDI::byte *);
nframes_t _smpte_frames_per_hour;
nframes_t _smpte_offset;
bool _smpte_offset_negative;
-
+
/* cache the most-recently requested time conversions.
this helps when we have multiple clocks showing the
same time (e.g. the transport frame)
nframes_t last_smpte_when;
SMPTE::Time last_smpte;
+ bool _send_smpte_update; ///< Flag to send a full frame (SMPTE) MTC message this cycle
+
int send_full_time_code ();
int send_midi_time_code ();
void reset_record_status ();
- int no_roll (nframes_t nframes, nframes_t offset);
+ int fail_roll (nframes_t nframes);
+ int no_roll (nframes_t nframes);
bool non_realtime_work_pending() const { return static_cast<bool>(post_transport_work); }
bool process_can_proceed() const { return !(post_transport_work & ProcessCannotProceedMask); }
void change_midi_ports ();
int use_config_midi_ports ();
- bool waiting_to_start;
-
- void set_play_loop (bool yn);
+ void set_play_loop (bool yn, bool leave_rolling);
void overwrite_some_buffers (Diskstream*);
void flush_all_redirects ();
+ int micro_locate (nframes_t distance);
void locate (nframes_t, bool with_roll, bool with_flush, bool with_loop=false);
void start_locate (nframes_t, bool with_roll, bool with_flush, bool with_loop=false);
void force_locate (nframes_t frame, bool with_roll = false);
void set_transport_speed (float speed, bool abort = false);
void stop_transport (bool abort = false);
void start_transport ();
- void actually_start_transport ();
void realtime_stop (bool abort);
void non_realtime_start_scrub ();
void non_realtime_set_speed ();
- void non_realtime_stop (bool abort);
- void non_realtime_overwrite ();
- void non_realtime_buffer_fill ();
+ void non_realtime_stop (bool abort, int entry_request_count, bool& finished);
+ void non_realtime_overwrite (int entry_request_count, bool& finished);
void butler_transport_work ();
void post_transport ();
void engine_halted ();
SerializedRCUManager<RouteList> routes;
- void add_routes (RouteList&, bool save = true);
+ void add_routes (RouteList&, bool save);
uint32_t destructive_index;
int load_routes (const XMLNode&);
bool currently_soloing;
void route_mute_changed (void *src);
- void route_solo_changed (void *src, boost::shared_ptr<Route>);
+ void route_solo_changed (void *src, boost::weak_ptr<Route>);
void catch_up_on_solo ();
+ void catch_up_on_solo_mute_override ();
void update_route_solo_state ();
void modify_solo_mute (bool, bool);
void strip_portname_for_solo (string& portname);
/* REGION MANAGEMENT */
+ std::map<std::string,uint32_t> region_name_map;
+ void update_region_name_map (boost::shared_ptr<Region>);
+
mutable Glib::Mutex region_lock;
typedef map<PBD::ID,boost::shared_ptr<AudioRegion> > AudioRegionList;
AudioRegionList audio_regions;
- void region_renamed (boost::shared_ptr<Region>);
- void region_changed (Change, boost::shared_ptr<Region>);
void add_region (boost::shared_ptr<Region>);
- void remove_region (boost::shared_ptr<Region>);
+ void region_changed (Change, boost::weak_ptr<Region>);
+ void remove_region (boost::weak_ptr<Region>);
int load_regions (const XMLNode& node);
AudioSourceList audio_sources;
+ public:
+ AudioSourceList get_audio_sources() { return audio_sources; }
+
+ private:
+
+
int load_sources (const XMLNode& node);
XMLNode& get_sources_as_xml ();
/* PLAYLISTS */
mutable Glib::Mutex playlist_lock;
- typedef set<Playlist *> PlaylistList;
+ typedef set<boost::shared_ptr<Playlist> > PlaylistList;
PlaylistList playlists;
PlaylistList unused_playlists;
int load_playlists (const XMLNode&);
int load_unused_playlists (const XMLNode&);
- void remove_playlist (Playlist *);
- void track_playlist (Playlist *, bool);
+ void remove_playlist (boost::weak_ptr<Playlist>);
+ void track_playlist (bool, boost::weak_ptr<Playlist>);
- Playlist *playlist_factory (string name);
- Playlist *XMLPlaylistFactory (const XMLNode&);
+ boost::shared_ptr<Playlist> playlist_factory (string name);
+ boost::shared_ptr<Playlist> XMLPlaylistFactory (const XMLNode&);
- void playlist_length_changed (Playlist *);
- void diskstream_playlist_changed (boost::shared_ptr<Diskstream>);
+ void playlist_length_changed ();
+ void diskstream_playlist_changed (boost::weak_ptr<Diskstream>);
/* NAMED SELECTIONS */
list<PortInsert *> _port_inserts;
list<PluginInsert *> _plugin_inserts;
list<Send *> _sends;
+ boost::dynamic_bitset<uint32_t> send_bitset;
+ boost::dynamic_bitset<uint32_t> insert_bitset;
uint32_t send_cnt;
uint32_t insert_cnt;
+
void add_redirect (Redirect *);
void remove_redirect (Redirect *);
static const char* dead_sound_dir_name;
static const char* interchange_dir_name;
static const char* peak_dir_name;
-
+ static const char* export_dir_name;
+
+ string old_sound_dir (bool with_path = true) const;
string discover_best_sound_dir (bool destructive = false);
int ensure_sound_dir (string, string&);
void refresh_disk_space ();
void reverse_diskstream_buffers ();
- UndoHistory history;
+ UndoHistory _history;
UndoTransaction* current_trans;
GlobalRouteBooleanState get_global_route_boolean (bool (Route::*method)(void) const);
void jack_timebase_callback (jack_transport_state_t, nframes_t, jack_position_t*, int);
int jack_sync_callback (jack_transport_state_t, jack_position_t*);
+ void reset_jack_connection (jack_client_t* jack);
void record_enable_change_all (bool yn);
XMLNode& state(bool);
Click *get_click();
void setup_click_sounds (int which);
void clear_clicks ();
- void click (nframes_t start, nframes_t nframes, nframes_t offset);
+ void click (nframes_t start, nframes_t nframes);
vector<Route*> master_outs;
list<AudioRange> current_audio_range;
bool _play_range;
- void set_play_range (bool yn);
+ void set_play_range (bool yn, bool leave_rolling);
void setup_auto_play ();
/* main outs */
boost::shared_ptr<IO> _master_out;
boost::shared_ptr<IO> _control_out;
- AutoConnectOption input_auto_connect;
- AutoConnectOption output_auto_connect;
-
gain_t* _gain_automation_buffer;
pan_t** _pan_automation_buffer;
void allocate_pan_automation_buffers (nframes_t nframes, uint32_t howmany, bool force);
based on max (requested,available)
*/
- uint32_t n_physical_outputs;
- uint32_t n_physical_inputs;
-
- void remove_pending_capture_state ();
+ uint32_t n_physical_audio_outputs;
+ uint32_t n_physical_audio_inputs;
int find_all_sources (std::string path, std::set<std::string>& result);
int find_all_sources_across_snapshots (std::set<std::string>& result, bool exclude_this_snapshot);
LayerModel layer_model;
CrossfadeModel xfade_model;
- typedef std::list<PBD::Controllable*> Controllables;
+ typedef std::set<PBD::Controllable*> Controllables;
Glib::Mutex controllables_lock;
Controllables controllables;
- void add_controllable (PBD::Controllable*);
- void remove_controllable (PBD::Controllable*);
+ void reset_native_file_format();
+ bool first_file_data_format_reset;
+ bool first_file_header_format_reset;
void config_changed (const char*);
+
+ XMLNode& get_control_protocol_state ();
+
+ void set_history_depth (uint32_t depth);
+
+ static bool _disable_all_loaded_plugins;
+
+ /* used in ::audible_frame() */
+
+ mutable bool have_looped;
+
+ static void get_templates_from (const std::string& path, std::list<std::string> &template_names);
};
} // namespace ARDOUR