summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/ardour.menus14
-rw-r--r--gtk2_ardour/ardour_ui.cc107
-rw-r--r--gtk2_ardour/ardour_ui.h5
-rw-r--r--gtk2_ardour/ardour_ui_ed.cc19
-rw-r--r--gtk2_ardour/ardour_ui_options.cc2
-rw-r--r--gtk2_ardour/main.cc16
-rw-r--r--gtk2_ardour/option_editor.cc41
-rw-r--r--gtk2_ardour/option_editor.h2
-rw-r--r--gtk2_ardour/regionview.cc16
-rw-r--r--gtk2_ardour/taperegionview.cc4
-rw-r--r--libs/ardour/ardour/configuration_vars.h5
-rw-r--r--libs/ardour/ardour/types.h14
-rw-r--r--libs/ardour/audiofilter.cc2
-rw-r--r--libs/ardour/diskstream.cc57
-rw-r--r--libs/ardour/filesource.cc9
-rw-r--r--libs/ardour/globals.cc15
-rw-r--r--libs/ardour/import.cc2
-rw-r--r--libs/ardour/session.cc8
-rw-r--r--libs/ardour/session_timefx.cc2
19 files changed, 227 insertions, 113 deletions
diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus
index 70a8b1d32d..7f7b461fd8 100644
--- a/gtk2_ardour/ardour.menus
+++ b/gtk2_ardour/ardour.menus
@@ -194,6 +194,16 @@
<menuitem action='About'/>
</menu>
<menu name='Options' action='Options'>
+ <menu action='AudioFileFormat'>
+ <menu action='AudioFileFormatData'>
+ <menuitem action='FileDataFormatFloat'/>
+ <menuitem action='FileDataFormat24bit'/>
+ </menu>
+ <menu action='AudioFileFormatHeader'>
+ <menuitem action='FileHeaderFormatBWF'/>
+ <menuitem action='FileHeaderFormatWAVE'/>
+ </menu>
+ </menu>
<menu action='Autoconnect'>
<menuitem action='AutoConnectNewTrackInputsToHardware'/>
<menuitem action='AutoConnectNewTrackOutputsToHardware'/>
@@ -214,6 +224,7 @@
<menuitem action='toggle-xfades-active'/>
<menuitem action='toggle-xfades-visible'/>
<menuitem action='toggle-auto-xfades'/>
+ <menuitem action='UnmuteNewFullCrossfades'/>
<separator/>
<menuitem action='CrossfadesFull'/>
<menuitem action='CrossfadesShort'/>
@@ -238,9 +249,6 @@
<menuitem action='StopRecordingOnXrun'/>
<menuitem action='StopTransportAtEndOfSession'/>
<menuitem action='GainReduceFastTransport'/>
- <separator/>
- <menuitem action='AutomaticallyCreateCrossfades'/>
- <menuitem action='UnmuteNewFullCrossfades'/>
</menu>
<menu name='Help' action='Help'>
<menu name='KeyMouse Actions' action='KeyMouse Actions'>
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index a92e9edd8c..3c01e73514 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -271,6 +271,10 @@ ARDOUR_UI::set_engine (AudioEngine& e)
blink_timeout_tag = -1;
+ /* the global configuration object is now valid */
+
+ use_config ();
+
/* this being a GUI and all, we want peakfiles */
FileSource::set_build_peakfiles (true);
@@ -2326,3 +2330,106 @@ ARDOUR_UI::cmdline_new_session (string path)
_will_create_new_session_automatically = false; /* done it */
return FALSE; /* don't call it again */
}
+
+void
+ARDOUR_UI::set_native_file_header_format (HeaderFormat hf)
+{
+ Glib::RefPtr<Action> act;
+
+ switch (hf) {
+ case BWF:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatBWF"));
+ break;
+ case WAVE:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatWAVE"));
+ break;
+ case WAVE64:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatWAVE64"));
+ break;
+ case iXML:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatiXML"));
+ break;
+ case RF64:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatRF64"));
+ break;
+ }
+
+ if (act) {
+ Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
+ if (ract && ract->get_active() && Config->get_native_file_header_format() != hf) {
+ Config->set_native_file_header_format (hf);
+ if (session) {
+ session->reset_native_file_format ();
+ }
+ }
+ }
+}
+
+void
+ARDOUR_UI::set_native_file_data_format (SampleFormat sf)
+{
+ Glib::RefPtr<Action> act;
+
+ switch (sf) {
+ case FormatFloat:
+ act = ActionManager::get_action (X_("options"), X_("FileDataFormatFloat"));
+ break;
+ case FormatInt24:
+ act = ActionManager::get_action (X_("options"), X_("FileDataFormat24bit"));
+ break;
+ }
+
+ if (act) {
+ Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
+
+ if (ract && ract->get_active() && Config->get_native_file_data_format() != sf) {
+ Config->set_native_file_data_format (sf);
+ if (session) {
+ session->reset_native_file_format ();
+ }
+ }
+ }
+}
+
+void
+ARDOUR_UI::use_config ()
+{
+ Glib::RefPtr<Action> act;
+
+ switch (Config->get_native_file_data_format ()) {
+ case FormatFloat:
+ act = ActionManager::get_action (X_("options"), X_("FileDataFormatFloat"));
+ break;
+ case FormatInt24:
+ act = ActionManager::get_action (X_("options"), X_("FileDataFormat24bit"));
+ break;
+ }
+
+ if (act) {
+ Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
+ ract->set_active ();
+ }
+
+ switch (Config->get_native_file_header_format ()) {
+ case BWF:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatBWF"));
+ break;
+ case WAVE:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatWAVE"));
+ break;
+ case WAVE64:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatWAVE64"));
+ break;
+ case iXML:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatiXML"));
+ break;
+ case RF64:
+ act = ActionManager::get_action (X_("options"), X_("FileHeaderFormatRF64"));
+ break;
+ }
+
+ if (act) {
+ Glib::RefPtr<RadioAction> ract = Glib::RefPtr<RadioAction>::cast_dynamic(act);
+ ract->set_active ();
+ }
+}
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index b676faed11..e0995fa04c 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -208,6 +208,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void maximise_editing_space ();
void restore_editing_space ();
+ void set_native_file_header_format (ARDOUR::HeaderFormat sf);
+ void set_native_file_data_format (ARDOUR::SampleFormat sf);
+
protected:
friend class PublicEditor;
@@ -305,6 +308,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void engine_stopped ();
void engine_running ();
+ void use_config ();
+
void clear_meters ();
static gint _blink (void *);
diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc
index e835c8c2ea..8414b8f070 100644
--- a/gtk2_ardour/ardour_ui_ed.cc
+++ b/gtk2_ardour/ardour_ui_ed.cc
@@ -72,7 +72,11 @@ ARDOUR_UI::install_actions ()
ActionManager::register_action (main_actions, X_("Options"), _("Options"));
ActionManager::register_action (main_actions, X_("TransportOptions"), _("Options"));
ActionManager::register_action (main_actions, X_("Help"), _("Help"));
- ActionManager::register_action (main_actions, X_("KeyMouse Actions"), _("KeyMouse Actions"));
+ ActionManager::register_action (main_actions, X_("KeyMouse Actions"), _("KeyMouse Actions"));
+ ActionManager::register_action (main_actions, X_("AudioFileFormat"), _("Audio File Format"));
+ ActionManager::register_action (main_actions, X_("AudioFileFormatHeader"), _("Header"));
+ ActionManager::register_action (main_actions, X_("AudioFileFormatData"), _("Data"));
+
/* the real actions */
act = ActionManager::register_action (main_actions, X_("New"), _("New"), bind (mem_fun(*this, &ARDOUR_UI::new_session), false, string ()));
@@ -370,6 +374,19 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_toggle_action (option_actions, X_("AutoConnectNewTrackInputsToHardware"), _("Connect newtrack inputs to hardware"), mem_fun (*this, &ARDOUR_UI::toggle_AutoConnectNewTrackInputsToHardware));
ActionManager::session_sensitive_actions.push_back (act);
+ RadioAction::Group file_header_group;
+
+ act = ActionManager::register_radio_action (option_actions, file_header_group, X_("FileHeaderFormatBWF"), X_("Broadcast WAVE"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_header_format), ARDOUR::BWF));
+ act = ActionManager::register_radio_action (option_actions, file_header_group, X_("FileHeaderFormatWAVE"), X_("WAVE"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_header_format), ARDOUR::WAVE));
+ act = ActionManager::register_radio_action (option_actions, file_header_group, X_("FileHeaderFormatWAVE64"), X_("WAVE-64"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_header_format), ARDOUR::WAVE64));
+ act = ActionManager::register_radio_action (option_actions, file_header_group, X_("FileHeaderFormatiXML"), X_("iXML"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_header_format), ARDOUR::iXML));
+ act = ActionManager::register_radio_action (option_actions, file_header_group, X_("FileHeaderFormatRF64"), X_("RF64"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_header_format), ARDOUR::RF64));
+
+ RadioAction::Group file_data_group;
+
+ act = ActionManager::register_radio_action (option_actions, file_data_group, X_("FileDataFormatFloat"), X_("32-bit floating point"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatFloat));
+ act = ActionManager::register_radio_action (option_actions, file_data_group, X_("FileDataFormat24bit"), X_("24-bit signed integer"), bind (mem_fun (*this, &ARDOUR_UI::set_native_file_data_format), ARDOUR::FormatInt24));
+
RadioAction::Group connect_outputs_group;
act = ActionManager::register_radio_action (option_actions, connect_outputs_group, X_("AutoConnectNewTrackOutputsToHardware"), _("Connect new track outputs to hardware"), mem_fun (*this, &ARDOUR_UI::toggle_AutoConnectNewTrackOutputsToHardware));
diff --git a/gtk2_ardour/ardour_ui_options.cc b/gtk2_ardour/ardour_ui_options.cc
index 91e2d2e2e8..f38aeedc8d 100644
--- a/gtk2_ardour/ardour_ui_options.cc
+++ b/gtk2_ardour/ardour_ui_options.cc
@@ -392,7 +392,7 @@ ARDOUR_UI::setup_options ()
session_control_changed (Session::AutoReturn);
session_control_changed (Session::AutoInput);
session_control_changed (Session::Clicking);
-
+
session->ControlChanged.connect (mem_fun (*this, &ARDOUR_UI::queue_session_control_changed));
}
diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc
index 289c2dba36..b702429982 100644
--- a/gtk2_ardour/main.cc
+++ b/gtk2_ardour/main.cc
@@ -318,22 +318,6 @@ main (int argc, char *argv[])
if (curvetest_file) {
return curvetest (curvetest_file);
}
-
-
- if (!use_gtk_theme) {
-
- /* desktop standard themes: just say no! */
-
- if (getenv("GTK_RC_FILES")) {
- unsetenv("GTK_RC_FILES");
- }
-
- if (getenv("GTK2_RC_FILES")) {
- unsetenv("GTK_RC_FILES");
- }
-
- RC::set_default_files (null_file_list);
- }
cout << _("Ardour/GTK ")
<< VERSIONSTRING
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc
index 11787e942d..130bf37083 100644
--- a/gtk2_ardour/option_editor.cc
+++ b/gtk2_ardour/option_editor.cc
@@ -227,12 +227,6 @@ OptionEditor::~OptionEditor ()
{
}
-static const gchar *native_format_strings[] = {
- N_("Broadcast WAVE/floating point"),
- N_("WAVE/floating point"),
- 0
-};
-
void
OptionEditor::setup_path_options()
{
@@ -251,11 +245,6 @@ OptionEditor::setup_path_options()
path_table.attach (*label, 0, 1, 0, 1, FILL|EXPAND, FILL);
path_table.attach (session_raid_entry, 1, 3, 0, 1, Gtk::FILL|Gtk::EXPAND, FILL);
- label = manage(new Label(_("Native Format")));
- label->set_name ("OptionsLabel");
- path_table.attach (*label, 0, 1, 1, 2, FILL|EXPAND, FILL);
- path_table.attach (native_format_combo, 1, 3, 1, 2, Gtk::FILL|Gtk::EXPAND, FILL);
-
label = manage(new Label(_("Soundfile Search Paths")));
label->set_name("OptionsLabel");
path_table.attach(*label, 0, 1, 2, 3, FILL|EXPAND, FILL);
@@ -264,19 +253,6 @@ OptionEditor::setup_path_options()
sfdb_path_view.append_column(_("Paths"), sfdb_path_columns.paths);
sfdb_path_view.set_size_request(-1, 100);
- vector<string> nfstrings = internationalize (native_format_strings);
-
- set_popdown_strings (native_format_combo, nfstrings);
- native_format_combo.signal_changed().connect (mem_fun(*this, &OptionEditor::native_format_chosen));
-
- fixup_combo_size (native_format_combo, nfstrings);
-
- if (Config->get_native_format_is_bwf()) {
- native_format_combo.set_active_text (native_format_strings[0]);
- } else {
- native_format_combo.set_active_text (native_format_strings[1]);
- }
-
path_table.show_all();
}
@@ -780,23 +756,6 @@ OptionEditor::click_emphasis_sound_changed ()
}
void
-OptionEditor::native_format_chosen ()
-{
- string which;
-
- if (session == 0) {
- return;
- }
-
- bool use_bwf = (native_format_combo.get_active_text() == native_format_strings[0]);
-
- if (use_bwf != Config->get_native_format_is_bwf()) {
- Config->set_native_format_is_bwf (use_bwf);
- session->reset_native_file_format ();
- }
-}
-
-void
OptionEditor::clear_click_editor ()
{
if (click_io_selector) {
diff --git a/gtk2_ardour/option_editor.h b/gtk2_ardour/option_editor.h
index 4d6736aa84..b9690b02e2 100644
--- a/gtk2_ardour/option_editor.h
+++ b/gtk2_ardour/option_editor.h
@@ -72,7 +72,6 @@ class OptionEditor : public Gtk::Dialog
Gtk::Table path_table;
Gtk::Entry session_raid_entry;
- Gtk::ComboBoxText native_format_combo;
struct SoundFilePathColumns : public Gtk::TreeModel::ColumnRecord {
public:
@@ -88,7 +87,6 @@ class OptionEditor : public Gtk::Dialog
void setup_path_options();
void add_session_paths ();
void remove_session_paths ();
- void native_format_chosen ();
void raid_path_changed ();
/* fades */
diff --git a/gtk2_ardour/regionview.cc b/gtk2_ardour/regionview.cc
index 12b72c4fe9..2ae5699b4b 100644
--- a/gtk2_ardour/regionview.cc
+++ b/gtk2_ardour/regionview.cc
@@ -986,12 +986,10 @@ AudioRegionView::create_waves ()
uint32_t nchans = atv.get_diskstream()->n_channels();
-// if (wait_for_waves) {
- /* in tmp_waves, set up null pointers for each channel so the vector is allocated */
- for (uint32_t n = 0; n < nchans; ++n) {
- tmp_waves.push_back (0);
- }
-// }
+ /* in tmp_waves, set up null pointers for each channel so the vector is allocated */
+ for (uint32_t n = 0; n < nchans; ++n) {
+ tmp_waves.push_back (0);
+ }
for (uint32_t n = 0; n < nchans; ++n) {
@@ -1099,8 +1097,12 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct)
void
AudioRegionView::peaks_ready_handler (uint32_t which)
{
- peaks_ready_connection.disconnect ();
Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun(*this, &AudioRegionView::create_one_wave), which, false));
+
+ if (!waves.empty()) {
+ /* all waves created, don't hook into peaks ready anymore */
+ peaks_ready_connection.disconnect ();
+ }
}
void
diff --git a/gtk2_ardour/taperegionview.cc b/gtk2_ardour/taperegionview.cc
index b5f0d6d46b..d08b985176 100644
--- a/gtk2_ardour/taperegionview.cc
+++ b/gtk2_ardour/taperegionview.cc
@@ -103,7 +103,7 @@ TapeAudioRegionView::init (double amplitude_above_axis, Gdk::Color& basic_color,
/* every time the wave data changes and peaks are ready, redraw */
-
+
for (uint32_t n = 0; n < region.n_channels(); ++n) {
region.source(n).PeaksReady.connect (bind (mem_fun(*this, &TapeAudioRegionView::update), n));
}
@@ -117,6 +117,8 @@ TapeAudioRegionView::~TapeAudioRegionView()
void
TapeAudioRegionView::update (uint32_t n)
{
+ cerr << "new peaks ready for channel " << n << endl;
+
/* check that all waves are build and ready */
if (!tmp_waves.empty()) {
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index 9641c43dbd..7d3a9db8b8 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -1,5 +1,5 @@
#ifdef __APPLE__
-CONFIG_VARIABLE(std::string, auditioner_output_left, "auditioner-output-left" "coreaudio:Built-in Audio:in1")
+CONFIG_VARIABLE(std::string, auditioner_output_left, "auditioner-output-left", "coreaudio:Built-in Audio:in1")
CONFIG_VARIABLE(std::string, auditioner_output_right, "auditioner-output-right", "coreaudio:Built-in Audio:in2")
#else
CONFIG_VARIABLE(std::string, auditioner_output_left, "auditioner-output-left", "alsa_pcm:playback_1")
@@ -19,7 +19,6 @@ CONFIG_VARIABLE(bool, mute_affects_main_outs, "mute-affects-main-outs", true)
CONFIG_VARIABLE(bool, solo_latch, "solo-latch", true)
CONFIG_VARIABLE(bool, use_hardware_monitoring, "use-hardware-monitoring", true)
CONFIG_VARIABLE(bool, jack_time_master, "jack-time-master", true)
-CONFIG_VARIABLE(bool, native_format_is_bwf, "native-format-is-bwf", true)
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)
@@ -37,6 +36,8 @@ CONFIG_VARIABLE(bool, quieten_at_speed, "quieten-at-speed", true)
CONFIG_VARIABLE(uint32_t, midi_feedback_interval_ms, "midi-feedback-interval-ms", 100)
CONFIG_VARIABLE(uint32_t, disk_choice_space_threshold, "disk-choice-space-threshold", 57600000)
CONFIG_VARIABLE(uint32_t, destructive_xfade_msecs, "destructive-xfade-msecs", 2)
+CONFIG_VARIABLE(SampleFormat, native_file_data_format, "native-file-data-format", ARDOUR::FormatFloat)
+CONFIG_VARIABLE(HeaderFormat, native_file_header_format, "native-file-header-format", ARDOUR::WAVE)
/* these variables have custom set() methods */
diff --git a/libs/ardour/ardour/types.h b/libs/ardour/ardour/types.h
index ae0353cc01..8dc4ce55e4 100644
--- a/libs/ardour/ardour/types.h
+++ b/libs/ardour/ardour/types.h
@@ -25,6 +25,8 @@
#define __STDC_FORMAT_MACROS /* PRI<foo>; C++ requires explicit requesting of these */
#endif
+#include <istream>
+
#include <inttypes.h>
#include <jack/types.h>
#include <map>
@@ -247,8 +249,20 @@ namespace ARDOUR {
FormatFloat = 0,
FormatInt24
};
+
+
+ enum HeaderFormat {
+ BWF,
+ WAVE,
+ WAVE64,
+ iXML,
+ RF64
+ };
+
};
+std::istream& operator>>(std::istream& o, ARDOUR::SampleFormat sf);
+std::istream& operator>>(std::istream& o, ARDOUR::HeaderFormat sf);
static inline jack_nframes_t
session_frame_to_track_frame (jack_nframes_t session_frame, double speed)
diff --git a/libs/ardour/audiofilter.cc b/libs/ardour/audiofilter.cc
index ce3a103e28..c340bccb2c 100644
--- a/libs/ardour/audiofilter.cc
+++ b/libs/ardour/audiofilter.cc
@@ -47,7 +47,7 @@ AudioFilter::make_new_sources (AudioRegion& region, AudioRegion::SourceList& nsr
}
try {
- nsrcs.push_back (new FileSource (path, session.frame_rate()));
+ nsrcs.push_back (new FileSource (path, session.frame_rate(), false, Config->get_native_file_data_format()));
}
catch (failed_constructor& err) {
diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc
index 28da6c9c31..b5bb83ee78 100644
--- a/libs/ardour/diskstream.cc
+++ b/libs/ardour/diskstream.cc
@@ -69,16 +69,11 @@ DiskStream::DiskStream (Session &sess, const string &name, Flag flag)
/* prevent any write sources from being created */
in_set_state = true;
-
-
init (flag);
use_new_playlist ();
- in_set_state = false;
- if (destructive()) {
- setup_destructive_playlist ();
- }
+ in_set_state = false;
DiskStreamCreated (this); /* EMIT SIGNAL */
}
@@ -457,9 +452,7 @@ DiskStream::setup_destructive_playlist ()
{
AudioRegion::SourceList srcs;
- /* make sure we have sources for every channel */
-
- reset_write_sources (true);
+ cerr << "setting up destructive playlist with " << channels.size() << " channels\n";
for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) {
srcs.push_back ((*chan).write_source);
@@ -2143,9 +2136,8 @@ DiskStream::set_state (const XMLNode& node)
capturing_sources.clear ();
- /* write sources are handled elsewhere;
- for destructive tracks: in {setup,use}_destructive_playlist()
- for non-destructive: when we handle the input set up of the IO that owns this DS
+ /* write sources are handled when we handle the input set
+ up of the IO that owns this DS (::non_realtime_input_change())
*/
in_set_state = false;
@@ -2210,32 +2202,35 @@ DiskStream::reset_write_sources (bool mark_write_complete, bool force)
return;
}
- if (!force && destructive()) {
+ capturing_sources.clear ();
+
+ for (chan = channels.begin(), n = 0; chan != channels.end(); ++chan, ++n) {
+ if (!destructive()) {
+
+ if ((*chan).write_source && mark_write_complete) {
+ (*chan).write_source->mark_streaming_write_completed ();
+ }
+ use_new_write_source (n);
- /* make sure we always have enough sources for the current channel count */
+ if (record_enabled()) {
+ capturing_sources.push_back ((*chan).write_source);
+ }
- for (chan = channels.begin(), n = 0; chan != channels.end(); ++chan, ++n) {
+ } else {
if ((*chan).write_source == 0) {
- break;
+ use_new_write_source (n);
}
}
+ }
- if (chan == channels.end()) {
- return;
- }
+ if (destructive()) {
- /* some channels do not have a write source */
- }
+ /* we now have all our write sources set up, so create the
+ playlist's single region.
+ */
- capturing_sources.clear ();
-
- for (chan = channels.begin(), n = 0; chan != channels.end(); ++chan, ++n) {
- if ((*chan).write_source && mark_write_complete) {
- (*chan).write_source->mark_streaming_write_completed ();
- }
- use_new_write_source (n);
- if (record_enabled()) {
- capturing_sources.push_back ((*chan).write_source);
+ if (_playlist->empty()) {
+ setup_destructive_playlist ();
}
}
}
@@ -2490,7 +2485,7 @@ DiskStream::use_pending_capture_data (XMLNode& node)
}
try {
- fs = new FileSource (prop->value(), _session.frame_rate(), true);
+ fs = new FileSource (prop->value(), _session.frame_rate(), true, Config->get_native_file_data_format());
}
catch (failed_constructor& err) {
diff --git a/libs/ardour/filesource.cc b/libs/ardour/filesource.cc
index ad8979173e..bb14d31757 100644
--- a/libs/ardour/filesource.cc
+++ b/libs/ardour/filesource.cc
@@ -265,7 +265,14 @@ FileSource::init (string pathstr, bool must_exist, jack_nframes_t rate)
if (new_file) {
- is_bwf = Config->get_native_format_is_bwf ();
+ switch (Config->get_native_file_header_format()) {
+ case BWF:
+ is_bwf = true;
+ break;
+ default:
+ is_bwf = false;
+ break;
+ }
if (fill_header (rate)) {
error << string_compose (_("FileSource: cannot write header in %1"), _path) << endmsg;
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index 31de01916a..5cfe83e944 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -501,3 +501,18 @@ ARDOUR::coverage (jack_nframes_t sa, jack_nframes_t ea,
return OverlapNone;
}
+/* not sure where to put these */
+
+std::istream& operator>>(std::istream& o, HeaderFormat hf) {
+ int val;
+ o >> val;
+ hf = (HeaderFormat) val;
+ return o;
+}
+
+std::istream& operator>>(std::istream& o, SampleFormat sf) {
+ int val;
+ o >> val;
+ sf = (SampleFormat) val;
+ return o;
+}
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc
index aa7b902501..69d5ee7b11 100644
--- a/libs/ardour/import.cc
+++ b/libs/ardour/import.cc
@@ -134,7 +134,7 @@ Session::import_audiofile (import_status& status)
try {
- newfiles[n] = new FileSource (buf, frame_rate());
+ newfiles[n] = new FileSource (buf, frame_rate(), false, Config->get_native_file_data_format());
}
catch (failed_constructor& err) {
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index fd54981908..9b581ce790 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -2795,7 +2795,7 @@ Session::audio_path_from_name (string name, uint32_t nchan, uint32_t chan, bool
if (nchan < 2) {
snprintf (buf, sizeof(buf), "%s/T%04d-%s.wav", spath.c_str(), cnt, legalized.c_str());
} else if (nchan == 2) {
- if (nchan == 0) {
+ if (chan == 0) {
snprintf (buf, sizeof(buf), "%s/T%04d-%s%%L.wav", spath.c_str(), cnt, legalized.c_str());
} else {
snprintf (buf, sizeof(buf), "%s/T%04d-%s%%R.wav", spath.c_str(), cnt, legalized.c_str());
@@ -2871,9 +2871,9 @@ Session::create_file_source (DiskStream& ds, int32_t chan, bool destructive)
/* this might throw failed_constructor(), which is OK */
if (destructive) {
- return new DestructiveFileSource (spath, frame_rate());
+ return new DestructiveFileSource (spath, frame_rate(), false, Config->get_native_file_data_format());
} else {
- return new FileSource (spath, frame_rate());
+ return new FileSource (spath, frame_rate(), false, Config->get_native_file_data_format());
}
}
@@ -3585,7 +3585,7 @@ Session::write_one_track (AudioTrack& track, jack_nframes_t start, jack_nframes_
}
try {
- fsource = new FileSource (buf, frame_rate());
+ fsource = new FileSource (buf, frame_rate(), false, Config->get_native_file_data_format());
}
catch (failed_constructor& err) {
diff --git a/libs/ardour/session_timefx.cc b/libs/ardour/session_timefx.cc
index 2fae4b32c9..6351aa9825 100644
--- a/libs/ardour/session_timefx.cc
+++ b/libs/ardour/session_timefx.cc
@@ -80,7 +80,7 @@ Session::tempoize_region (TimeStretchRequest& tsr)
}
try {
- sources.push_back(new FileSource (path, frame_rate()));
+ sources.push_back(new FileSource (path, frame_rate(), false, Config->get_native_file_data_format()));
} catch (failed_constructor& err) {
error << string_compose (_("tempoize: error creating new audio file %1 (%2)"), path, strerror (errno)) << endmsg;
goto out;