remove destructive/tape mode tracks
This commit is contained in:
parent
e89b0cfd27
commit
a4d7b45fe0
|
@ -105,7 +105,6 @@ AddRouteDialog::AddRouteDialog ()
|
|||
"* " + _("A group which the track(s) will be assigned to") + "\n" +
|
||||
#ifndef MIXBUS
|
||||
"* " + _("The pin connections mode (see tooltip for details)") + "\n" +
|
||||
"* " + _("Normal (non-destructive) or tape (destructive) recording mode") + "\n" +
|
||||
#endif
|
||||
"\n" + _("The track(s) will be added at the location specified by \"Position\"")
|
||||
));
|
||||
|
@ -135,7 +134,6 @@ AddRouteDialog::AddRouteDialog ()
|
|||
"* " + _("A group which the track(s) will be assigned to") + "\n" +
|
||||
#ifndef MIXBUS
|
||||
"* " + _("The pin connections mode (see tooltip for details)") + "\n" +
|
||||
"* " + _("Normal (non-destructive) or tape (destructive) recording mode") + "\n" +
|
||||
#endif
|
||||
"\n" + _("The track(s) will be added at the location specified by \"Position\"")
|
||||
));
|
||||
|
@ -449,11 +447,6 @@ AddRouteDialog::trk_template_row_selected ()
|
|||
case ARDOUR::Normal:
|
||||
mode_combo.set_active_text (_("Normal"));
|
||||
break;
|
||||
case ARDOUR::Destructive:
|
||||
if (!ARDOUR::Profile->get_mixbus ()) {
|
||||
mode_combo.set_active_text (_("Tape"));
|
||||
}
|
||||
break;
|
||||
default: // "NonLayered" enum is still present for session-format compat
|
||||
break;
|
||||
}
|
||||
|
@ -820,10 +813,6 @@ AddRouteDialog::refill_track_modes ()
|
|||
vector<string> s;
|
||||
|
||||
s.push_back (_("Normal"));
|
||||
if (!ARDOUR::Profile->get_mixbus ()) {
|
||||
s.push_back (_("Tape"));
|
||||
}
|
||||
|
||||
set_popdown_strings (mode_combo, s);
|
||||
mode_combo.set_active_text (s.front());
|
||||
}
|
||||
|
@ -836,8 +825,6 @@ AddRouteDialog::mode ()
|
|||
return ARDOUR::Normal;
|
||||
} else if (str == _("Non Layered")){
|
||||
return ARDOUR::NonLayered;
|
||||
} else if (str == _("Tape")) {
|
||||
return ARDOUR::Destructive;
|
||||
} else {
|
||||
fatal << string_compose (X_("programming error: unknown track mode in add route dialog combo = %1"), str)
|
||||
<< endmsg;
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
|
||||
#include "audio_streamview.h"
|
||||
#include "audio_region_view.h"
|
||||
#include "tape_region_view.h"
|
||||
#include "audio_time_axis.h"
|
||||
#include "region_selection.h"
|
||||
#include "region_gain_line.h"
|
||||
|
@ -114,10 +113,7 @@ AudioStreamView::create_region_view (boost::shared_ptr<Region> r, bool wait_for_
|
|||
_samples_per_pixel, region_color);
|
||||
}
|
||||
break;
|
||||
case Destructive:
|
||||
region_view = new TapeAudioRegionView (_canvas_group, _trackview, region,
|
||||
_samples_per_pixel, region_color);
|
||||
break;
|
||||
|
||||
default:
|
||||
fatal << string_compose (_("programming error: %1"), "illegal track mode in ::create_region_view()") << endmsg;
|
||||
abort(); /*NOTREACHED*/
|
||||
|
@ -240,7 +236,7 @@ AudioStreamView::setup_rec_box ()
|
|||
|
||||
boost::shared_ptr<AudioTrack> at = _trackview.audio_track();
|
||||
samplepos_t const sample_pos = at->current_capture_start ();
|
||||
double const width = ((at->mode() == Destructive) ? 2 : 0);
|
||||
double const width = 2;
|
||||
|
||||
create_rec_box(sample_pos, width);
|
||||
|
||||
|
|
|
@ -719,9 +719,7 @@ Editor::embed_sndfiles (vector<string> paths,
|
|||
source = boost::dynamic_pointer_cast<AudioFileSource> (
|
||||
SourceFactory::createExternal (DataType::AUDIO, *_session,
|
||||
path, n,
|
||||
(mode == ImportAsTapeTrack
|
||||
? Source::Destructive
|
||||
: Source::Flag (0)),
|
||||
Source::Flag (0),
|
||||
true, true));
|
||||
} else {
|
||||
source = boost::dynamic_pointer_cast<AudioFileSource> (s);
|
||||
|
@ -1070,27 +1068,6 @@ Editor::finish_bringing_in_material (boost::shared_ptr<Region> region,
|
|||
break;
|
||||
}
|
||||
|
||||
case ImportAsTapeTrack:
|
||||
{
|
||||
if (!ar) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
list<boost::shared_ptr<AudioTrack> > at (_session->new_audio_track (in_chans, out_chans, 0, 1, string(), PresentationInfo::max_order, Destructive));
|
||||
if (!at.empty()) {
|
||||
boost::shared_ptr<Playlist> playlist = at.front()->playlist();
|
||||
boost::shared_ptr<Region> copy (RegionFactory::create (region, true));
|
||||
playlist->clear_changes ();
|
||||
playlist->add_region (copy, pos);
|
||||
_session->add_command (new StatefulDiffCommand (playlist));
|
||||
}
|
||||
if (Config->get_strict_io ()) {
|
||||
for (list<boost::shared_ptr<AudioTrack> >::iterator i = at.begin(); i != at.end(); ++i) {
|
||||
(*i)->set_strict_io (true);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -3181,12 +3181,6 @@ Editor::separate_regions_between (const TimeSelection& ts)
|
|||
continue;
|
||||
}
|
||||
|
||||
/* no edits to destructive tracks */
|
||||
|
||||
if (rtv->track()->destructive()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((playlist = rtv->playlist()) != 0) {
|
||||
|
||||
playlist->clear_changes ();
|
||||
|
@ -3444,8 +3438,7 @@ Editor::crop_region_to (samplepos_t start, samplepos_t end)
|
|||
|
||||
boost::shared_ptr<Track> t = rtv->track();
|
||||
|
||||
if (t != 0 && ! t->destructive()) {
|
||||
|
||||
if (t) {
|
||||
if ((playlist = rtv->playlist()) != 0) {
|
||||
playlists.push_back (playlist);
|
||||
}
|
||||
|
|
|
@ -80,7 +80,6 @@ setup_gtk_ardour_enums ()
|
|||
REGISTER_ENUM (ImportAsTrack);
|
||||
REGISTER_ENUM (ImportToTrack);
|
||||
REGISTER_ENUM (ImportAsRegion);
|
||||
REGISTER_ENUM (ImportAsTapeTrack);
|
||||
REGISTER (import_mode);
|
||||
|
||||
REGISTER_ENUM (EditAtPlayhead);
|
||||
|
|
|
@ -12848,7 +12848,7 @@ msgid ""
|
|||
msgstr ""
|
||||
|
||||
#: session_option_editor.cc:136
|
||||
msgid "destructive-xfade-seconds"
|
||||
msgid "mark_destructive-xfade-seconds"
|
||||
msgstr ""
|
||||
|
||||
#: session_option_editor.cc:137
|
||||
|
|
|
@ -1074,7 +1074,7 @@ RouteTimeAxisView::rename_current_playlist ()
|
|||
string name;
|
||||
|
||||
boost::shared_ptr<Track> tr = track();
|
||||
if (!tr || tr->destructive()) {
|
||||
if (!tr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1148,7 +1148,7 @@ RouteTimeAxisView::use_new_playlist (bool prompt, vector<boost::shared_ptr<Playl
|
|||
string name;
|
||||
|
||||
boost::shared_ptr<Track> tr = track ();
|
||||
if (!tr || tr->destructive()) {
|
||||
if (!tr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1216,7 +1216,7 @@ void
|
|||
RouteTimeAxisView::clear_playlist ()
|
||||
{
|
||||
boost::shared_ptr<Track> tr = track ();
|
||||
if (!tr || tr->destructive()) {
|
||||
if (!tr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2173,15 +2173,7 @@ void
|
|||
RouteUI::track_mode_changed (void)
|
||||
{
|
||||
assert(is_track());
|
||||
switch (track()->mode()) {
|
||||
case ARDOUR::NonLayered:
|
||||
case ARDOUR::Normal:
|
||||
rec_enable_button->set_icon (ArdourIcon::RecButton);
|
||||
break;
|
||||
case ARDOUR::Destructive:
|
||||
rec_enable_button->set_icon (ArdourIcon::RecTapeMode);
|
||||
break;
|
||||
}
|
||||
rec_enable_button->set_icon (ArdourIcon::RecButton);
|
||||
rec_enable_button->queue_draw();
|
||||
}
|
||||
|
||||
|
|
|
@ -142,14 +142,6 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
|
|||
/* FADES */
|
||||
|
||||
add_option (_("Fades"), new OptionEditorHeading (_("Audio Fades")));
|
||||
add_option (_("Fades"), new SpinOption<float> (
|
||||
_("destructive-xfade-seconds"),
|
||||
_("Destructive crossfade length"),
|
||||
sigc::mem_fun (*_session_config, &SessionConfiguration::get_destructive_xfade_msecs),
|
||||
sigc::mem_fun (*_session_config, &SessionConfiguration::set_destructive_xfade_msecs),
|
||||
0, 1000, 1, 10,
|
||||
_("ms")
|
||||
));
|
||||
|
||||
add_option (_("Fades"), new BoolOption (
|
||||
"use-transport-fades",
|
||||
|
|
|
@ -144,8 +144,6 @@ importmode2string (ImportMode mode)
|
|||
return _("to selected tracks");
|
||||
case ImportAsRegion:
|
||||
return _("to source list");
|
||||
case ImportAsTapeTrack:
|
||||
return _("as new tape tracks");
|
||||
}
|
||||
abort(); /*NOTREACHED*/
|
||||
return _("as new tracks");
|
||||
|
@ -1503,9 +1501,6 @@ SoundFileOmega::reset_options ()
|
|||
|
||||
action_strings.push_back (importmode2string (ImportAsTrack));
|
||||
action_strings.push_back (importmode2string (ImportAsRegion));
|
||||
if (!Profile->get_mixbus()) {
|
||||
action_strings.push_back (importmode2string (ImportAsTapeTrack));
|
||||
}
|
||||
|
||||
existing_choice = action_combo.get_active_text();
|
||||
|
||||
|
@ -1539,7 +1534,7 @@ SoundFileOmega::reset_options ()
|
|||
|
||||
vector<string> channel_strings;
|
||||
|
||||
if (mode == ImportAsTrack || mode == ImportAsTapeTrack || mode == ImportToTrack) {
|
||||
if (mode == ImportAsTrack || mode == ImportToTrack) {
|
||||
|
||||
channel_strings.push_back (_("one track per file"));
|
||||
|
||||
|
@ -1551,9 +1546,7 @@ SoundFileOmega::reset_options ()
|
|||
/* tape tracks are a single region per track, so we cannot
|
||||
sequence multiple files.
|
||||
*/
|
||||
if (mode != ImportAsTapeTrack) {
|
||||
channel_strings.push_back (_("sequence files"));
|
||||
}
|
||||
channel_strings.push_back (_("sequence files"));
|
||||
if (same_size) {
|
||||
channel_strings.push_back (_("all files in one track"));
|
||||
channel_strings.push_back (_("merge files"));
|
||||
|
@ -1922,7 +1915,6 @@ SoundFileOmega::SoundFileOmega (string title, ARDOUR::Session* s,
|
|||
str.push_back (importmode2string (ImportAsTrack));
|
||||
str.push_back (importmode2string (ImportToTrack));
|
||||
str.push_back (importmode2string (ImportAsRegion));
|
||||
str.push_back (importmode2string (ImportAsTapeTrack));
|
||||
set_popdown_strings (action_combo, str);
|
||||
action_combo.set_active_text (importmode2string(mode_hint));
|
||||
|
||||
|
|
|
@ -471,12 +471,6 @@ StreamView::update_rec_box ()
|
|||
xend = _trackview.editor().sample_to_pixel (at);
|
||||
break;
|
||||
|
||||
case Destructive:
|
||||
rect.length = 2;
|
||||
xstart = _trackview.editor().sample_to_pixel (_trackview.track()->current_capture_start());
|
||||
xend = _trackview.editor().sample_to_pixel (at);
|
||||
break;
|
||||
|
||||
default:
|
||||
fatal << string_compose (_("programming error: %1"), "illegal track mode") << endmsg;
|
||||
abort(); /*NOTREACHED*/
|
||||
|
|
|
@ -1,160 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2006-2012 David Robillard <d@drobilla.net>
|
||||
* Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com>
|
||||
* Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
|
||||
* Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
|
||||
#include <gtkmm2ext/gtk_ui.h>
|
||||
|
||||
#include "ardour/audioregion.h"
|
||||
#include "ardour/audiosource.h"
|
||||
|
||||
#include "tape_region_view.h"
|
||||
#include "audio_time_axis.h"
|
||||
#include "gui_thread.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
|
||||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
using namespace Editing;
|
||||
using namespace ArdourCanvas;
|
||||
|
||||
const TimeAxisViewItem::Visibility TapeAudioRegionView::default_tape_visibility
|
||||
= TimeAxisViewItem::Visibility (
|
||||
TimeAxisViewItem::ShowNameHighlight |
|
||||
TimeAxisViewItem::ShowNameText |
|
||||
TimeAxisViewItem::ShowFrame |
|
||||
TimeAxisViewItem::HideFrameRight |
|
||||
TimeAxisViewItem::FullWidthNameHighlight);
|
||||
|
||||
TapeAudioRegionView::TapeAudioRegionView (ArdourCanvas::Container *parent, RouteTimeAxisView &tv,
|
||||
boost::shared_ptr<AudioRegion> r,
|
||||
double spu,
|
||||
uint32_t basic_color)
|
||||
|
||||
: AudioRegionView (parent, tv, r, spu, basic_color, false,
|
||||
TimeAxisViewItem::Visibility ((r->position() != 0) ? default_tape_visibility :
|
||||
TimeAxisViewItem::Visibility (default_tape_visibility|TimeAxisViewItem::HideFrameLeft)))
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
TapeAudioRegionView::init (bool /*wfw*/)
|
||||
{
|
||||
/* never wait for data: always just create the waves, connect once and then
|
||||
we'll update whenever we need to.
|
||||
*/
|
||||
|
||||
AudioRegionView::init (false);
|
||||
|
||||
/* every time the wave data changes and peaks are ready, redraw */
|
||||
|
||||
for (uint32_t n = 0; n < audio_region()->n_channels(); ++n) {
|
||||
audio_region()->audio_source(n)->PeaksReady.connect (*this, invalidator (*this), boost::bind (&TapeAudioRegionView::update, this, n), gui_context());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TapeAudioRegionView::~TapeAudioRegionView()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
TapeAudioRegionView::update (uint32_t /*n*/)
|
||||
{
|
||||
/* this code doesn't work properly, the WaveViewCache is not updated
|
||||
* when recording over (replacing) an existing part of the tape.
|
||||
*
|
||||
* WaveView probably needs to become aware if the given Region is
|
||||
* tape-track and handle caching.
|
||||
*
|
||||
* explicitly forcing an update here can deadlock if the rendering
|
||||
* request is non-threaded (resize track height or at rec-stop)
|
||||
*/
|
||||
|
||||
#if 0
|
||||
/* deadlock:
|
||||
#1 0x00007f9570ebd77c in g_mutex_lock_slowpath (mutex=0x7f9575157760 <ArdourWaveView::WaveView::current_image_lock>) at ././glib/gthread-posix.c:1313
|
||||
#2 0x000055f6f8d1aac0 in Glib::Threads::Mutex::Lock::Lock(Glib::Threads::Mutex&) (this=0x7ffc4d905aa0, mutex=...) at /usr/include/glibmm-2.4/glibmm/threads.h:688
|
||||
#3 0x00007f9574f05054 in ArdourWaveView::WaveView::invalidate_image_cache() (this=0x55f6fdf341a0) at ../libs/canvas/wave_view.cc:275
|
||||
#4 0x00007f9574f0b1b0 in ArdourWaveView::WaveView::gain_changed() (this=0x55f6fdf341a0) at ../libs/canvas/wave_view.cc:1329
|
||||
#5 0x000055f6f96eb1b8 in TapeAudioRegionView::update(unsigned int) (this=0x55f6fdf32640) at ../gtk2_ardour/tape_region_view.cc:102
|
||||
#6 0x000055f6f96eba9f in boost::_mfi::mf1<void, TapeAudioRegionView, unsigned int>::operator()(TapeAudioRegionView*, unsigned int) const (this=0x55f6fa74ce10, p=0x55f6fdf32640, a1=0)
|
||||
at /usr/include/boost/bind/mem_fn_template.hpp:165
|
||||
#7 0x000055f6f96eb9b3 in boost::_bi::list2<boost::_bi::value<TapeAudioRegionView*>, boost::_bi::value<unsigned int> >::operator()<boost::_mfi::mf1<void, TapeAudioRegionView, unsigned int>, boost::_bi::list0>(boost::_bi::type<void>, boost::_mfi::mf1<void, TapeAudioRegionView, unsigned int>&, boost::_bi::list0&, int) (this=0x55f6fa74ce20, f=..., a=...)
|
||||
at /usr/include/boost/bind/bind.hpp:319
|
||||
#8 0x000055f6f96eb76f in boost::_bi::bind_t<void, boost::_mfi::mf1<void, TapeAudioRegionView, unsigned int>, boost::_bi::list2<boost::_bi::value<TapeAudioRegionView*>, boost::_bi::value<unsigned int> > >::operator()() (this=0x55f6fa74ce10) at /usr/include/boost/bind/bind.hpp:1294
|
||||
#9 0x000055f6f96eb6b4 in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, boost::_mfi::mf1<void, TapeAudioRegionView, unsigned int>, boost::_bi::list2<boost::_bi::value<TapeAudioRegionView*>, boost::_bi::value<unsigned int> > >, void>::invoke(boost::detail::function::function_buffer&) (function_obj_ptr=...)
|
||||
at /usr/include/boost/function/function_template.hpp:159
|
||||
#10 0x000055f6f8d73fc8 in boost::function0<void>::operator()() const (this=0x55f6fefe4f60) at /usr/include/boost/function/function_template.hpp:771
|
||||
#11 0x000055f6f8da3a00 in boost::_bi::list0::operator()<boost::function<void ()>, boost::_bi::list0>(boost::_bi::type<void>, boost::function<void ()>&, boost::_bi::list0&, int) (this=0x55f6fefe4f80, f=...) at /usr/include/boost/bind/bind.hpp:198
|
||||
#12 0x000055f6f8d9869f in boost::_bi::bind_t<boost::_bi::unspecified, boost::function<void ()>, boost::_bi::list0>::operator()() (this=0x55f6fefe4f60)
|
||||
at /usr/include/boost/bind/bind.hpp:1294
|
||||
#13 0x000055f6f8d8f068 in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<boost::_bi::unspecified, boost::function<void ()>, boost::_bi::list0>, void>::invoke(boost::detail::function::function_buffer&) (function_obj_ptr=...) at /usr/include/boost/function/function_template.hpp:159
|
||||
#14 0x000055f6f8d73fc8 in boost::function0<void>::operator()() const (this=0x7ffc4d905f60) at /usr/include/boost/function/function_template.hpp:771
|
||||
#15 0x00007f9574b11192 in AbstractUI<Gtkmm2ext::UIRequest>::call_slot(PBD::EventLoop::InvalidationRecord*, boost::function<void ()> const&) (this=
|
||||
0x55f6fa47dfe0, invalidation=0x55f6fdf375d0, f=...) at /home/rgareus/src/ardour/libs/pbd/pbd/abstract_ui.cc:425
|
||||
#16 0x000055f6f8d70a9c in PBD::Signal0<void, PBD::OptionalLastValue<void> >::compositor(boost::function<void ()>, PBD::EventLoop*, PBD::EventLoop::InvalidationRecord*) (f=..., event_loop=0x55f6fa47dfe0, ir=0x55f6fdf375d0) at /home/rgareus/src/ardour/build/libs/pbd/pbd/signals_generated.h:216
|
||||
#17 0x000055f6f8da3c64 in boost::_bi::list3<boost::_bi::value<boost::function<void ()> >, boost::_bi::value<PBD::EventLoop*>, boost::_bi::value<PBD::EventLoop::InvalidationRecord*> >::operator()<void (*)(boost::function<void ()>, PBD::EventLoop*, PBD::EventLoop::InvalidationRecord*), boost::_bi::list0>(boost::_bi::type<void>, void (*&)(boost::function<void ()>, PBD::EventLoop*, PBD::EventLoop::InvalidationRecord*), boost::_bi::list0&, int) (this=0x55f6fa6a9bd8, f=
|
||||
@0x55f6fa6a9bd0: 0x55f6f8d70a0f <PBD::Signal0<void, PBD::OptionalLastValue<void> >::compositor(boost::function<void ()>, PBD::EventLoop*, PBD::EventLoop::InvalidationRecord*)>, a=...)
|
||||
at /usr/include/boost/bind/bind.hpp:398
|
||||
#18 0x000055f6f8d98827 in boost::_bi::bind_t<void, void (*)(boost::function<void ()>, PBD::EventLoop*, PBD::EventLoop::InvalidationRecord*), boost::_bi::list3<boost::_bi::value<boost::function<void ()> >, boost::_bi::value<PBD::EventLoop*>, boost::_bi::value<PBD::EventLoop::InvalidationRecord*> > >::operator()() (this=0x55f6fa6a9bd0) at /usr/include/boost/bind/bind.hpp:1294
|
||||
#19 0x000055f6f8d8f1ee in boost::detail::function::void_function_obj_invoker0<boost::_bi::bind_t<void, void (*)(boost::function<void ()>, PBD::EventLoop*, PBD::EventLoop::InvalidationRecord*), boost::_bi::list3<boost::_bi::value<boost::function<void ()> >, boost::_bi::value<PBD::EventLoop*>, boost::_bi::value<PBD::EventLoop::InvalidationRecord*> > >, void>::invoke(boost::detail::function::function_buffer&) (function_obj_ptr=...) at /usr/include/boost/function/function_template.hpp:159
|
||||
#20 0x000055f6f8d73fc8 in boost::function0<void>::operator()() const (this=0x55f6ffdb4de0) at /usr/include/boost/function/function_template.hpp:771
|
||||
#21 0x000055f6f8d70ea8 in PBD::Signal0<void, PBD::OptionalLastValue<void> >::operator()() (this=0x55f6fd359158) at /home/rgareus/src/ardour/build/libs/pbd/pbd/signals_generated.h:325
|
||||
#22 0x00007f95739515a3 in ARDOUR::AudioSource::done_with_peakfile_writes(bool) (this=0x55f6fd359140, done=true) at ../libs/ardour/audiosource.cc:841
|
||||
#23 0x00007f9573950fbe in ARDOUR::AudioSource::build_peaks_from_scratch() (this=0x55f6fd359140) at ../libs/ardour/audiosource.cc:779
|
||||
#24 0x00007f957394ee6b in ARDOUR::AudioSource::read_peaks_with_fpp(ARDOUR::PeakData*, long, long, long, double, long) const (this=0x55f6fd359140, peaks=0x55f700da6b80, npeaks=1356, start=113190, cnt=447480, samples_per_visual_peak=330, samples_per_file_peak=256) at ../libs/ardour/audiosource.cc:391
|
||||
#25 0x00007f957394eb15 in ARDOUR::AudioSource::read_peaks(ARDOUR::PeakData*, long, long, long, double) const (this=0x55f6fd359140, peaks=0x55f700da6b80, npeaks=1356, start=113190, cnt=447480, samples_per_visual_peak=330) at ../libs/ardour/audiosource.cc:337
|
||||
#26 0x00007f957393a905 in ARDOUR::AudioRegion::read_peaks(ARDOUR::PeakData*, long, long, long, unsigned int, double) const (this=
|
||||
0x55f6fd84c3b0, buf=0x55f700da6b80, npeaks=1356, offset=113190, cnt=447480, chan_n=0, samples_per_pixel=330) at ../libs/ardour/audioregion.cc:431
|
||||
#27 0x00007f9574f09caa in ArdourWaveView::WaveView::generate_image(boost::shared_ptr<ArdourWaveView::WaveViewThreadRequest>, bool) const (this=0x55f6fdf341a0, req=..., in_render_thread=false)
|
||||
at ../libs/canvas/wave_view.cc:1005
|
||||
#28 0x00007f9574f08e99 in ArdourWaveView::WaveView::get_image(long, long, bool&) const (this=0x55f6fdf341a0, start=225060, end=448800, full_image=@0x7ffc4d9070c7: false)
|
||||
---Type <return> to continue, or q <return> to quit---
|
||||
at ../libs/canvas/wave_view.cc:870
|
||||
#29 0x00007f9574f0a6e8 in ArdourWaveView::WaveView::render(ArdourCanvas::Rect const&, Cairo::RefPtr<Cairo::Context>) const (this=0x55f6fdf341a0, area=..., context=...)
|
||||
at ../libs/canvas/wave_view.cc:1180
|
||||
*/
|
||||
|
||||
/* check that all waves are build and ready */
|
||||
if (!tmp_waves.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ENSURE_GUI_THREAD (*this, &TapeAudioRegionView::update, n);
|
||||
// CAIROCANVAS
|
||||
|
||||
/* this is a quick hack to draw something (abuse gain_changed to force
|
||||
* an image-cache invalidation.
|
||||
*
|
||||
* TODO: ArdourWaveView::WaveView needs an API to look up the specific channel "n"
|
||||
* and a special case to not only invalidate the cache but re-expose the
|
||||
* waveform. e.g.
|
||||
*
|
||||
* waves[m]->rebuild(); // where 'm' corresponds to channel 'n'.
|
||||
*/
|
||||
for (uint32_t i = 0; i < waves.size(); ++i) {
|
||||
waves[i]->gain_changed ();
|
||||
}
|
||||
#endif
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2006-2009 David Robillard <d@drobilla.net>
|
||||
* Copyright (C) 2006-2014 Paul Davis <paul@linuxaudiosystems.com>
|
||||
* Copyright (C) 2009 Carl Hetherington <carl@carlh.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef __gtk_ardour_tape_audio_region_view_h__
|
||||
#define __gtk_ardour_tape_audio_region_view_h__
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "audio_region_view.h"
|
||||
|
||||
class TapeAudioRegionView : public AudioRegionView
|
||||
{
|
||||
public:
|
||||
TapeAudioRegionView (ArdourCanvas::Container *,
|
||||
RouteTimeAxisView&,
|
||||
boost::shared_ptr<ARDOUR::AudioRegion>,
|
||||
double initial_samples_per_pixel,
|
||||
uint32_t base_color);
|
||||
~TapeAudioRegionView ();
|
||||
|
||||
protected:
|
||||
void init (bool wait_for_waves);
|
||||
|
||||
void update (uint32_t n);
|
||||
|
||||
static const TimeAxisViewItem::Visibility default_tape_visibility;
|
||||
};
|
||||
|
||||
#endif /* __gtk_ardour_tape_audio_region_view_h__ */
|
|
@ -264,7 +264,6 @@ gtk2_ardour_sources = [
|
|||
'stripable_colorpicker.cc',
|
||||
'stripable_time_axis.cc',
|
||||
'sys_ex.cc',
|
||||
'tape_region_view.cc',
|
||||
'template_dialog.cc',
|
||||
'tempo_curve.cc',
|
||||
'tempo_dialog.cc',
|
||||
|
|
|
@ -51,9 +51,6 @@ public:
|
|||
return safe_audio_file_extension(path);
|
||||
}
|
||||
|
||||
/* this block of methods do nothing for regular file sources, but are significant
|
||||
for files used in destructive recording.
|
||||
*/
|
||||
virtual samplepos_t last_capture_start_sample() const { return 0; }
|
||||
virtual void mark_capture_start (samplepos_t) {}
|
||||
virtual void mark_capture_end () {}
|
||||
|
@ -72,7 +69,7 @@ public:
|
|||
XMLNode& get_state ();
|
||||
int set_state (const XMLNode&, int version);
|
||||
|
||||
bool can_truncate_peaks() const { return !destructive(); }
|
||||
bool can_truncate_peaks() const { return true; }
|
||||
bool can_be_analysed() const { return _length > 0; }
|
||||
|
||||
static bool safe_audio_file_extension (const std::string& path);
|
||||
|
|
|
@ -54,7 +54,6 @@ public:
|
|||
enum Flag {
|
||||
Recordable = 0x1,
|
||||
Hidden = 0x2,
|
||||
Destructive = 0x4,
|
||||
NonLayered = 0x8 // deprecated (kept only for enum compat)
|
||||
};
|
||||
|
||||
|
|
|
@ -97,8 +97,6 @@ public:
|
|||
void set_record_enabled (bool yn);
|
||||
void set_record_safe (bool yn);
|
||||
|
||||
bool destructive () const { return _flags & Destructive; }
|
||||
|
||||
/** @return Start position of currently-running capture (in session samples) */
|
||||
samplepos_t current_capture_start () const { return _capture_start_sample; }
|
||||
samplepos_t current_capture_end () const { return _capture_start_sample + _capture_captured; }
|
||||
|
@ -149,8 +147,6 @@ private:
|
|||
static samplecnt_t _chunk_samples;
|
||||
|
||||
void prepare_record_status (samplepos_t /*capture_start_sample*/);
|
||||
void setup_destructive_playlist ();
|
||||
void use_destructive_playlist ();
|
||||
|
||||
int add_channel_to (boost::shared_ptr<ChannelList>, uint32_t how_many);
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
|
||||
int set_state (const XMLNode&, int version);
|
||||
|
||||
int set_source_name (const std::string& newname, bool destructive);
|
||||
int set_source_name (const std::string& newname);
|
||||
|
||||
static bool find (Session&, DataType type, const std::string& path,
|
||||
bool must_exist, bool& is_new, uint16_t& chan,
|
||||
|
|
|
@ -262,9 +262,9 @@ public:
|
|||
std::string construct_peak_filepath (const std::string& audio_path, const bool in_session = false, const bool old_peak_name = false) const;
|
||||
|
||||
bool audio_source_name_is_unique (const std::string& name);
|
||||
std::string format_audio_source_name (const std::string& legalized_base, uint32_t nchan, uint32_t chan, bool destructive, bool take_required, uint32_t cnt, bool related_exists);
|
||||
std::string format_audio_source_name (const std::string& legalized_base, uint32_t nchan, uint32_t chan, bool take_required, uint32_t cnt, bool related_exists);
|
||||
std::string new_audio_source_path_for_embedded (const std::string& existing_path);
|
||||
std::string new_audio_source_path (const std::string&, uint32_t nchans, uint32_t chan, bool destructive, bool take_required);
|
||||
std::string new_audio_source_path (const std::string&, uint32_t nchans, uint32_t chan, bool take_required);
|
||||
std::string new_midi_source_path (const std::string&, bool need_source_lock = true);
|
||||
|
||||
/** create a new track or bus from a template (XML path)
|
||||
|
@ -841,7 +841,7 @@ public:
|
|||
static PBD::Signal0<int> AskAboutPendingState;
|
||||
|
||||
boost::shared_ptr<AudioFileSource> create_audio_source_for_session (
|
||||
size_t, std::string const &, uint32_t, bool destructive);
|
||||
size_t, std::string const &, uint32_t);
|
||||
|
||||
boost::shared_ptr<MidiSource> create_midi_source_for_session (std::string const &);
|
||||
boost::shared_ptr<MidiSource> create_midi_source_by_stealing_name (boost::shared_ptr<Track>);
|
||||
|
@ -1761,8 +1761,6 @@ private:
|
|||
bool _reconnecting_routes_in_progress;
|
||||
bool _route_deletion_in_progress;
|
||||
|
||||
uint32_t destructive_index;
|
||||
|
||||
boost::shared_ptr<Route> XMLRouteFactory (const XMLNode&, int);
|
||||
boost::shared_ptr<Route> XMLRouteFactory_2X (const XMLNode&, int);
|
||||
boost::shared_ptr<Route> XMLRouteFactory_3X (const XMLNode&, int);
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
the value of the variable.
|
||||
*****************************************************/
|
||||
|
||||
CONFIG_VARIABLE (uint32_t, destructive_xfade_msecs, "destructive-xfade-msecs", 2)
|
||||
CONFIG_VARIABLE (bool, use_region_fades, "use-region-fades", true)
|
||||
CONFIG_VARIABLE (bool, use_transport_fades, "use-transport-fades", true)
|
||||
CONFIG_VARIABLE (bool, use_monitor_fades, "use-monitor-fades", true)
|
||||
|
|
|
@ -37,7 +37,6 @@ public:
|
|||
void set_length (samplecnt_t len) { _length = len; }
|
||||
void flush () {}
|
||||
|
||||
bool destructive() const { return false; }
|
||||
bool can_be_analysed() const { return false; }
|
||||
|
||||
bool clamped_at_unity() const { return false; }
|
||||
|
|
|
@ -65,17 +65,11 @@ class LIBARDOUR_API SndFileSource : public AudioFileSource {
|
|||
int flush_header ();
|
||||
void flush ();
|
||||
|
||||
samplepos_t last_capture_start_sample() const;
|
||||
void mark_capture_start (samplepos_t);
|
||||
void mark_capture_end ();
|
||||
void clear_capture_marks();
|
||||
|
||||
bool one_of_several_channels () const;
|
||||
uint32_t channel_count () const { return _info.channels; }
|
||||
uint32_t channel_count () const { return _info.channels; }
|
||||
|
||||
bool clamped_at_unity () const;
|
||||
|
||||
static void setup_standard_crossfades (Session const &, samplecnt_t sample_rate);
|
||||
static const Source::Flag default_writable_flags;
|
||||
|
||||
static int get_soundfile_info (const std::string& path, SoundFileInfo& _info, std::string& error_msg);
|
||||
|
@ -100,24 +94,8 @@ class LIBARDOUR_API SndFileSource : public AudioFileSource {
|
|||
int setup_broadcast_info (samplepos_t when, struct tm&, time_t);
|
||||
void file_closed ();
|
||||
|
||||
/* destructive */
|
||||
|
||||
static samplecnt_t xfade_samples;
|
||||
|
||||
static gain_t* out_coefficient;
|
||||
static gain_t* in_coefficient;
|
||||
|
||||
bool _capture_start;
|
||||
bool _capture_end;
|
||||
samplepos_t capture_start_sample;
|
||||
samplepos_t file_pos; // unit is samples
|
||||
Sample* xfade_buf;
|
||||
|
||||
samplecnt_t crossfade (Sample* data, samplecnt_t cnt, int dir);
|
||||
void set_natural_position (samplepos_t);
|
||||
samplecnt_t destructive_write_unlocked (Sample *dst, samplecnt_t cnt);
|
||||
samplecnt_t nondestructive_write_unlocked (Sample *dst, samplecnt_t cnt);
|
||||
void handle_header_position_change ();
|
||||
PBD::ScopedConnection header_position_connection;
|
||||
};
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
RemovableIfEmpty = 0x10,
|
||||
RemoveAtDestroy = 0x20,
|
||||
NoPeakFile = 0x40,
|
||||
Destructive = 0x80,
|
||||
/* 0x80 was Destructive */
|
||||
Empty = 0x100, /* used for MIDI only */
|
||||
RF64_RIFF = 0x200,
|
||||
Missing = 0x400, /* used for MIDI only */
|
||||
|
@ -88,7 +88,6 @@ public:
|
|||
XMLNode& get_state ();
|
||||
int set_state (const XMLNode&, int version);
|
||||
|
||||
bool destructive() const { return (_flags & Destructive); }
|
||||
bool writable () const;
|
||||
|
||||
virtual bool length_mutable() const { return false; }
|
||||
|
|
|
@ -54,7 +54,7 @@ class LIBARDOUR_API SourceFactory {
|
|||
static boost::shared_ptr<Source> createWritable
|
||||
(DataType type, Session&,
|
||||
const std::string& path,
|
||||
bool destructive, samplecnt_t rate, bool announce = true, bool async = false);
|
||||
samplecnt_t rate, bool announce = true, bool async = false);
|
||||
|
||||
|
||||
static boost::shared_ptr<Source> createForRecovery
|
||||
|
|
|
@ -46,7 +46,6 @@ public:
|
|||
samplecnt_t readable_length() const { return _source->readable_length() * _ratio; }
|
||||
samplecnt_t length (samplepos_t pos) const { return _source->length(pos) * _ratio; }
|
||||
|
||||
bool destructive() const { return false; }
|
||||
bool can_be_analysed() const { return false; }
|
||||
bool clamped_at_unity() const { return false; }
|
||||
|
||||
|
|
|
@ -129,7 +129,6 @@ public:
|
|||
boost::shared_ptr<Playlist> playlist ();
|
||||
void request_input_monitoring (bool);
|
||||
void ensure_input_monitoring (bool);
|
||||
bool destructive () const;
|
||||
std::list<boost::shared_ptr<Source> > & last_capture_sources ();
|
||||
std::string steal_write_source_name ();
|
||||
void reset_write_sources (bool, bool force = false);
|
||||
|
@ -208,7 +207,6 @@ protected:
|
|||
|
||||
FreezeRecord _freeze_record;
|
||||
XMLNode* pending_state;
|
||||
bool _destructive;
|
||||
|
||||
boost::shared_ptr<AutomationControl> _record_enable_control;
|
||||
boost::shared_ptr<AutomationControl> _record_safe_control;
|
||||
|
|
|
@ -227,7 +227,6 @@ enum MeterType {
|
|||
enum TrackMode {
|
||||
Normal,
|
||||
NonLayered,
|
||||
Destructive
|
||||
};
|
||||
|
||||
enum NoteMode {
|
||||
|
|
|
@ -60,8 +60,8 @@ AudioPlaylistSource::AudioPlaylistSource (Session& s, const XMLNode& node)
|
|||
, PlaylistSource (s, node)
|
||||
, AudioSource (s, node)
|
||||
{
|
||||
/* PlaylistSources are never writable, renameable, removable or destructive */
|
||||
_flags = Flag (_flags & ~(Writable|CanRename|Removable|RemovableIfEmpty|RemoveAtDestroy|Destructive));
|
||||
/* PlaylistSources are never writable, renameable or removable */
|
||||
_flags = Flag (_flags & ~(Writable|CanRename|Removable|RemovableIfEmpty|RemoveAtDestroy));
|
||||
|
||||
/* ancestors have already called ::set_state() in their XML-based
|
||||
constructors.
|
||||
|
|
|
@ -1587,11 +1587,6 @@ AudioRegion::source_offset_changed ()
|
|||
}
|
||||
|
||||
boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource>(_sources.front());
|
||||
|
||||
if (afs && afs->destructive()) {
|
||||
// set_start (source()->natural_position(), this);
|
||||
set_position (source()->natural_position());
|
||||
}
|
||||
}
|
||||
|
||||
boost::shared_ptr<AudioSource>
|
||||
|
|
|
@ -349,27 +349,8 @@ DiskWriter::non_realtime_locate (samplepos_t position)
|
|||
void
|
||||
DiskWriter::prepare_record_status (samplepos_t _capture_start_sample)
|
||||
{
|
||||
if (recordable() && destructive()) {
|
||||
boost::shared_ptr<ChannelList> c = channels.reader ();
|
||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
|
||||
|
||||
RingBufferNPT<CaptureTransition>::rw_vector transitions;
|
||||
(*chan)->capture_transition_buf->get_write_vector (&transitions);
|
||||
|
||||
if (transitions.len[0] > 0) {
|
||||
transitions.buf[0]->type = CaptureStart;
|
||||
transitions.buf[0]->capture_val = _capture_start_sample;
|
||||
(*chan)->capture_transition_buf->increment_write_ptr(1);
|
||||
} else {
|
||||
// bad!
|
||||
fatal << X_("programming error: capture_transition_buf is full on rec start! inconceivable!")
|
||||
<< endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** Do some record stuff [not described in this comment!]
|
||||
*
|
||||
* Also:
|
||||
|
@ -675,25 +656,6 @@ DiskWriter::finish_capture (boost::shared_ptr<ChannelList> c)
|
|||
return;
|
||||
}
|
||||
|
||||
if (recordable() && destructive()) {
|
||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
|
||||
|
||||
RingBufferNPT<CaptureTransition>::rw_vector transvec;
|
||||
(*chan)->capture_transition_buf->get_write_vector(&transvec);
|
||||
|
||||
if (transvec.len[0] > 0) {
|
||||
transvec.buf[0]->type = CaptureEnd;
|
||||
transvec.buf[0]->capture_val = _capture_captured;
|
||||
(*chan)->capture_transition_buf->increment_write_ptr(1);
|
||||
}
|
||||
else {
|
||||
// bad!
|
||||
fatal << string_compose (_("programmer error: %1"), X_("capture_transition_buf is full when stopping record! inconceivable!")) << endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CaptureInfo* ci = new CaptureInfo;
|
||||
|
||||
ci->start = _capture_start_sample;
|
||||
|
@ -744,12 +706,6 @@ DiskWriter::set_record_enabled (bool yn)
|
|||
return;
|
||||
}
|
||||
|
||||
/* can't rec-enable in destructive mode if transport is before start */
|
||||
|
||||
if (destructive() && yn && _session.transport_sample() < _session.current_start_sample()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* yes, i know that this not proof against race conditions, but its
|
||||
good enough. i think.
|
||||
*/
|
||||
|
@ -772,13 +728,6 @@ DiskWriter::set_record_safe (bool yn)
|
|||
return;
|
||||
}
|
||||
|
||||
/* can't rec-safe in destructive mode if transport is before start ????
|
||||
REQUIRES REVIEW */
|
||||
|
||||
if (destructive() && yn && _session.transport_sample() < _session.current_start_sample()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* yes, i know that this not proof against race conditions, but its
|
||||
good enough. i think.
|
||||
*/
|
||||
|
@ -801,12 +750,6 @@ DiskWriter::prep_record_enable ()
|
|||
return false;
|
||||
}
|
||||
|
||||
/* can't rec-enable in destructive mode if transport is before start */
|
||||
|
||||
if (destructive() && _session.transport_sample() < _session.current_start_sample()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::shared_ptr<ChannelList> c = channels.reader();
|
||||
|
||||
capturing_sources.clear ();
|
||||
|
@ -872,12 +815,6 @@ DiskWriter::seek (samplepos_t sample, bool complete_refill)
|
|||
g_atomic_int_set(&_samples_read_from_ringbuffer, 0);
|
||||
g_atomic_int_set(&_samples_written_to_ringbuffer, 0);
|
||||
|
||||
/* can't rec-enable in destructive mode if transport is before start */
|
||||
|
||||
if (destructive() && record_enabled() && sample < _session.current_start_sample()) {
|
||||
disengage_record_enable ();
|
||||
}
|
||||
|
||||
playback_sample = sample;
|
||||
|
||||
return 0;
|
||||
|
@ -925,56 +862,6 @@ DiskWriter::do_flush (RunContext ctxt, bool force_flush)
|
|||
|
||||
to_write = min (_chunk_samples, (samplecnt_t) vector.len[0]);
|
||||
|
||||
// check the transition buffer when recording destructive
|
||||
// important that we get this after the capture buf
|
||||
|
||||
if (destructive()) {
|
||||
(*chan)->capture_transition_buf->get_read_vector(&transvec);
|
||||
size_t transcount = transvec.len[0] + transvec.len[1];
|
||||
size_t ti;
|
||||
|
||||
for (ti=0; ti < transcount; ++ti) {
|
||||
CaptureTransition & captrans = (ti < transvec.len[0]) ? transvec.buf[0][ti] : transvec.buf[1][ti-transvec.len[0]];
|
||||
|
||||
if (captrans.type == CaptureStart) {
|
||||
// by definition, the first data we got above represents the given capture pos
|
||||
|
||||
(*chan)->write_source->mark_capture_start (captrans.capture_val);
|
||||
(*chan)->curr_capture_cnt = 0;
|
||||
|
||||
} else if (captrans.type == CaptureEnd) {
|
||||
|
||||
// capture end, the capture_val represents total samples in capture
|
||||
|
||||
if (captrans.capture_val <= (*chan)->curr_capture_cnt + to_write) {
|
||||
|
||||
// shorten to make the write a perfect fit
|
||||
uint32_t nto_write = (captrans.capture_val - (*chan)->curr_capture_cnt);
|
||||
|
||||
if (nto_write < to_write) {
|
||||
ret = 1; // should we?
|
||||
}
|
||||
to_write = nto_write;
|
||||
|
||||
(*chan)->write_source->mark_capture_end ();
|
||||
|
||||
// increment past this transition, but go no further
|
||||
++ti;
|
||||
break;
|
||||
}
|
||||
else {
|
||||
// actually ends just beyond this chunk, so force more work
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ti > 0) {
|
||||
(*chan)->capture_transition_buf->increment_read_ptr(ti);
|
||||
}
|
||||
}
|
||||
|
||||
if ((!(*chan)->write_source) || (*chan)->write_source->write (vector.buf[0], to_write) != to_write) {
|
||||
error << string_compose(_("AudioDiskstream %1: cannot write to disk"), id()) << endmsg;
|
||||
return -1;
|
||||
|
@ -983,7 +870,7 @@ DiskWriter::do_flush (RunContext ctxt, bool force_flush)
|
|||
(*chan)->wbuf->increment_read_ptr (to_write);
|
||||
(*chan)->curr_capture_cnt += to_write;
|
||||
|
||||
if ((to_write == vector.len[0]) && (total > to_write) && (to_write < _chunk_samples) && !destructive()) {
|
||||
if ((to_write == vector.len[0]) && (total > to_write) && (to_write < _chunk_samples)) {
|
||||
|
||||
/* we wrote all of vector.len[0] but it wasn't an entire
|
||||
disk_write_chunk_samples of data, so arrange for some part
|
||||
|
@ -1068,35 +955,26 @@ DiskWriter::reset_write_sources (bool mark_write_complete, bool /*force*/)
|
|||
|
||||
for (chan = c->begin(), n = 0; chan != c->end(); ++chan, ++n) {
|
||||
|
||||
if (!destructive()) {
|
||||
if ((*chan)->write_source) {
|
||||
|
||||
if ((*chan)->write_source) {
|
||||
|
||||
if (mark_write_complete) {
|
||||
Source::Lock lock((*chan)->write_source->mutex());
|
||||
(*chan)->write_source->mark_streaming_write_completed (lock);
|
||||
(*chan)->write_source->done_with_peakfile_writes ();
|
||||
}
|
||||
|
||||
if ((*chan)->write_source->removable()) {
|
||||
(*chan)->write_source->mark_for_remove ();
|
||||
(*chan)->write_source->drop_references ();
|
||||
}
|
||||
|
||||
(*chan)->write_source.reset ();
|
||||
if (mark_write_complete) {
|
||||
Source::Lock lock((*chan)->write_source->mutex());
|
||||
(*chan)->write_source->mark_streaming_write_completed (lock);
|
||||
(*chan)->write_source->done_with_peakfile_writes ();
|
||||
}
|
||||
|
||||
use_new_write_source (DataType::AUDIO, n);
|
||||
|
||||
if (record_enabled()) {
|
||||
capturing_sources.push_back ((*chan)->write_source);
|
||||
if ((*chan)->write_source->removable()) {
|
||||
(*chan)->write_source->mark_for_remove ();
|
||||
(*chan)->write_source->drop_references ();
|
||||
}
|
||||
|
||||
} else {
|
||||
(*chan)->write_source.reset ();
|
||||
}
|
||||
|
||||
if ((*chan)->write_source == 0) {
|
||||
use_new_write_source (DataType::AUDIO, n);
|
||||
}
|
||||
use_new_write_source (DataType::AUDIO, n);
|
||||
|
||||
if (record_enabled()) {
|
||||
capturing_sources.push_back ((*chan)->write_source);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1110,17 +988,6 @@ DiskWriter::reset_write_sources (bool mark_write_complete, bool /*force*/)
|
|||
if (_playlists[DataType::MIDI]) {
|
||||
use_new_write_source (DataType::MIDI);
|
||||
}
|
||||
|
||||
if (destructive() && !c->empty ()) {
|
||||
|
||||
/* we now have all our write sources set up, so create the
|
||||
playlist's single region.
|
||||
*/
|
||||
|
||||
if (_playlists[DataType::MIDI]->empty()) {
|
||||
setup_destructive_playlist ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1161,7 +1028,7 @@ DiskWriter::use_new_write_source (DataType dt, uint32_t n)
|
|||
|
||||
try {
|
||||
if ((chan->write_source = _session.create_audio_source_for_session (
|
||||
c->size(), write_source_name(), n, destructive())) == 0) {
|
||||
c->size(), write_source_name(), n)) == 0) {
|
||||
throw failed_constructor();
|
||||
}
|
||||
}
|
||||
|
@ -1172,9 +1039,7 @@ DiskWriter::use_new_write_source (DataType dt, uint32_t n)
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* do not remove destructive files even if they are empty */
|
||||
|
||||
chan->write_source->set_allow_remove_if_empty (!destructive());
|
||||
chan->write_source->set_allow_remove_if_empty (true);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1223,10 +1088,6 @@ DiskWriter::transport_stopped_wallclock (struct tm& when, time_t twhen, bool abo
|
|||
|
||||
if (abort_capture) {
|
||||
|
||||
if (destructive()) {
|
||||
goto outout;
|
||||
}
|
||||
|
||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
|
||||
|
||||
if ((*chan)->write_source) {
|
||||
|
@ -1380,26 +1241,6 @@ DiskWriter::loop (samplepos_t transport_sample)
|
|||
_first_recordable_sample = transport_sample; // mild lie
|
||||
_last_recordable_sample = max_samplepos;
|
||||
_was_recording = true;
|
||||
|
||||
if (recordable() && destructive()) {
|
||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
|
||||
|
||||
RingBufferNPT<CaptureTransition>::rw_vector transvec;
|
||||
(*chan)->capture_transition_buf->get_write_vector(&transvec);
|
||||
|
||||
if (transvec.len[0] > 0) {
|
||||
transvec.buf[0]->type = CaptureStart;
|
||||
transvec.buf[0]->capture_val = _capture_start_sample;
|
||||
(*chan)->capture_transition_buf->increment_write_ptr(1);
|
||||
}
|
||||
else {
|
||||
// bad!
|
||||
fatal << X_("programming error: capture_transition_buf is full on rec loop! inconceivable!")
|
||||
<< endmsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Here we only keep track of the number of captured loops so monotonic
|
||||
|
@ -1414,82 +1255,6 @@ DiskWriter::loop (samplepos_t transport_sample)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
DiskWriter::setup_destructive_playlist ()
|
||||
{
|
||||
SourceList srcs;
|
||||
boost::shared_ptr<ChannelList> c = channels.reader();
|
||||
|
||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan) {
|
||||
srcs.push_back ((*chan)->write_source);
|
||||
}
|
||||
|
||||
/* a single full-sized region */
|
||||
|
||||
assert (!srcs.empty ());
|
||||
|
||||
PropertyList plist;
|
||||
plist.add (Properties::name, _name.val());
|
||||
plist.add (Properties::start, 0);
|
||||
plist.add (Properties::length, max_samplepos - srcs.front()->natural_position());
|
||||
|
||||
boost::shared_ptr<Region> region (RegionFactory::create (srcs, plist));
|
||||
_playlists[DataType::AUDIO]->add_region (region, srcs.front()->natural_position());
|
||||
|
||||
/* apply region properties and update write sources */
|
||||
use_destructive_playlist();
|
||||
}
|
||||
|
||||
void
|
||||
DiskWriter::use_destructive_playlist ()
|
||||
{
|
||||
/* this is called from the XML-based constructor or ::set_destructive. when called,
|
||||
we already have a playlist and a region, but we need to
|
||||
set up our sources for write. we use the sources associated
|
||||
with the (presumed single, full-extent) region.
|
||||
*/
|
||||
|
||||
boost::shared_ptr<Region> rp;
|
||||
{
|
||||
const RegionList& rl (_playlists[DataType::AUDIO]->region_list_property().rlist());
|
||||
if (rl.size() > 0) {
|
||||
/* this can happen when dragging a region onto a tape track */
|
||||
assert((rl.size() == 1));
|
||||
rp = rl.front();
|
||||
}
|
||||
}
|
||||
|
||||
if (!rp) {
|
||||
reset_write_sources (false, true);
|
||||
return;
|
||||
}
|
||||
|
||||
boost::shared_ptr<AudioRegion> region = boost::dynamic_pointer_cast<AudioRegion> (rp);
|
||||
|
||||
if (region == 0) {
|
||||
throw failed_constructor();
|
||||
}
|
||||
|
||||
/* be sure to stretch the region out to the maximum length (non-musical)*/
|
||||
|
||||
region->set_length (max_samplepos - region->position(), 0);
|
||||
|
||||
uint32_t n;
|
||||
ChannelList::iterator chan;
|
||||
boost::shared_ptr<ChannelList> c = channels.reader();
|
||||
|
||||
for (n = 0, chan = c->begin(); chan != c->end(); ++chan, ++n) {
|
||||
(*chan)->write_source = boost::dynamic_pointer_cast<AudioFileSource>(region->source (n));
|
||||
assert((*chan)->write_source);
|
||||
(*chan)->write_source->set_allow_remove_if_empty (false);
|
||||
|
||||
// should be set when creating the source or loading the state
|
||||
assert ((*chan)->write_source->destructive());
|
||||
}
|
||||
|
||||
/* the source list will never be reset for a destructive track */
|
||||
}
|
||||
|
||||
void
|
||||
DiskWriter::adjust_buffering ()
|
||||
{
|
||||
|
|
|
@ -248,7 +248,6 @@ setup_enum_writer ()
|
|||
|
||||
REGISTER_ENUM (Normal);
|
||||
REGISTER_ENUM (NonLayered);
|
||||
REGISTER_ENUM (Destructive);
|
||||
REGISTER (_TrackMode);
|
||||
|
||||
REGISTER_ENUM (Sustained);
|
||||
|
@ -520,7 +519,6 @@ setup_enum_writer ()
|
|||
REGISTER_CLASS_ENUM (Source, RemovableIfEmpty);
|
||||
REGISTER_CLASS_ENUM (Source, RemoveAtDestroy);
|
||||
REGISTER_CLASS_ENUM (Source, NoPeakFile);
|
||||
REGISTER_CLASS_ENUM (Source, Destructive);
|
||||
REGISTER_CLASS_ENUM (Source, Empty);
|
||||
REGISTER_BITS (_Source_Flag);
|
||||
|
||||
|
@ -544,7 +542,6 @@ setup_enum_writer ()
|
|||
|
||||
REGISTER_CLASS_ENUM (DiskIOProcessor, Recordable);
|
||||
REGISTER_CLASS_ENUM (DiskIOProcessor, Hidden);
|
||||
REGISTER_CLASS_ENUM (DiskIOProcessor, Destructive);
|
||||
REGISTER_BITS (_DiskIOProcessor_Flag);
|
||||
|
||||
REGISTER_CLASS_ENUM (Location, IsMark);
|
||||
|
|
|
@ -99,11 +99,7 @@ FileSource::existence_check ()
|
|||
void
|
||||
FileSource::prevent_deletion ()
|
||||
{
|
||||
if (!(_flags & Destructive)) {
|
||||
mark_immutable ();
|
||||
} else {
|
||||
_flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy));
|
||||
}
|
||||
mark_immutable ();
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -517,20 +513,14 @@ out:
|
|||
void
|
||||
FileSource::mark_immutable ()
|
||||
{
|
||||
/* destructive sources stay writable, and their other flags don't change. */
|
||||
if (!(_flags & Destructive)) {
|
||||
_flags = Flag (_flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
|
||||
close();
|
||||
}
|
||||
_flags = Flag (_flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
|
||||
close();
|
||||
}
|
||||
|
||||
void
|
||||
FileSource::mark_immutable_except_write ()
|
||||
{
|
||||
/* destructive sources stay writable, and their other flags don't change. */
|
||||
if (!(_flags & Destructive)) {
|
||||
_flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
|
||||
}
|
||||
_flags = Flag (_flags & ~(Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -62,7 +62,7 @@ Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs, s
|
|||
|
||||
const string path = (region->data_type() == DataType::MIDI)
|
||||
? session.new_midi_source_path (name)
|
||||
: session.new_audio_source_path (name, region->n_channels(), i, false, false);
|
||||
: session.new_audio_source_path (name, region->n_channels(), i, false);
|
||||
|
||||
if (path.empty()) {
|
||||
error << string_compose (_("filter: error creating name for new file based on %1"), region->name())
|
||||
|
|
|
@ -155,7 +155,7 @@ Session::get_paths_for_new_sources (bool /*allow_replacing*/, const string& impo
|
|||
}
|
||||
break;
|
||||
case DataType::AUDIO:
|
||||
filepath = new_audio_source_path (basename, channels, n, false, false);
|
||||
filepath = new_audio_source_path (basename, channels, n, false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ create_mono_sources_for_writing (const vector<string>& new_paths,
|
|||
|
||||
source = SourceFactory::createWritable (type, sess,
|
||||
i->c_str(),
|
||||
false, // destructive
|
||||
false,
|
||||
samplerate);
|
||||
}
|
||||
|
||||
|
|
|
@ -1049,7 +1049,7 @@ LuaAPI::Rubberband::process (luabridge::LuaRef cb)
|
|||
|
||||
for (uint32_t c = 0; c < _n_channels; ++c) {
|
||||
string name = PBD::basename_nosuffix (names[c]) + "(rb)";
|
||||
const string path = session.new_audio_source_path (name, _n_channels, c, false, false);
|
||||
const string path = session.new_audio_source_path (name, _n_channels, c, false);
|
||||
if (path.empty ()) {
|
||||
cleanup (true);
|
||||
return rv;
|
||||
|
|
|
@ -1310,7 +1310,6 @@ LuaBindings::common (lua_State* L)
|
|||
.addFunction ("empty", &Source::empty)
|
||||
.addFunction ("length", &Source::length)
|
||||
.addFunction ("natural_position", &Source::natural_position)
|
||||
.addFunction ("destructive", &Source::destructive)
|
||||
.addFunction ("writable", &Source::writable)
|
||||
.addFunction ("has_been_analysed", &Source::has_been_analysed)
|
||||
.addFunction ("can_be_analysed", &Source::can_be_analysed)
|
||||
|
@ -2032,7 +2031,6 @@ LuaBindings::common (lua_State* L)
|
|||
.beginNamespace ("TrackMode")
|
||||
.addConst ("Normal", ARDOUR::TrackMode(Start))
|
||||
.addConst ("NonLayered", ARDOUR::TrackMode(NonLayered))
|
||||
.addConst ("Destructive", ARDOUR::TrackMode(Destructive))
|
||||
.endNamespace ()
|
||||
|
||||
.beginNamespace ("TransportRequestSource")
|
||||
|
|
|
@ -68,8 +68,8 @@ MidiPlaylistSource::MidiPlaylistSource (Session& s, const XMLNode& node)
|
|||
, MidiSource (s, node)
|
||||
, PlaylistSource (s, node)
|
||||
{
|
||||
/* PlaylistSources are never writable, renameable, removable or destructive */
|
||||
_flags = Flag (_flags & ~(Writable|CanRename|Removable|RemovableIfEmpty|RemoveAtDestroy|Destructive));
|
||||
/* PlaylistSources are never writable, renameable or removable */
|
||||
_flags = Flag (_flags & ~(Writable|CanRename|Removable|RemovableIfEmpty|RemoveAtDestroy));
|
||||
|
||||
/* ancestors have already called ::set_state() in their XML-based
|
||||
constructors.
|
||||
|
|
|
@ -49,8 +49,8 @@ PlaylistSource::PlaylistSource (Session& s, const ID& orig, const std::string& n
|
|||
, _original (orig)
|
||||
, _owner (0) /* zero is never a legal ID for an object */
|
||||
{
|
||||
/* PlaylistSources are never writable, renameable, removable or destructive */
|
||||
_flags = Flag (_flags & ~(Writable|CanRename|Removable|RemovableIfEmpty|RemoveAtDestroy|Destructive));
|
||||
/* PlaylistSources are never writable, renameable or removable */
|
||||
_flags = Flag (_flags & ~(Writable|CanRename|Removable|RemovableIfEmpty|RemoveAtDestroy));
|
||||
|
||||
_playlist = p;
|
||||
_playlist->use ();
|
||||
|
@ -63,8 +63,8 @@ PlaylistSource::PlaylistSource (Session& s, const ID& orig, const std::string& n
|
|||
PlaylistSource::PlaylistSource (Session& s, const XMLNode& node)
|
||||
: Source (s, DataType::AUDIO, "toBeRenamed")
|
||||
{
|
||||
/* PlaylistSources are never writable, renameable, removable or destructive */
|
||||
_flags = Flag (_flags & ~(Writable|CanRename|Removable|RemovableIfEmpty|RemoveAtDestroy|Destructive));
|
||||
/* PlaylistSources are never writable, renameable or removable */
|
||||
_flags = Flag (_flags & ~(Writable|CanRename|Removable|RemovableIfEmpty|RemoveAtDestroy));
|
||||
|
||||
|
||||
if (set_state (node, Stateful::loading_state_version)) {
|
||||
|
|
|
@ -1730,7 +1730,7 @@ Region::source_length(uint32_t n) const
|
|||
bool
|
||||
Region::verify_length (samplecnt_t& len)
|
||||
{
|
||||
if (source() && (source()->destructive() || source()->length_mutable())) {
|
||||
if (source() && source()->length_mutable()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1748,7 +1748,7 @@ Region::verify_length (samplecnt_t& len)
|
|||
bool
|
||||
Region::verify_start_and_length (samplepos_t new_start, samplecnt_t& new_length)
|
||||
{
|
||||
if (source() && (source()->destructive() || source()->length_mutable())) {
|
||||
if (source() && source()->length_mutable()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1766,7 +1766,7 @@ Region::verify_start_and_length (samplepos_t new_start, samplecnt_t& new_length)
|
|||
bool
|
||||
Region::verify_start (samplepos_t pos)
|
||||
{
|
||||
if (source() && (source()->destructive() || source()->length_mutable())) {
|
||||
if (source() && source()->length_mutable()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1781,7 +1781,7 @@ Region::verify_start (samplepos_t pos)
|
|||
bool
|
||||
Region::verify_start_mutable (samplepos_t& new_start)
|
||||
{
|
||||
if (source() && (source()->destructive() || source()->length_mutable())) {
|
||||
if (source() && source()->length_mutable()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -278,7 +278,6 @@ Session::Session (AudioEngine &eng,
|
|||
, _adding_routes_in_progress (false)
|
||||
, _reconnecting_routes_in_progress (false)
|
||||
, _route_deletion_in_progress (false)
|
||||
, destructive_index (0)
|
||||
, _track_number_decimals(1)
|
||||
, default_fade_steepness (0)
|
||||
, default_fade_msecs (0)
|
||||
|
@ -4758,7 +4757,7 @@ Session::audio_source_name_is_unique (const string& name)
|
|||
}
|
||||
|
||||
string
|
||||
Session::format_audio_source_name (const string& legalized_base, uint32_t nchan, uint32_t chan, bool destructive, bool take_required, uint32_t cnt, bool related_exists)
|
||||
Session::format_audio_source_name (const string& legalized_base, uint32_t nchan, uint32_t chan, bool take_required, uint32_t cnt, bool related_exists)
|
||||
{
|
||||
ostringstream sstr;
|
||||
const string ext = native_header_format_extension (config.get_native_file_header_format(), DataType::AUDIO);
|
||||
|
@ -4794,7 +4793,7 @@ Session::format_audio_source_name (const string& legalized_base, uint32_t nchan,
|
|||
|
||||
/** Return a unique name based on \a base for a new internal audio source */
|
||||
string
|
||||
Session::new_audio_source_path (const string& base, uint32_t nchan, uint32_t chan, bool destructive, bool take_required)
|
||||
Session::new_audio_source_path (const string& base, uint32_t nchan, uint32_t chan, bool take_required)
|
||||
{
|
||||
uint32_t cnt;
|
||||
string possible_name;
|
||||
|
@ -4806,9 +4805,9 @@ Session::new_audio_source_path (const string& base, uint32_t nchan, uint32_t cha
|
|||
|
||||
// Find a "version" of the base name that doesn't exist in any of the possible directories.
|
||||
|
||||
for (cnt = (destructive ? ++destructive_index : 1); cnt <= limit; ++cnt) {
|
||||
for (cnt = 1; cnt <= limit; ++cnt) {
|
||||
|
||||
possible_name = format_audio_source_name (legalized, nchan, chan, destructive, take_required, cnt, some_related_source_name_exists);
|
||||
possible_name = format_audio_source_name (legalized, nchan, chan, take_required, cnt, some_related_source_name_exists);
|
||||
|
||||
if (audio_source_name_is_unique (possible_name)) {
|
||||
break;
|
||||
|
@ -4901,13 +4900,13 @@ Session::new_midi_source_path (const string& base, bool need_lock)
|
|||
|
||||
/** Create a new within-session audio source */
|
||||
boost::shared_ptr<AudioFileSource>
|
||||
Session::create_audio_source_for_session (size_t n_chans, string const & base, uint32_t chan, bool destructive)
|
||||
Session::create_audio_source_for_session (size_t n_chans, string const & base, uint32_t chan)
|
||||
{
|
||||
const string path = new_audio_source_path (base, n_chans, chan, destructive, true);
|
||||
const string path = new_audio_source_path (base, n_chans, chan, true);
|
||||
|
||||
if (!path.empty()) {
|
||||
return boost::dynamic_pointer_cast<AudioFileSource> (
|
||||
SourceFactory::createWritable (DataType::AUDIO, *this, path, destructive, sample_rate(), true, true));
|
||||
SourceFactory::createWritable (DataType::AUDIO, *this, path, sample_rate(), true, true));
|
||||
} else {
|
||||
throw failed_constructor ();
|
||||
}
|
||||
|
@ -5717,7 +5716,7 @@ Session::write_one_track (Track& track, samplepos_t start, samplepos_t end,
|
|||
|
||||
string base_name = string_compose ("%1-%2-bounce", playlist->name(), chan_n);
|
||||
string path = ((data_type == DataType::AUDIO)
|
||||
? new_audio_source_path (legal_playlist_name, diskstream_channels.n_audio(), chan_n, false, true)
|
||||
? new_audio_source_path (legal_playlist_name, diskstream_channels.n_audio(), chan_n, true)
|
||||
: new_midi_source_path (legal_playlist_name));
|
||||
|
||||
if (path.empty()) {
|
||||
|
|
|
@ -278,7 +278,6 @@ Session::post_engine_init ()
|
|||
|
||||
/* crossfades require sample rate knowledge */
|
||||
|
||||
SndFileSource::setup_standard_crossfades (*this, sample_rate());
|
||||
_engine.GraphReordered.connect_same_thread (*this, boost::bind (&Session::graph_reordered, this, true));
|
||||
_engine.MidiSelectionPortsChanged.connect_same_thread (*this, boost::bind (&Session::rewire_midi_selection_ports, this));
|
||||
|
||||
|
@ -1283,7 +1282,7 @@ Session::state (bool save_template, snapshot_t snapshot_type, bool only_used_ass
|
|||
for (SourceMap::iterator siter = sources.begin(); siter != sources.end(); ++siter) {
|
||||
|
||||
/* Don't save information about non-file Sources, or
|
||||
* about non-destructive file sources that are empty
|
||||
* about file sources that are empty
|
||||
* and unused by any regions.
|
||||
*/
|
||||
boost::shared_ptr<FileSource> fs;
|
||||
|
@ -1292,10 +1291,8 @@ Session::state (bool save_template, snapshot_t snapshot_type, bool only_used_ass
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!fs->destructive()) {
|
||||
if (fs->empty() && !fs->used()) {
|
||||
continue;
|
||||
}
|
||||
if (fs->empty() && !fs->used()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (only_used_assets) {
|
||||
|
@ -2483,7 +2480,7 @@ retry:
|
|||
return -1;
|
||||
}
|
||||
/* Note that we do not announce the source just yet - we need to reset its ID before we do that */
|
||||
source = SourceFactory::createWritable (DataType::MIDI, *this, fullpath, false, _current_sample_rate, false, false);
|
||||
source = SourceFactory::createWritable (DataType::MIDI, *this, fullpath, _current_sample_rate, false, false);
|
||||
/* reset ID to match the missing one */
|
||||
source->set_id (**niter);
|
||||
/* Now we can announce it */
|
||||
|
|
|
@ -54,9 +54,6 @@ using namespace ARDOUR;
|
|||
using namespace PBD;
|
||||
using std::string;
|
||||
|
||||
gain_t* SndFileSource::out_coefficient = 0;
|
||||
gain_t* SndFileSource::in_coefficient = 0;
|
||||
samplecnt_t SndFileSource::xfade_samples = 64;
|
||||
const Source::Flag SndFileSource::default_writable_flags = Source::Flag (
|
||||
Source::Writable |
|
||||
Source::Removable |
|
||||
|
@ -68,10 +65,6 @@ SndFileSource::SndFileSource (Session& s, const XMLNode& node)
|
|||
, AudioFileSource (s, node)
|
||||
, _sndfile (0)
|
||||
, _broadcast_info (0)
|
||||
, _capture_start (false)
|
||||
, _capture_end (false)
|
||||
, file_pos (0)
|
||||
, xfade_buf (0)
|
||||
{
|
||||
init_sndfile ();
|
||||
|
||||
|
@ -92,10 +85,6 @@ SndFileSource::SndFileSource (Session& s, const string& path, int chn, Flag flag
|
|||
, AudioFileSource (s, path, Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy)))
|
||||
, _sndfile (0)
|
||||
, _broadcast_info (0)
|
||||
, _capture_start (false)
|
||||
, _capture_end (false)
|
||||
, file_pos (0)
|
||||
, xfade_buf (0)
|
||||
{
|
||||
_channel = chn;
|
||||
|
||||
|
@ -118,10 +107,6 @@ SndFileSource::SndFileSource (Session& s, const string& path, const string& orig
|
|||
, AudioFileSource (s, path, origin, flags, sfmt, hf)
|
||||
, _sndfile (0)
|
||||
, _broadcast_info (0)
|
||||
, _capture_start (false)
|
||||
, _capture_end (false)
|
||||
, file_pos (0)
|
||||
, xfade_buf (0)
|
||||
{
|
||||
int fmt = 0;
|
||||
|
||||
|
@ -144,7 +129,6 @@ SndFileSource::SndFileSource (Session& s, const string& path, const string& orig
|
|||
sfmt = FormatInt24;
|
||||
}
|
||||
_flags = Flag (_flags & ~Broadcast);
|
||||
_flags = Flag (_flags & ~Destructive); // XXX or force WAV if destructive?
|
||||
break;
|
||||
|
||||
case AIFF:
|
||||
|
@ -209,14 +193,8 @@ SndFileSource::SndFileSource (Session& s, const string& path, const string& orig
|
|||
_info.samplerate = rate;
|
||||
_info.format = fmt;
|
||||
|
||||
if (_flags & Destructive) {
|
||||
if (open()) {
|
||||
throw failed_constructor();
|
||||
}
|
||||
} else {
|
||||
/* normal mode: do not open the file here - do that in {read,write}_unlocked() as needed
|
||||
*/
|
||||
}
|
||||
/* normal mode: do not open the file here - do that in {read,write}_unlocked() as needed
|
||||
*/
|
||||
}
|
||||
|
||||
/** Constructor to be called for recovering files being used for
|
||||
|
@ -230,10 +208,6 @@ SndFileSource::SndFileSource (Session& s, const string& path, int chn)
|
|||
, AudioFileSource (s, path, Flag (0))
|
||||
, _sndfile (0)
|
||||
, _broadcast_info (0)
|
||||
, _capture_start (false)
|
||||
, _capture_end (false)
|
||||
, file_pos (0)
|
||||
, xfade_buf (0)
|
||||
{
|
||||
_channel = chn;
|
||||
|
||||
|
@ -253,10 +227,6 @@ SndFileSource::SndFileSource (Session& s, const AudioFileSource& other, const st
|
|||
, AudioFileSource (s, path, "", Flag ((other.flags () | default_writable_flags | NoPeakFile) & ~RF64_RIFF), /*unused*/ FormatFloat, /*unused*/ WAVE64)
|
||||
, _sndfile (0)
|
||||
, _broadcast_info (0)
|
||||
, _capture_start (false)
|
||||
, _capture_end (false)
|
||||
, file_pos (0)
|
||||
, xfade_buf (0)
|
||||
{
|
||||
if (other.readable_length () == 0) {
|
||||
throw failed_constructor();
|
||||
|
@ -353,11 +323,6 @@ SndFileSource::init_sndfile ()
|
|||
|
||||
memset (&_info, 0, sizeof(_info));
|
||||
|
||||
if (destructive()) {
|
||||
xfade_buf = new Sample[xfade_samples];
|
||||
_natural_position = header_position_offset;
|
||||
}
|
||||
|
||||
AudioFileSource::HeaderPositionOffsetChanged.connect_same_thread (header_position_connection, boost::bind (&SndFileSource::handle_header_position_change, this));
|
||||
}
|
||||
|
||||
|
@ -398,7 +363,6 @@ SndFileSource::open ()
|
|||
}
|
||||
|
||||
if ((_info.format & SF_FORMAT_TYPEMASK ) == SF_FORMAT_FLAC) {
|
||||
assert (!destructive());
|
||||
_sndfile = sf_open_fd (fd, writable () ? SFM_WRITE : SFM_READ, &_info, true);
|
||||
} else {
|
||||
_sndfile = sf_open_fd (fd, writable() ? SFM_RDWR : SFM_READ, &_info, true);
|
||||
|
@ -445,16 +409,9 @@ SndFileSource::open ()
|
|||
header_position_offset = _natural_position;
|
||||
}
|
||||
|
||||
if (destructive()) {
|
||||
/* Set our timeline position to either the time reference from a BWF header or the current
|
||||
start of the session.
|
||||
*/
|
||||
set_natural_position (bwf_info_exists ? _broadcast_info->get_time_reference() : header_position_offset);
|
||||
} else {
|
||||
/* If a BWF header exists, set our _natural_position from it */
|
||||
if (bwf_info_exists) {
|
||||
set_natural_position (_broadcast_info->get_time_reference());
|
||||
}
|
||||
/* If a BWF header exists, set our _natural_position from it */
|
||||
if (bwf_info_exists) {
|
||||
set_natural_position (_broadcast_info->get_time_reference());
|
||||
}
|
||||
|
||||
if (_length != 0 && !bwf_info_exists) {
|
||||
|
@ -501,7 +458,6 @@ SndFileSource::~SndFileSource ()
|
|||
{
|
||||
close ();
|
||||
delete _broadcast_info;
|
||||
delete [] xfade_buf;
|
||||
}
|
||||
|
||||
float
|
||||
|
@ -614,11 +570,7 @@ SndFileSource::write_unlocked (Sample *data, samplecnt_t cnt)
|
|||
return 0; // failure
|
||||
}
|
||||
|
||||
if (destructive()) {
|
||||
return destructive_write_unlocked (data, cnt);
|
||||
} else {
|
||||
return nondestructive_write_unlocked (data, cnt);
|
||||
}
|
||||
return nondestructive_write_unlocked (data, cnt);
|
||||
}
|
||||
|
||||
samplecnt_t
|
||||
|
@ -650,95 +602,6 @@ SndFileSource::nondestructive_write_unlocked (Sample *data, samplecnt_t cnt)
|
|||
return cnt;
|
||||
}
|
||||
|
||||
samplecnt_t
|
||||
SndFileSource::destructive_write_unlocked (Sample* data, samplecnt_t cnt)
|
||||
{
|
||||
if (!writable()) {
|
||||
warning << string_compose (_("attempt to write a non-writable audio file source (%1)"), _path) << endmsg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (_capture_start && _capture_end) {
|
||||
|
||||
/* start and end of capture both occur within the data we are writing,
|
||||
so do both crossfades.
|
||||
*/
|
||||
|
||||
_capture_start = false;
|
||||
_capture_end = false;
|
||||
|
||||
/* move to the correct location place */
|
||||
file_pos = capture_start_sample - _natural_position;
|
||||
|
||||
// split cnt in half
|
||||
samplecnt_t subcnt = cnt / 2;
|
||||
samplecnt_t ofilepos = file_pos;
|
||||
|
||||
// fade in
|
||||
if (crossfade (data, subcnt, 1) != subcnt) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
file_pos += subcnt;
|
||||
Sample * tmpdata = data + subcnt;
|
||||
|
||||
// fade out
|
||||
subcnt = cnt - subcnt;
|
||||
if (crossfade (tmpdata, subcnt, 0) != subcnt) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
file_pos = ofilepos; // adjusted below
|
||||
|
||||
} else if (_capture_start) {
|
||||
|
||||
/* start of capture both occur within the data we are writing,
|
||||
so do the fade in
|
||||
*/
|
||||
|
||||
_capture_start = false;
|
||||
_capture_end = false;
|
||||
|
||||
/* move to the correct location place */
|
||||
file_pos = capture_start_sample - _natural_position;
|
||||
|
||||
if (crossfade (data, cnt, 1) != cnt) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
} else if (_capture_end) {
|
||||
|
||||
/* end of capture both occur within the data we are writing,
|
||||
so do the fade out
|
||||
*/
|
||||
|
||||
_capture_start = false;
|
||||
_capture_end = false;
|
||||
|
||||
if (crossfade (data, cnt, 0) != cnt) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/* in the middle of recording */
|
||||
|
||||
if (write_float (data, file_pos, cnt) != cnt) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
update_length (file_pos + cnt);
|
||||
|
||||
if (_build_peakfiles) {
|
||||
compute_and_write_peaks (data, file_pos, cnt, true, true);
|
||||
}
|
||||
|
||||
file_pos += cnt;
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
int
|
||||
SndFileSource::update_header (samplepos_t when, struct tm& now, time_t tnow)
|
||||
{
|
||||
|
@ -855,210 +718,10 @@ SndFileSource::write_float (Sample* data, samplepos_t sample_pos, samplecnt_t cn
|
|||
return cnt;
|
||||
}
|
||||
|
||||
void
|
||||
SndFileSource::clear_capture_marks ()
|
||||
{
|
||||
_capture_start = false;
|
||||
_capture_end = false;
|
||||
}
|
||||
|
||||
/** @param pos Capture start position in session samples */
|
||||
void
|
||||
SndFileSource::mark_capture_start (samplepos_t pos)
|
||||
{
|
||||
if (destructive()) {
|
||||
if (pos < _natural_position) {
|
||||
_capture_start = false;
|
||||
} else {
|
||||
_capture_start = true;
|
||||
capture_start_sample = pos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SndFileSource::mark_capture_end()
|
||||
{
|
||||
if (destructive()) {
|
||||
_capture_end = true;
|
||||
}
|
||||
}
|
||||
|
||||
samplecnt_t
|
||||
SndFileSource::crossfade (Sample* data, samplecnt_t cnt, int fade_in)
|
||||
{
|
||||
samplecnt_t xfade = min (xfade_samples, cnt);
|
||||
samplecnt_t nofade = cnt - xfade;
|
||||
Sample* fade_data = 0;
|
||||
samplepos_t fade_position = 0; // in samples
|
||||
ssize_t retval;
|
||||
samplecnt_t file_cnt;
|
||||
|
||||
if (fade_in) {
|
||||
fade_position = file_pos;
|
||||
fade_data = data;
|
||||
} else {
|
||||
fade_position = file_pos + nofade;
|
||||
fade_data = data + nofade;
|
||||
}
|
||||
|
||||
if (fade_position > _length) {
|
||||
|
||||
/* read starts beyond end of data, just memset to zero */
|
||||
|
||||
file_cnt = 0;
|
||||
|
||||
} else if (fade_position + xfade > _length) {
|
||||
|
||||
/* read ends beyond end of data, read some, memset the rest */
|
||||
|
||||
file_cnt = _length - fade_position;
|
||||
|
||||
} else {
|
||||
|
||||
/* read is entirely within data */
|
||||
|
||||
file_cnt = xfade;
|
||||
}
|
||||
|
||||
if (file_cnt) {
|
||||
|
||||
if ((retval = read_unlocked (xfade_buf, fade_position, file_cnt)) != (ssize_t) file_cnt) {
|
||||
if (retval >= 0 && errno == EAGAIN) {
|
||||
/* XXX - can we really trust that errno is meaningful here? yes POSIX, i'm talking to you.
|
||||
* short or no data there */
|
||||
memset (xfade_buf, 0, xfade * sizeof(Sample));
|
||||
} else {
|
||||
error << string_compose(_("SndFileSource: \"%1\" bad read retval: %2 of %5 (%3: %4)"), _path, retval, errno, strerror (errno), xfade) << endmsg;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (file_cnt != xfade) {
|
||||
samplecnt_t delta = xfade - file_cnt;
|
||||
memset (xfade_buf+file_cnt, 0, sizeof (Sample) * delta);
|
||||
}
|
||||
|
||||
if (nofade && !fade_in) {
|
||||
if (write_float (data, file_pos, nofade) != nofade) {
|
||||
error << string_compose(_("SndFileSource: \"%1\" bad write (%2)"), _path, strerror (errno)) << endmsg;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (xfade == xfade_samples) {
|
||||
|
||||
samplecnt_t n;
|
||||
|
||||
/* use the standard xfade curve */
|
||||
|
||||
if (fade_in) {
|
||||
|
||||
/* fade new material in */
|
||||
|
||||
for (n = 0; n < xfade; ++n) {
|
||||
xfade_buf[n] = (xfade_buf[n] * out_coefficient[n]) + (fade_data[n] * in_coefficient[n]);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
/* fade new material out */
|
||||
|
||||
for (n = 0; n < xfade; ++n) {
|
||||
xfade_buf[n] = (xfade_buf[n] * in_coefficient[n]) + (fade_data[n] * out_coefficient[n]);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (xfade < xfade_samples) {
|
||||
|
||||
std::vector<gain_t> in(xfade);
|
||||
std::vector<gain_t> out(xfade);
|
||||
|
||||
/* short xfade, compute custom curve */
|
||||
|
||||
compute_equal_power_fades (xfade, &in[0], &out[0]);
|
||||
|
||||
for (samplecnt_t n = 0; n < xfade; ++n) {
|
||||
xfade_buf[n] = (xfade_buf[n] * out[n]) + (fade_data[n] * in[n]);
|
||||
}
|
||||
|
||||
} else if (xfade) {
|
||||
|
||||
/* long xfade length, has to be computed across several calls */
|
||||
|
||||
}
|
||||
|
||||
if (xfade) {
|
||||
if (write_float (xfade_buf, fade_position, xfade) != xfade) {
|
||||
error << string_compose(_("SndFileSource: \"%1\" bad write (%2)"), _path, strerror (errno)) << endmsg;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (fade_in && nofade) {
|
||||
if (write_float (data + xfade, file_pos + xfade, nofade) != nofade) {
|
||||
error << string_compose(_("SndFileSource: \"%1\" bad write (%2)"), _path, strerror (errno)) << endmsg;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
samplepos_t
|
||||
SndFileSource::last_capture_start_sample () const
|
||||
{
|
||||
if (destructive()) {
|
||||
return capture_start_sample;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SndFileSource::handle_header_position_change ()
|
||||
{
|
||||
if (destructive()) {
|
||||
if ( _length != 0 ) {
|
||||
error << string_compose(_("Filesource: start time is already set for existing file (%1): Cannot change start time."), _path ) << endmsg;
|
||||
//in the future, pop up a dialog here that allows user to regenerate file with new start offset
|
||||
} else if (writable()) {
|
||||
_natural_position = header_position_offset;
|
||||
set_header_natural_position (); //this will get flushed if/when the file is recorded to
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SndFileSource::setup_standard_crossfades (Session const & s, samplecnt_t rate)
|
||||
{
|
||||
/* This static method is assumed to have been called by the Session
|
||||
before any DFS's are created.
|
||||
*/
|
||||
|
||||
xfade_samples = (samplecnt_t) floor ((s.config.get_destructive_xfade_msecs () / 1000.0) * rate);
|
||||
|
||||
delete [] out_coefficient;
|
||||
delete [] in_coefficient;
|
||||
|
||||
out_coefficient = new gain_t[xfade_samples];
|
||||
in_coefficient = new gain_t[xfade_samples];
|
||||
|
||||
compute_equal_power_fades (xfade_samples, in_coefficient, out_coefficient);
|
||||
}
|
||||
|
||||
void
|
||||
SndFileSource::set_natural_position (samplepos_t pos)
|
||||
{
|
||||
// destructive track timeline postion does not change
|
||||
// except at instantion or when header_position_offset
|
||||
// (session start) changes
|
||||
|
||||
if (!destructive()) {
|
||||
AudioFileSource::set_natural_position (pos);
|
||||
}
|
||||
AudioFileSource::set_natural_position (pos);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -173,7 +173,7 @@ Source::set_state (const XMLNode& node, int version)
|
|||
|
||||
/* old style, from the period when we had DestructiveFileSource */
|
||||
if (node.get_property (X_("destructive"), str)) {
|
||||
_flags = Flag (_flags | Destructive);
|
||||
throw (SessionException (_("This session uses destructive tracks, which are no longer supported. Please use an older version of Ardour to work with this session")));
|
||||
}
|
||||
|
||||
if (version < 3000) {
|
||||
|
@ -181,9 +181,7 @@ Source::set_state (const XMLNode& node, int version)
|
|||
and therefore cannot be removable/writable etc. etc.; 2.X
|
||||
sometimes marks sources as removable which shouldn't be.
|
||||
*/
|
||||
if (!(_flags & Destructive)) {
|
||||
_flags = Flag (_flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
|
||||
}
|
||||
_flags = Flag (_flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy|CanRename));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -280,15 +278,11 @@ Source::check_for_analysis_data_on_disk ()
|
|||
void
|
||||
Source::mark_for_remove ()
|
||||
{
|
||||
// This operation is not allowed for sources for destructive tracks or out-of-session files.
|
||||
// This operation is not allowed for sources for out-of-session files.
|
||||
|
||||
/* XXX need a way to detect _within_session() condition here - move it from FileSource?
|
||||
*/
|
||||
|
||||
if ((_flags & Destructive)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_flags = Flag (_flags | Removable | RemoveAtDestroy);
|
||||
}
|
||||
|
||||
|
|
|
@ -233,56 +233,47 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path,
|
|||
{
|
||||
if (type == DataType::AUDIO) {
|
||||
|
||||
if (!(flags & Destructive)) {
|
||||
|
||||
try {
|
||||
Source* src = new SndFileSource (s, path, chn, flags);
|
||||
boost::shared_ptr<Source> ret (src);
|
||||
BOOST_MARK_SOURCE (ret);
|
||||
if (setup_peakfile (ret, defer_peaks)) {
|
||||
return boost::shared_ptr<Source>();
|
||||
}
|
||||
ret->check_for_analysis_data_on_disk ();
|
||||
if (announce) {
|
||||
SourceCreated (ret);
|
||||
}
|
||||
return ret;
|
||||
} catch (failed_constructor& err) { }
|
||||
try {
|
||||
Source* src = new SndFileSource (s, path, chn, flags);
|
||||
boost::shared_ptr<Source> ret (src);
|
||||
BOOST_MARK_SOURCE (ret);
|
||||
if (setup_peakfile (ret, defer_peaks)) {
|
||||
return boost::shared_ptr<Source>();
|
||||
}
|
||||
ret->check_for_analysis_data_on_disk ();
|
||||
if (announce) {
|
||||
SourceCreated (ret);
|
||||
}
|
||||
return ret;
|
||||
} catch (failed_constructor& err) { }
|
||||
|
||||
#ifdef HAVE_COREAUDIO
|
||||
try {
|
||||
Source* src = new CoreAudioSource (s, path, chn, flags);
|
||||
boost::shared_ptr<Source> ret (src);
|
||||
BOOST_MARK_SOURCE (ret);
|
||||
if (setup_peakfile (ret, defer_peaks)) {
|
||||
return boost::shared_ptr<Source>();
|
||||
}
|
||||
ret->check_for_analysis_data_on_disk ();
|
||||
if (announce) {
|
||||
SourceCreated (ret);
|
||||
}
|
||||
return ret;
|
||||
} catch (...) { }
|
||||
try {
|
||||
Source* src = new CoreAudioSource (s, path, chn, flags);
|
||||
boost::shared_ptr<Source> ret (src);
|
||||
BOOST_MARK_SOURCE (ret);
|
||||
if (setup_peakfile (ret, defer_peaks)) {
|
||||
return boost::shared_ptr<Source>();
|
||||
}
|
||||
ret->check_for_analysis_data_on_disk ();
|
||||
if (announce) {
|
||||
SourceCreated (ret);
|
||||
}
|
||||
return ret;
|
||||
} catch (...) { }
|
||||
#endif
|
||||
|
||||
/* only create mp3s for audition: no announce, no peaks */
|
||||
if (!announce && (!AudioFileSource::get_build_peakfiles () || defer_peaks)) {
|
||||
try {
|
||||
Source* src = new Mp3FileSource (s, path, chn, flags);
|
||||
boost::shared_ptr<Source> ret (src);
|
||||
BOOST_MARK_SOURCE (ret);
|
||||
return ret;
|
||||
/* only create mp3s for audition: no announce, no peaks */
|
||||
if (!announce && (!AudioFileSource::get_build_peakfiles () || defer_peaks)) {
|
||||
try {
|
||||
Source* src = new Mp3FileSource (s, path, chn, flags);
|
||||
boost::shared_ptr<Source> ret (src);
|
||||
BOOST_MARK_SOURCE (ret);
|
||||
return ret;
|
||||
|
||||
} catch (failed_constructor& err) { }
|
||||
}
|
||||
|
||||
} else {
|
||||
// eh?
|
||||
} catch (failed_constructor& err) { }
|
||||
}
|
||||
|
||||
error << string_compose(_("AudioFileSource: cannot open file \"%1\" "), path) << endmsg;
|
||||
throw failed_constructor ();
|
||||
|
||||
} else if (type == DataType::MIDI) {
|
||||
|
||||
try {
|
||||
|
@ -306,7 +297,7 @@ SourceFactory::createExternal (DataType type, Session& s, const string& path,
|
|||
|
||||
boost::shared_ptr<Source>
|
||||
SourceFactory::createWritable (DataType type, Session& s, const std::string& path,
|
||||
bool destructive, samplecnt_t rate, bool announce, bool defer_peaks)
|
||||
samplecnt_t rate, bool announce, bool defer_peaks)
|
||||
{
|
||||
/* this might throw failed_constructor(), which is OK */
|
||||
|
||||
|
@ -315,9 +306,7 @@ SourceFactory::createWritable (DataType type, Session& s, const std::string& pat
|
|||
s.config.get_native_file_data_format(),
|
||||
s.config.get_native_file_header_format(),
|
||||
rate,
|
||||
(destructive
|
||||
? Source::Flag (SndFileSource::default_writable_flags | Source::Destructive)
|
||||
: SndFileSource::default_writable_flags));
|
||||
SndFileSource::default_writable_flags);
|
||||
boost::shared_ptr<Source> ret (src);
|
||||
BOOST_MARK_SOURCE (ret);
|
||||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
<Port name="Scene out" direction="output"/>
|
||||
</MIDIPorts>
|
||||
<Config>
|
||||
<Option name="destructive-xfade-msecs" value="2"/>
|
||||
<Option name="use-region-fades" value="1"/>
|
||||
<Option name="use-transport-fades" value="1"/>
|
||||
<Option name="use-monitor-fades" value="1"/>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<Option name="xfade-choice" value="ConstantPowerMinus3dB"/>
|
||||
<Option name="auto-xfade" value="1"/>
|
||||
<Option name="short-xfade-seconds" value="0.015"/>
|
||||
<Option name="destructive-xfade-msecs" value="2"/>
|
||||
<Option name="use-region-fades" value="1"/>
|
||||
<Option name="show-region-fades" value="1"/>
|
||||
<Option name="native-file-data-format" value="FormatFloat"/>
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<Option name="short-xfade-seconds" value="0.015"/>
|
||||
<Option name="xfades-active" value="1"/>
|
||||
<Option name="xfades-visible" value="1"/>
|
||||
<Option name="destructive-xfade-msecs" value="2"/>
|
||||
<Option name="use-region-fades" value="1"/>
|
||||
<Option name="show-region-fades" value="1"/>
|
||||
<Option name="native-file-data-format" value="FormatFloat"/>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<Option name="xfade-choice" value="ConstantPowerMinus3dB"/>
|
||||
<Option name="auto-xfade" value="1"/>
|
||||
<Option name="short-xfade-seconds" value="0.015"/>
|
||||
<Option name="destructive-xfade-msecs" value="2"/>
|
||||
<Option name="use-region-fades" value="1"/>
|
||||
<Option name="show-region-fades" value="1"/>
|
||||
<Option name="native-file-data-format" value="FormatFloat"/>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<Option name="xfade-choice" value="ConstantPowerMinus3dB"/>
|
||||
<Option name="auto-xfade" value="1"/>
|
||||
<Option name="short-xfade-seconds" value="0.015"/>
|
||||
<Option name="destructive-xfade-msecs" value="2"/>
|
||||
<Option name="use-region-fades" value="1"/>
|
||||
<Option name="show-region-fades" value="1"/>
|
||||
<Option name="native-file-data-format" value="FormatFloat"/>
|
||||
|
|
|
@ -92,10 +92,6 @@ Track::init ()
|
|||
|
||||
DiskIOProcessor::Flag dflags = DiskIOProcessor::Recordable;
|
||||
|
||||
if (_mode == Destructive) {
|
||||
dflags = DiskIOProcessor::Flag (dflags | DiskIOProcessor::Destructive);
|
||||
}
|
||||
|
||||
_disk_reader.reset (new DiskReader (_session, name(), dflags));
|
||||
_disk_reader->set_block_size (_session.get_block_size ());
|
||||
_disk_reader->set_track (boost::dynamic_pointer_cast<Track> (shared_from_this()));
|
||||
|
@ -468,12 +464,6 @@ Track::ensure_input_monitoring (bool m)
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
Track::destructive () const
|
||||
{
|
||||
return _disk_writer->destructive ();
|
||||
}
|
||||
|
||||
list<boost::shared_ptr<Source> > &
|
||||
Track::last_capture_sources ()
|
||||
{
|
||||
|
@ -1040,20 +1030,6 @@ Track::use_captured_audio_sources (SourceList& srcs, CaptureInfos const & captur
|
|||
return;
|
||||
}
|
||||
|
||||
/* destructive tracks have a single, never changing region */
|
||||
|
||||
if (destructive()) {
|
||||
|
||||
/* send a signal that any UI can pick up to do the right thing. there is
|
||||
a small problem here in that a UI may need the peak data to be ready
|
||||
for the data that was recorded and this isn't interlocked with that
|
||||
process. this problem is deferred to the UI.
|
||||
*/
|
||||
|
||||
pl->LayeringChanged(); // XXX this may not get the UI to do the right thing
|
||||
return;
|
||||
}
|
||||
|
||||
string whole_file_region_name;
|
||||
whole_file_region_name = region_name_from_path (afs->name(), true);
|
||||
|
||||
|
|
|
@ -514,73 +514,6 @@ static void icon_rec_enable (cairo_t *cr, const int width, const int height, con
|
|||
cairo_stroke (cr);
|
||||
}
|
||||
|
||||
/** tape-mode, "reel" */
|
||||
static void icon_rec_tape (cairo_t *cr, const int width, const int height, const Gtkmm2ext::ActiveState state)
|
||||
{
|
||||
const double x = width * .5;
|
||||
const double y = height * .5;
|
||||
const double r = std::min (x, y) * .6;
|
||||
const double slit = .11 * M_PI;
|
||||
cairo_translate (cr, x, y);
|
||||
|
||||
cairo_arc (cr, 0, 0, r, 0, 2 * M_PI);
|
||||
if (state == Gtkmm2ext::ExplicitActive) {
|
||||
cairo_set_source_rgba (cr, 1.0, .1, .1, 1.0);
|
||||
}
|
||||
else if (state == Gtkmm2ext::ImplicitActive) {
|
||||
cairo_set_source_rgba (cr, .9, .3, .3, 1.0);
|
||||
}
|
||||
else {
|
||||
cairo_set_source_rgba (cr, .4, .3, .3, 1.0);
|
||||
}
|
||||
cairo_fill_preserve (cr);
|
||||
cairo_set_source_rgba (cr, .0, .0, .0, .5);
|
||||
cairo_set_line_width (cr, 1);
|
||||
cairo_stroke (cr);
|
||||
|
||||
cairo_save (cr);
|
||||
cairo_set_source_rgba (cr, .15, .07, .07, 1.0);
|
||||
|
||||
cairo_rotate (cr, -.5 * M_PI);
|
||||
cairo_move_to (cr, 0, 0);
|
||||
cairo_arc (cr, 0, 0, r *.85, -slit, slit);
|
||||
cairo_line_to (cr, 0, 0);
|
||||
cairo_close_path (cr);
|
||||
|
||||
cairo_fill (cr);
|
||||
cairo_rotate (cr, 2. * M_PI / 3.);
|
||||
|
||||
cairo_move_to (cr, 0, 0);
|
||||
cairo_arc (cr, 0, 0, r *.85, -slit, slit);
|
||||
cairo_line_to (cr, 0, 0);
|
||||
cairo_close_path (cr);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_rotate (cr, 2. * M_PI / 3.);
|
||||
cairo_move_to (cr, 0, 0);
|
||||
cairo_arc (cr, 0, 0, r *.85, -slit, slit);
|
||||
cairo_line_to (cr, 0, 0);
|
||||
cairo_close_path (cr);
|
||||
cairo_fill (cr);
|
||||
|
||||
cairo_restore (cr);
|
||||
|
||||
cairo_arc (cr, 0, 0, r * .3, 0, 2 * M_PI);
|
||||
if (state == Gtkmm2ext::ExplicitActive) {
|
||||
cairo_set_source_rgba (cr, 1.0, .1, .1, 1.0);
|
||||
}
|
||||
else if (state == Gtkmm2ext::ImplicitActive) {
|
||||
cairo_set_source_rgba (cr, .9, .3, .3, 1.0);
|
||||
}
|
||||
else {
|
||||
cairo_set_source_rgba (cr, .4, .3, .3, 1.0);
|
||||
}
|
||||
cairo_fill (cr);
|
||||
cairo_set_source_rgba (cr, .0, .0, .0, 1.0);
|
||||
cairo_arc (cr, 0, 0, r *.15, 0, 2 * M_PI); // hole in the middle
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* Transport buttons, foreground is always white
|
||||
*/
|
||||
|
@ -1340,9 +1273,6 @@ ArdourWidgets::ArdourIcon::render (cairo_t *cr,
|
|||
case TransportRange:
|
||||
icon_transport_ck (cr, icon, width, height);
|
||||
break;
|
||||
case RecTapeMode:
|
||||
icon_rec_tape (cr, width, height, state);
|
||||
break;
|
||||
case RecButton:
|
||||
icon_rec_enable (cr, width, height, state);
|
||||
break;
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
namespace ArdourWidgets { namespace ArdourIcon {
|
||||
enum Icon {
|
||||
RecButton,
|
||||
RecTapeMode,
|
||||
TransportPanic,
|
||||
TransportStop,
|
||||
TransportPlay,
|
||||
|
|
|
@ -205,7 +205,6 @@ main (int argc, char** argv)
|
|||
int pos = 0;
|
||||
|
||||
draw_icon (cr, pos++, ArdourIcon::RecButton, Gtkmm2ext::Off);
|
||||
draw_icon (cr, pos++, ArdourIcon::RecTapeMode, Gtkmm2ext::Off);
|
||||
draw_icon (cr, pos++, ArdourIcon::RecButton, Gtkmm2ext::ImplicitActive);
|
||||
draw_icon (cr, pos++, ArdourIcon::RecTapeMode, Gtkmm2ext::ImplicitActive);
|
||||
|
||||
|
|
Loading…
Reference in New Issue