diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-03-28 19:22:29 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-03-28 19:22:29 +0000 |
commit | e27ac3278b0d335be0ccd9d6d6373287d406adb5 (patch) | |
tree | 3e0e812304a7652909f341b1a06b5bedb04a9cb2 /libs | |
parent | 744acb7c16806759743901190d8b38b61475d5be (diff) |
a) fix problems with multichannel tape tracks
b) separate data format and header format for native audio files
c) expose data/header selections in GUI
d) fix error in file naming for multichannel tape tracks
e) remove blocks on GTK rc files during startup
git-svn-id: svn://localhost/trunk/ardour2@423 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/configuration_vars.h | 5 | ||||
-rw-r--r-- | libs/ardour/ardour/types.h | 14 | ||||
-rw-r--r-- | libs/ardour/audiofilter.cc | 2 | ||||
-rw-r--r-- | libs/ardour/diskstream.cc | 57 | ||||
-rw-r--r-- | libs/ardour/filesource.cc | 9 | ||||
-rw-r--r-- | libs/ardour/globals.cc | 15 | ||||
-rw-r--r-- | libs/ardour/import.cc | 2 | ||||
-rw-r--r-- | libs/ardour/session.cc | 8 | ||||
-rw-r--r-- | libs/ardour/session_timefx.cc | 2 |
9 files changed, 73 insertions, 41 deletions
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; |