miscellaneous fixes post-jesse's 24 bit file format changes

git-svn-id: svn://localhost/trunk/ardour2@317 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-02-11 02:34:03 +00:00
parent 9ab70fb552
commit cf0da62ff0
25 changed files with 442 additions and 164 deletions

View file

@ -163,6 +163,7 @@ selection.cc
sfdb_ui.cc sfdb_ui.cc
send_ui.cc send_ui.cc
streamview.cc streamview.cc
taperegionview.cc
tempo_dialog.cc tempo_dialog.cc
time_axis_view.cc time_axis_view.cc
time_axis_view_item.cc time_axis_view_item.cc

View file

@ -8,11 +8,11 @@ export ARDOUR_BINDINGS=./ardour.bindings
if [ -x ./ardour.bin ] ; then if [ -x ./ardour.bin ] ; then
# scons executable # scons executable
export LD_LIBRARY_PATH=../libs/ardour export LD_LIBRARY_PATH=../libs/ardour:$LD_LIBRARY_PATH
exec gdb ./ardour.bin exec gdb ./ardour.bin
else else
# autofoo/make executable # autofoo/make executable
export LD_LIBRARY_PATH=../libs/ardour/.libs export LD_LIBRARY_PATH=../libs/ardour/.libs:$LD_LIBRARY_PATH
exec gdb ./ardour exec gdb ./ardour
fi fi

View file

@ -117,6 +117,134 @@ ARDOUR_UI::setup_adjustables ()
adjuster_table.attach (*mmc_id_button, 2, 3, 1, 2, FILL, FILL, 5, 5); adjuster_table.attach (*mmc_id_button, 2, 3, 1, 2, FILL, FILL, 5, 5);
} }
#define NEW_LOOP_XPM
#ifdef NEW_LOOP_XPM
/* XPM */
static const gchar * loop_xpm[] = {
"17 25 94 2",
" c None",
". c #4C4C4C",
"+ c #555555",
"@ c #454545",
"# c #242424",
"$ c #5E5E5E",
"% c #000000",
"& c #6B6B6B",
"* c #484848",
"= c #4E4E4E",
"- c #6A6A6A",
"; c #717171",
"> c #686868",
", c #838383",
"' c #888888",
") c #676767",
"! c #4A4A4A",
"~ c #474747",
"{ c #939393",
"] c #949494",
"^ c #9E9E9E",
"/ c #4B4B4B",
"( c #A1A1A1",
"_ c #A0A0A0",
": c #A5A5A5",
"< c #B2B2B2",
"[ c #646464",
"} c #ADADAD",
"| c #AAAAAA",
"1 c #B1B1B1",
"2 c #494949",
"3 c #9A9A9A",
"4 c #A2A2A2",
"5 c #A7A7A7",
"6 c #A8A8A8",
"7 c #C1C1C1",
"8 c #696969",
"9 c #656565",
"0 c #B6B6B6",
"a c #404040",
"b c #989898",
"c c #9D9D9D",
"d c #999999",
"e c #A3A3A3",
"f c #C4C4C4",
"g c #707070",
"h c #C2C2C2",
"i c #9C9C9C",
"j c #969696",
"k c #A4A4A4",
"l c #777777",
"m c #979797",
"n c #2F2F2F",
"o c #A9A9A9",
"p c #7D7D7D",
"q c #6D6D6D",
"r c #959595",
"s c #AFAFAF",
"t c #848484",
"u c #7F7F7F",
"v c #3B3B3B",
"w c #9B9B9B",
"x c #2B2B2B",
"y c #BFBFBF",
"z c #B3B3B3",
"A c #8A8A8A",
"B c #858585",
"C c #2E2E2E",
"D c #C3C3C3",
"E c #B8B8B8",
"F c #464646",
"G c #8E8E8E",
"H c #898989",
"I c #8D8D8D",
"J c #797979",
"K c #BCBCBC",
"L c #909090",
"M c #8C8C8C",
"N c #2A2A2A",
"O c #747474",
"P c #818181",
"Q c #808080",
"R c #C6C6C6",
"S c #C0C0C0",
"T c #787878",
"U c #868686",
"V c #878787",
"W c #8B8B8B",
"X c #666666",
"Y c #BDBDBD",
"Z c #929292",
"` c #6C6C6C",
" . c #505050",
".. c #C8C8C8",
" . + ",
" @ # $ ",
" @ % @ & ",
" * % % = - ",
" * % ; % = > ",
" * % , ' % = ) ",
"* ! ! ~ % { ] ^ % / . ! * ~ * + ",
"~ % % % % ( _ : < % % % % % % % ) ",
"* % $ [ % } | 1 % 2 3 ^ 4 5 6 % 7 ",
"* % 8 9 % 0 0 % a b c d c _ e % f ",
"* % g 8 % h % a b i b j c 4 k % 7 ",
"* % l g % % . m i j j 3 n o o % 7 ",
"~ % p l % q d i j r b # % 0 s % 7 ",
"~ % t u v b w j r d x % % y z % 7 ",
"~ % A B A b j ] d C % [ % D E % 7 ",
"F % G H I { ] b C % q J % f K % 7 ",
"~ % L M G { b N % O P Q % R S % 7 ",
"+ % % % % % % % T U V W % % % % D ",
" X 7 D 7 7 Y = % I Z b % 7 7 K 7 ",
" ` = % ( : % 7 ",
" 8 = % z % 7 ",
" X / % % 7 ",
" X .% .. ",
" - 9 .. ",
" q I "};
#else
static const gchar * loop_xpm[] = { static const gchar * loop_xpm[] = {
"19 19 3 1", "19 19 3 1",
" c None", " c None",
@ -142,6 +270,8 @@ static const gchar * loop_xpm[] = {
" ..+. ", " ..+. ",
" ... "}; " ... "};
#endif
void void
ARDOUR_UI::transport_stopped () ARDOUR_UI::transport_stopped ()
{ {

View file

@ -5,5 +5,5 @@ export ARDOUR_UI=./ardour.menus
export ARDOUR_UI_RC=./ardour2_ui.rc export ARDOUR_UI_RC=./ardour2_ui.rc
export ARDOUR_BINDINGS=./ardour.bindings export ARDOUR_BINDINGS=./ardour.bindings
export LD_LIBRARY_PATH=../libs/ardour export LD_LIBRARY_PATH=../libs/ardour:$LD_LIBRARY_PATH
exec valgrind --num-callers=12 --tool=memcheck ./ardour.bin --novst $* exec valgrind --num-callers=12 --tool=memcheck ./ardour.bin --novst $*

View file

@ -573,7 +573,7 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
randb = random() % 255; randb = random() % 255;
PAINT_BOX(buf, randr, randg, randb, simplerect->fill_a, begin, sy, end, ey); PAINT_BOX(buf, randr, randg, randb, simplerect->fill_a, begin, sy, end, ey);
#else #else
FAST_PAINT_BOX (buf, simplerect->fill_r, simplerect->fill_g, simplerect->fill_b, simplerect->fill_a, PAINT_BOX (buf, simplerect->fill_r, simplerect->fill_g, simplerect->fill_b, simplerect->fill_a,
intersection.x0, intersection.y0, intersection.x0, intersection.y0,
intersection.x1, intersection.y1); intersection.x1, intersection.y1);
#endif #endif

View file

@ -186,7 +186,6 @@ PluginUI::build (AudioEngine &engine)
Frame* frame; Frame* frame;
Frame* bt_frame; Frame* bt_frame;
VBox* box; VBox* box;
char info[32];
int output_row, output_col; int output_row, output_col;
int button_row, button_col; int button_row, button_col;
int output_rows, output_cols; int output_rows, output_cols;

View file

@ -56,19 +56,25 @@ static const int32_t sync_mark_width = 9;
sigc::signal<void,AudioRegionView*> AudioRegionView::AudioRegionViewGoingAway; sigc::signal<void,AudioRegionView*> AudioRegionView::AudioRegionViewGoingAway;
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView &tv, AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView &tv, AudioRegion& r, double spu,
AudioRegion& r, Gdk::Color& basic_color)
double spu,
double amplitude_above_axis,
Gdk::Color& basic_color,
bool wfw)
: TimeAxisViewItem (r.name(), *parent, tv, spu, basic_color, r.position(), r.length(), : TimeAxisViewItem (r.name(), *parent, tv, spu, basic_color, r.position(), r.length(),
TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText| TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText|
TimeAxisViewItem::ShowNameHighlight| TimeAxisViewItem::ShowNameHighlight|
TimeAxisViewItem::ShowFrame)), TimeAxisViewItem::ShowFrame)),
region (r) region (r)
{
}
AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView &tv, AudioRegion& r, double spu,
Gdk::Color& basic_color, TimeAxisViewItem::Visibility visibility)
: TimeAxisViewItem (r.name(), *parent, tv, spu, basic_color, r.position(), r.length(), visibility),
region (r)
{
}
void
AudioRegionView::init (double amplitude_above_axis, Gdk::Color& basic_color, bool wfw)
{ {
ArdourCanvas::Points shape; ArdourCanvas::Points shape;
XMLNode *node; XMLNode *node;
@ -150,7 +156,7 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, AudioTimeAxisView
foo += ':'; foo += ':';
foo += "gain"; foo += "gain";
gain_line = new AudioRegionGainLine (foo, tv.session(), *this, *group, region.envelope()); gain_line = new AudioRegionGainLine (foo, trackview.session(), *this, *group, region.envelope());
if (!(_flags & EnvelopeVisible)) { if (!(_flags & EnvelopeVisible)) {
gain_line->hide (); gain_line->hide ();
@ -197,7 +203,7 @@ AudioRegionView::~AudioRegionView ()
gnome_canvas_waveview_cache_destroy (*cache); gnome_canvas_waveview_cache_destroy (*cache);
} }
/* all waveviews will be destroyed when the group is destroyed */ /* all waveviews etc will be destroyed when the group is destroyed */
for (vector<GhostRegion*>::iterator g = ghosts.begin(); g != ghosts.end(); ++g) { for (vector<GhostRegion*>::iterator g = ghosts.begin(); g != ghosts.end(); ++g) {
delete *g; delete *g;
@ -207,8 +213,10 @@ AudioRegionView::~AudioRegionView ()
delete editor; delete editor;
} }
if (gain_line) {
delete gain_line; delete gain_line;
} }
}
gint gint
AudioRegionView::_lock_toggle (ArdourCanvas::Item* item, GdkEvent* ev, void* arg) AudioRegionView::_lock_toggle (ArdourCanvas::Item* item, GdkEvent* ev, void* arg)
@ -402,6 +410,7 @@ AudioRegionView::reset_width_dependent_items (double pixel_width)
zero_line->property_x2() = pixel_width - 1.0; zero_line->property_x2() = pixel_width - 1.0;
} }
if (fade_in_handle) {
if (pixel_width <= 6.0) { if (pixel_width <= 6.0) {
fade_in_handle->hide(); fade_in_handle->hide();
fade_out_handle->hide(); fade_out_handle->hide();
@ -414,6 +423,7 @@ AudioRegionView::reset_width_dependent_items (double pixel_width)
fade_out_handle->show(); fade_out_handle->show();
} }
} }
}
reset_fade_shapes (); reset_fade_shapes ();
} }
@ -517,6 +527,7 @@ AudioRegionView::set_height (gdouble height)
waves[n]->property_y() = yoff + 2; waves[n]->property_y() = yoff + 2;
} }
if (gain_line) {
if ((height/wcnt) < NAME_HIGHLIGHT_SIZE) { if ((height/wcnt) < NAME_HIGHLIGHT_SIZE) {
gain_line->hide (); gain_line->hide ();
} else { } else {
@ -524,13 +535,16 @@ AudioRegionView::set_height (gdouble height)
gain_line->show (); gain_line->show ();
} }
} }
gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE));
}
manage_zero_line (); manage_zero_line ();
gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE));
reset_fade_shapes (); reset_fade_shapes ();
if (name_text) {
name_text->raise_to_top(); name_text->raise_to_top();
} }
}
void void
AudioRegionView::manage_zero_line () AudioRegionView::manage_zero_line ()
@ -565,6 +579,10 @@ AudioRegionView::reset_fade_in_shape ()
void void
AudioRegionView::reset_fade_in_shape_width (jack_nframes_t width) AudioRegionView::reset_fade_in_shape_width (jack_nframes_t width)
{ {
if (fade_in_handle == 0) {
return;
}
/* smallest size for a fade is 64 frames */ /* smallest size for a fade is 64 frames */
width = std::max ((jack_nframes_t) 64, width); width = std::max ((jack_nframes_t) 64, width);
@ -645,6 +663,10 @@ AudioRegionView::reset_fade_out_shape ()
void void
AudioRegionView::reset_fade_out_shape_width (jack_nframes_t width) AudioRegionView::reset_fade_out_shape_width (jack_nframes_t width)
{ {
if (fade_out_handle == 0) {
return;
}
/* smallest size for a fade is 64 frames */ /* smallest size for a fade is 64 frames */
width = std::max ((jack_nframes_t) 64, width); width = std::max ((jack_nframes_t) 64, width);
@ -732,7 +754,9 @@ AudioRegionView::set_samples_per_unit (gdouble spu)
(*i)->set_duration (region.length() / samples_per_unit); (*i)->set_duration (region.length() / samples_per_unit);
} }
if (gain_line) {
gain_line->reset (); gain_line->reset ();
}
reset_fade_shapes (); reset_fade_shapes ();
region_sync_changed (); region_sync_changed ();
} }
@ -776,8 +800,13 @@ AudioRegionView::set_colors ()
{ {
TimeAxisViewItem::set_colors (); TimeAxisViewItem::set_colors ();
if (gain_line) {
gain_line->set_line_color (region.envelope_active() ? color_map[cGainLine] : color_map[cGainLineInactive]); gain_line->set_line_color (region.envelope_active() ? color_map[cGainLine] : color_map[cGainLineInactive]);
}
if (sync_mark) {
sync_mark->property_fill_color_rgba() = fill_color; sync_mark->property_fill_color_rgba() = fill_color;
}
for (uint32_t n=0; n < waves.size(); ++n) { for (uint32_t n=0; n < waves.size(); ++n) {
if (region.muted()) { if (region.muted()) {
@ -846,6 +875,10 @@ AudioRegionView::region_renamed ()
void void
AudioRegionView::region_sync_changed () AudioRegionView::region_sync_changed ()
{ {
if (sync_mark == 0) {
return;
}
int sync_dir; int sync_dir;
jack_nframes_t sync_offset; jack_nframes_t sync_offset;
@ -911,13 +944,15 @@ AudioRegionView::set_waveform_visible (bool yn)
void void
AudioRegionView::temporarily_hide_envelope () AudioRegionView::temporarily_hide_envelope ()
{ {
if (gain_line) {
gain_line->hide (); gain_line->hide ();
} }
}
void void
AudioRegionView::unhide_envelope () AudioRegionView::unhide_envelope ()
{ {
if (_flags & EnvelopeVisible) { if (gain_line && (_flags & EnvelopeVisible)) {
gain_line->show (); gain_line->show ();
} }
} }
@ -925,7 +960,7 @@ AudioRegionView::unhide_envelope ()
void void
AudioRegionView::set_envelope_visible (bool yn) AudioRegionView::set_envelope_visible (bool yn)
{ {
if ((_flags & EnvelopeVisible) != yn) { if (gain_line && ((_flags & EnvelopeVisible) != yn)) {
if (yn) { if (yn) {
gain_line->show (); gain_line->show ();
_flags |= EnvelopeVisible; _flags |= EnvelopeVisible;
@ -1068,6 +1103,10 @@ AudioRegionView::peaks_ready_handler (uint32_t which)
void void
AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev) AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
{ {
if (gain_line == 0) {
return;
}
double x, y; double x, y;
/* don't create points that can't be seen */ /* don't create points that can't be seen */
@ -1274,7 +1313,7 @@ AudioRegionView::get_fill_color ()
void void
AudioRegionView::entered () AudioRegionView::entered ()
{ {
if (_flags & EnvelopeVisible) { if (gain_line && _flags & EnvelopeVisible) {
gain_line->show_all_control_points (); gain_line->show_all_control_points ();
} }
@ -1282,28 +1321,36 @@ AudioRegionView::entered ()
UINT_TO_RGBA(fade_color,&r,&g,&b,&a); UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
a=255; a=255;
if (fade_in_handle) {
fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a); fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a); fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
} }
}
void void
AudioRegionView::exited () AudioRegionView::exited ()
{ {
if (gain_line) {
gain_line->hide_all_but_selected_control_points (); gain_line->hide_all_but_selected_control_points ();
}
uint32_t r,g,b,a; uint32_t r,g,b,a;
UINT_TO_RGBA(fade_color,&r,&g,&b,&a); UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
a=0; a=0;
if (fade_in_handle) {
fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a); fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a); fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
} }
}
void void
AudioRegionView::envelope_active_changed () AudioRegionView::envelope_active_changed ()
{ {
if (gain_line) {
gain_line->set_line_color (region.envelope_active() ? color_map[cGainLine] : color_map[cGainLineInactive]); gain_line->set_line_color (region.envelope_active() ? color_map[cGainLine] : color_map[cGainLineInactive]);
} }
}
void void
AudioRegionView::set_waveview_data_src() AudioRegionView::set_waveview_data_src()

View file

@ -52,11 +52,12 @@ class AudioRegionView : public TimeAxisViewItem
AudioTimeAxisView&, AudioTimeAxisView&,
ARDOUR::AudioRegion&, ARDOUR::AudioRegion&,
double initial_samples_per_unit, double initial_samples_per_unit,
double amplitude_above_axis, Gdk::Color& basic_color);
Gdk::Color& base_color,
bool wait_for_waves);
~AudioRegionView (); ~AudioRegionView ();
virtual void init (double amplitude_above_axis, Gdk::Color& base_color, bool wait_for_waves);
ARDOUR::AudioRegion& region; // ok, let 'em have it ARDOUR::AudioRegion& region; // ok, let 'em have it
bool is_valid() const { return valid; } bool is_valid() const { return valid; }
void set_valid (bool yn) { valid = yn; } void set_valid (bool yn) { valid = yn; }
@ -115,7 +116,20 @@ class AudioRegionView : public TimeAxisViewItem
virtual void entered (); virtual void entered ();
virtual void exited (); virtual void exited ();
private: protected:
/* this constructor allows derived types
to specify their visibility requirements
to the TimeAxisViewItem parent class
*/
AudioRegionView (ArdourCanvas::Group *,
AudioTimeAxisView&,
ARDOUR::AudioRegion&,
double initial_samples_per_unit,
Gdk::Color& basic_color,
TimeAxisViewItem::Visibility);
enum Flags { enum Flags {
EnvelopeVisible = 0x1, EnvelopeVisible = 0x1,
WaveformVisible = 0x4, WaveformVisible = 0x4,
@ -178,7 +192,7 @@ class AudioRegionView : public TimeAxisViewItem
void set_colors (); void set_colors ();
void compute_colors (Gdk::Color&); void compute_colors (Gdk::Color&);
void set_frame_color (); virtual void set_frame_color ();
void reset_width_dependent_items (double pixel_width); void reset_width_dependent_items (double pixel_width);
void set_waveview_data_src(); void set_waveview_data_src();

View file

@ -13,6 +13,7 @@
#include "streamview.h" #include "streamview.h"
#include "regionview.h" #include "regionview.h"
#include "taperegionview.h"
#include "audio_time_axis.h" #include "audio_time_axis.h"
#include "canvas-waveview.h" #include "canvas-waveview.h"
#include "canvas-simplerect.h" #include "canvas-simplerect.h"
@ -46,31 +47,15 @@ StreamView::StreamView (AudioTimeAxisView& tv)
/* set_position() will position the group */ /* set_position() will position the group */
//GTK2FIX -- how to get the group? is the canvas display really a group?
//canvas_group = gnome_canvas_item_new (GNOME_CANVAS_GROUP(_trackview.canvas_display),
// gnome_canvas_group_get_type (),
// NULL);
canvas_group = new ArdourCanvas::Group(*_trackview.canvas_display); canvas_group = new ArdourCanvas::Group(*_trackview.canvas_display);
//canvas_rect = gnome_canvas_item_new (GNOME_CANVAS_GROUP(canvas_group),
// gnome_canvas_simplerect_get_type(),
// "x1", 0.0,
// "y1", 0.0,
// "x2", 1000000.0,
// "y2", (double) tv.height,
// "outline_color_rgba", color_map[cAudioTrackOutline],
// /* outline ends and bottom */
// "outline_what", (guint32) (0x1|0x2|0x8),
// "fill_color_rgba", stream_base_color,
// ] NULL);
canvas_rect = new ArdourCanvas::SimpleRect (*canvas_group); canvas_rect = new ArdourCanvas::SimpleRect (*canvas_group);
canvas_rect->property_x1() = 0.0; canvas_rect->property_x1() = 0.0;
canvas_rect->property_y1() = 0.0; canvas_rect->property_y1() = 0.0;
canvas_rect->property_x2() = 1000000.0; canvas_rect->property_x2() = 1000000.0;
canvas_rect->property_y2() = (double) tv.height; canvas_rect->property_y2() = (double) tv.height;
canvas_rect->property_outline_color_rgba() = color_map[cAudioTrackOutline]; canvas_rect->property_outline_color_rgba() = color_map[cAudioTrackOutline];
/* outline ends and bottom */ canvas_rect->property_outline_what() = (guint32) (0x1|0x2|0x8); // outline ends and bottom
canvas_rect->property_outline_what() = (guint32) (0x1|0x2|0x8);
canvas_rect->property_fill_color_rgba() = stream_base_color; canvas_rect->property_fill_color_rgba() = stream_base_color;
canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview)); canvas_rect->signal_event().connect (bind (mem_fun (_trackview.editor, &PublicEditor::canvas_stream_view_event), canvas_rect, &_trackview));
@ -223,14 +208,18 @@ StreamView::add_region_view_internal (Region *r, bool wait_for_waves)
} }
} }
region_view = new AudioRegionView (canvas_group, switch (_trackview.audio_track()->mode()) {
_trackview, case Normal:
*region, region_view = new AudioRegionView (canvas_group, _trackview, *region,
_samples_per_unit, _samples_per_unit, region_color);
_amplitude_above_axis, break;
region_color, case Destructive:
wait_for_waves); region_view = new TapeAudioRegionView (canvas_group, _trackview, *region,
_samples_per_unit, region_color);
break;
}
region_view->init (_amplitude_above_axis, region_color, wait_for_waves);
region_views.push_front (region_view); region_views.push_front (region_view);
/* follow global waveform setting */ /* follow global waveform setting */

View file

@ -64,7 +64,7 @@ const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6 ;
*/ */
TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color, TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group& parent, TimeAxisView& tv, double spu, Gdk::Color& base_color,
jack_nframes_t start, jack_nframes_t duration, jack_nframes_t start, jack_nframes_t duration,
Visibility visibility) Visibility vis)
: trackview (tv) : trackview (tv)
{ {
if (!have_name_font) { if (!have_name_font) {
@ -83,6 +83,7 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
max_item_duration = ARDOUR::max_frames; max_item_duration = ARDOUR::max_frames;
min_item_duration = 0 ; min_item_duration = 0 ;
show_vestigial = true; show_vestigial = true;
visibility = vis;
if (duration == 0) { if (duration == 0) {
warning << "Time Axis Item Duration == 0" << endl ; warning << "Time Axis Item Duration == 0" << endl ;
@ -108,14 +109,33 @@ TimeAxisViewItem::TimeAxisViewItem(const string & it_name, ArdourCanvas::Group&
frame->property_outline_color_rgba() = color_map[cTimeAxisFrameOutline]; frame->property_outline_color_rgba() = color_map[cTimeAxisFrameOutline];
frame->property_fill_color_rgba() = color_map[cTimeAxisFrameFill]; frame->property_fill_color_rgba() = color_map[cTimeAxisFrameFill];
/* by default draw all 4 edges */
uint32_t outline_what = 0x1|0x2|0x4|0x8;
if (visibility & HideFrameLR) {
outline_what &= ~(0x1 | 0x2);
}
if (visibility & HideFrameTB) {
outline_what &= ~(0x4 | 0x8);
}
frame->property_outline_what() = outline_what;
} else { } else {
frame = 0; frame = 0;
} }
if (visibility & ShowNameHighlight) { if (visibility & ShowNameHighlight) {
name_highlight = new ArdourCanvas::SimpleRect (*group); name_highlight = new ArdourCanvas::SimpleRect (*group);
if (visibility & FullWidthNameHighlight) {
name_highlight->property_x1() = (double) 0.0;
name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration));
} else {
name_highlight->property_x1() = (double) 1.0; name_highlight->property_x1() = (double) 1.0;
name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)) - 1; name_highlight->property_x2() = (double) (trackview.editor.frame_to_pixel(item_duration)) - 1;
}
name_highlight->property_y1() = (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE); name_highlight->property_y1() = (double) (trackview.height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE);
name_highlight->property_y2() = (double) (trackview.height - 1); name_highlight->property_y2() = (double) (trackview.height - 1);
name_highlight->property_outline_color_rgba() = color_map[cNameHighlightFill]; name_highlight->property_outline_color_rgba() = color_map[cNameHighlightFill];
@ -508,11 +528,15 @@ TimeAxisViewItem::set_height(double height)
if (name_highlight) { if (name_highlight) {
if (height < NAME_HIGHLIGHT_THRESH) { if (height < NAME_HIGHLIGHT_THRESH) {
name_highlight->hide(); name_highlight->hide();
if (name_text) {
name_text->hide(); name_text->hide();
}
} else { } else {
name_highlight->show(); name_highlight->show();
if (name_text) {
name_text->show(); name_text->show();
} }
}
if (height > NAME_HIGHLIGHT_SIZE) { if (height > NAME_HIGHLIGHT_SIZE) {
name_highlight->property_y1() = (double) height+1 - NAME_HIGHLIGHT_SIZE; name_highlight->property_y1() = (double) height+1 - NAME_HIGHLIGHT_SIZE;
@ -780,8 +804,10 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
if (name_highlight) { if (name_highlight) {
name_highlight->hide(); name_highlight->hide();
if (name_text) {
name_text->hide(); name_text->hide();
} }
}
if (frame) { if (frame) {
frame->hide(); frame->hide();
@ -801,16 +827,25 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
if (height < NAME_HIGHLIGHT_THRESH) { if (height < NAME_HIGHLIGHT_THRESH) {
name_highlight->hide(); name_highlight->hide();
if (name_text) {
name_text->hide(); name_text->hide();
}
} else { } else {
name_highlight->show(); name_highlight->show();
if (name_text) {
name_text->show(); name_text->show();
reset_name_width (pixel_width); reset_name_width (pixel_width);
} }
}
if (visibility & FullWidthNameHighlight) {
name_highlight->property_x2() = pixel_width;
} else {
name_highlight->property_x2() = pixel_width - 1.0; name_highlight->property_x2() = pixel_width - 1.0;
} }
}
if (frame) { if (frame) {
frame->show(); frame->show();
frame->property_x2() = pixel_width; frame->property_x2() = pixel_width;

View file

@ -326,7 +326,10 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable
ShowFrame = 0x1, ShowFrame = 0x1,
ShowNameHighlight = 0x2, ShowNameHighlight = 0x2,
ShowNameText = 0x4, ShowNameText = 0x4,
ShowHandles = 0x8 ShowHandles = 0x8,
HideFrameLR = 0x10,
HideFrameTB = 0x20,
FullWidthNameHighlight = 0x40
}; };
/** /**
@ -454,6 +457,8 @@ class TimeAxisViewItem : public sigc::trackable, public Selectable
ArdourCanvas::SimpleRect* frame_handle_start; ArdourCanvas::SimpleRect* frame_handle_start;
ArdourCanvas::SimpleRect* frame_handle_end; ArdourCanvas::SimpleRect* frame_handle_end;
Visibility visibility;
}; /* class TimeAxisViewItem */ }; /* class TimeAxisViewItem */
#endif /* __gtk_ardour_time_axis_view_item_h__ */ #endif /* __gtk_ardour_time_axis_view_item_h__ */

View file

@ -102,24 +102,24 @@ class AudioEngine : public sigc::trackable
virtual const char *what() const throw() { return "could not connect to engine backend"; } virtual const char *what() const throw() { return "could not connect to engine backend"; }
}; };
Port *register_audio_input_port (const string& portname); Port *register_audio_input_port (const std::string& portname);
Port *register_audio_output_port (const string& portname); Port *register_audio_output_port (const std::string& portname);
int unregister_port (Port *); int unregister_port (Port *);
int connect (const string& source, const string& destination); int connect (const std::string& source, const std::string& destination);
int disconnect (const string& source, const string& destination); int disconnect (const std::string& source, const std::string& destination);
int disconnect (Port *); int disconnect (Port *);
const char ** get_ports (const string& port_name_pattern, const string& type_name_pattern, uint32_t flags); const char ** get_ports (const std::string& port_name_pattern, const std::string& type_name_pattern, uint32_t flags);
uint32_t n_physical_outputs () const; uint32_t n_physical_outputs () const;
uint32_t n_physical_inputs () const; uint32_t n_physical_inputs () const;
string get_nth_physical_output (uint32_t n) { std::string get_nth_physical_output (uint32_t n) {
return get_nth_physical (n, JackPortIsInput); return get_nth_physical (n, JackPortIsInput);
} }
string get_nth_physical_input (uint32_t n) { std::string get_nth_physical_input (uint32_t n) {
return get_nth_physical (n, JackPortIsOutput); return get_nth_physical (n, JackPortIsOutput);
} }
@ -130,7 +130,7 @@ class AudioEngine : public sigc::trackable
the return value the return value
*/ */
Port *get_port_by_name (const string& name, bool keep = true); Port *get_port_by_name (const std::string& name, bool keep = true);
enum TransportState { enum TransportState {
TransportStopped = JackTransportStopped, TransportStopped = JackTransportStopped,
@ -215,7 +215,7 @@ class AudioEngine : public sigc::trackable
PortConnections port_connections; PortConnections port_connections;
void remove_connections_for (Port*); void remove_connections_for (Port*);
string get_nth_physical (uint32_t which, int flags); std::string get_nth_physical (uint32_t which, int flags);
static int _xrun_callback (void *arg); static int _xrun_callback (void *arg);
static int _graph_order_callback (void *arg); static int _graph_order_callback (void *arg);

View file

@ -29,8 +29,6 @@
#include <ardour/types.h> #include <ardour/types.h>
#include <ardour/stateful.h> #include <ardour/stateful.h>
using std::string;
class XMLNode; class XMLNode;
namespace ARDOUR { namespace ARDOUR {
@ -42,21 +40,21 @@ class Configuration : public Stateful
virtual ~Configuration(); virtual ~Configuration();
struct MidiPortDescriptor { struct MidiPortDescriptor {
string tag; std::string tag;
string device; std::string device;
string type; std::string type;
string mode; std::string mode;
MidiPortDescriptor (const XMLNode&); MidiPortDescriptor (const XMLNode&);
XMLNode& get_state(); XMLNode& get_state();
}; };
std::map<string,MidiPortDescriptor *> midi_ports; std::map<std::string,MidiPortDescriptor *> midi_ports;
int load_state (); int load_state ();
int save_state (); int save_state ();
XMLNode& option_node (const string &, const string &); XMLNode& option_node (const std::string &, const std::string &);
int set_state (const XMLNode&); int set_state (const XMLNode&);
XMLNode& get_state (void); XMLNode& get_state (void);
@ -76,8 +74,8 @@ class Configuration : public Stateful
bool get_trace_midi_output (); bool get_trace_midi_output ();
void set_trace_midi_output (bool); void set_trace_midi_output (bool);
string get_raid_path(); std::string get_raid_path();
void set_raid_path(string); void set_raid_path(std::string);
uint32_t get_minimum_disk_io(); uint32_t get_minimum_disk_io();
void set_minimum_disk_io(uint32_t); void set_minimum_disk_io(uint32_t);
@ -88,11 +86,11 @@ class Configuration : public Stateful
bool does_hiding_groups_deactivates_groups(); bool does_hiding_groups_deactivates_groups();
void set_hiding_groups_deactivates_groups(bool); void set_hiding_groups_deactivates_groups(bool);
string get_auditioner_output_left(); std::string get_auditioner_output_left();
void set_auditioner_output_left(string); void set_auditioner_output_left(std::string);
string get_auditioner_output_right(); std::string get_auditioner_output_right();
void set_auditioner_output_right(string); void set_auditioner_output_right(std::string);
bool get_mute_affects_pre_fader(); bool get_mute_affects_pre_fader();
void set_mute_affects_pre_fader (bool); void set_mute_affects_pre_fader (bool);
@ -112,14 +110,14 @@ class Configuration : public Stateful
uint32_t get_disk_choice_space_threshold(); uint32_t get_disk_choice_space_threshold();
void set_disk_choice_space_threshold (uint32_t); void set_disk_choice_space_threshold (uint32_t);
string get_mmc_port_name(); std::string get_mmc_port_name();
void set_mmc_port_name(string); void set_mmc_port_name(std::string);
string get_mtc_port_name(); std::string get_mtc_port_name();
void set_mtc_port_name(string); void set_mtc_port_name(std::string);
string get_midi_port_name(); std::string get_midi_port_name();
void set_midi_port_name(string); void set_midi_port_name(std::string);
uint32_t get_midi_feedback_interval_ms(); uint32_t get_midi_feedback_interval_ms();
void set_midi_feedback_interval_ms (uint32_t); void set_midi_feedback_interval_ms (uint32_t);
@ -163,25 +161,28 @@ class Configuration : public Stateful
bool get_timecode_source_is_synced (); bool get_timecode_source_is_synced ();
void set_timecode_source_is_synced (bool); void set_timecode_source_is_synced (bool);
string get_user_ardour_path (); std::string get_user_ardour_path ();
string get_system_ardour_path (); std::string get_system_ardour_path ();
gain_t get_quieten_at_speed (); gain_t get_quieten_at_speed ();
void set_quieten_at_speed (gain_t); void set_quieten_at_speed (gain_t);
std::string get_tape_dir ();
void set_tape_dir (std::string);
private: private:
void set_defaults (); void set_defaults ();
string get_system_path(); std::string get_system_path();
string get_user_path(); std::string get_user_path();
/* this is subject to wordexp, so we need /* this is subject to wordexp, so we need
to keep the original (user-entered) form to keep the original (user-entered) form
around. e.g. ~/blah-> /home/foo/blah around. e.g. ~/blah-> /home/foo/blah
*/ */
string raid_path; std::string raid_path;
bool raid_path_is_user; bool raid_path_is_user;
string orig_raid_path; std::string orig_raid_path;
uint32_t minimum_disk_io_bytes; uint32_t minimum_disk_io_bytes;
bool minimum_disk_io_bytes_is_user; bool minimum_disk_io_bytes_is_user;
@ -189,9 +190,9 @@ class Configuration : public Stateful
bool track_buffer_seconds_is_user; bool track_buffer_seconds_is_user;
bool hiding_groups_deactivates_groups; bool hiding_groups_deactivates_groups;
bool hiding_groups_deactivates_groups_is_user; bool hiding_groups_deactivates_groups_is_user;
string auditioner_output_left; std::string auditioner_output_left;
bool auditioner_output_left_is_user; bool auditioner_output_left_is_user;
string auditioner_output_right; std::string auditioner_output_right;
bool auditioner_output_right_is_user; bool auditioner_output_right_is_user;
bool mute_affects_pre_fader; bool mute_affects_pre_fader;
bool mute_affects_pre_fader_is_user; bool mute_affects_pre_fader_is_user;
@ -205,11 +206,11 @@ class Configuration : public Stateful
bool solo_latch_is_user; bool solo_latch_is_user;
uint32_t disk_choice_space_threshold; uint32_t disk_choice_space_threshold;
bool disk_choice_space_threshold_is_user; bool disk_choice_space_threshold_is_user;
string mtc_port_name; std::string mtc_port_name;
bool mtc_port_name_is_user; bool mtc_port_name_is_user;
string mmc_port_name; std::string mmc_port_name;
bool mmc_port_name_is_user; bool mmc_port_name_is_user;
string midi_port_name; std::string midi_port_name;
bool midi_port_name_is_user; bool midi_port_name_is_user;
bool use_hardware_monitoring; bool use_hardware_monitoring;
bool use_hardware_monitoring_is_user; bool use_hardware_monitoring_is_user;
@ -248,6 +249,8 @@ class Configuration : public Stateful
bool midi_feedback_interval_ms_is_user; bool midi_feedback_interval_ms_is_user;
bool latched_record_enable; bool latched_record_enable;
bool latched_record_enable_is_user; bool latched_record_enable_is_user;
std::string tape_dir;
bool tape_dir_is_user;
XMLNode *key_node; XMLNode *key_node;
bool user_configuration; bool user_configuration;

View file

@ -53,15 +53,15 @@ class Port : public sigc::trackable {
silent = false; silent = false;
} }
string name() { std::string name() {
return _name; return _name;
} }
string short_name() { std::string short_name() {
return jack_port_short_name (port); return jack_port_short_name (port);
} }
int set_name (string str); int set_name (std::string str);
JackPortFlags flags() const { JackPortFlags flags() const {
return _flags; return _flags;
@ -79,7 +79,7 @@ class Port : public sigc::trackable {
return jack_port_connected (port); return jack_port_connected (port);
} }
bool connected_to (const string& portname) const { bool connected_to (const std::string& portname) const {
return jack_port_connected_to (port, portname.c_str()); return jack_port_connected_to (port, portname.c_str());
} }
@ -191,8 +191,8 @@ class Port : public sigc::trackable {
*/ */
JackPortFlags _flags; JackPortFlags _flags;
string _type; std::string _type;
string _name; std::string _name;
bool last_monitor : 1; bool last_monitor : 1;
bool silent : 1; bool silent : 1;

View file

@ -243,10 +243,11 @@ class Session : public sigc::trackable, public Stateful
bool dirty() const { return _state_of_the_state & Dirty; } bool dirty() const { return _state_of_the_state & Dirty; }
sigc::signal<void> DirtyChanged; sigc::signal<void> DirtyChanged;
string sound_dir () const; std::string sound_dir () const;
string peak_dir () const; std::string tape_dir () const;
string dead_sound_dir () const; std::string peak_dir () const;
string automation_dir () const; std::string dead_sound_dir () const;
std::string automation_dir () const;
static string template_path (); static string template_path ();
static string template_dir (); static string template_dir ();
@ -1618,10 +1619,11 @@ class Session : public sigc::trackable, public Stateful
PBD::Lock space_lock; PBD::Lock space_lock;
static const char* sound_dir_name; static const char* sound_dir_name;
static const char* tape_dir_name;
static const char* dead_sound_dir_name; static const char* dead_sound_dir_name;
static const char* peak_dir_name; static const char* peak_dir_name;
string discover_best_sound_dir (); string discover_best_sound_dir (bool destructive = false);
int ensure_sound_dir (string, string&); int ensure_sound_dir (string, string&);
void refresh_disk_space (); void refresh_disk_space ();

View file

@ -29,13 +29,11 @@
class XMLNode; class XMLNode;
using std::ostream;
void elapsed_time_to_str (char *buf, uint32_t seconds); void elapsed_time_to_str (char *buf, uint32_t seconds);
string legalize_for_path (std::string str); std::string legalize_for_path (std::string str);
ostream& operator<< (ostream& o, const ARDOUR::BBT_Time& bbt); std::ostream& operator<< (std::ostream& o, const ARDOUR::BBT_Time& bbt);
XMLNode* find_named_node (const XMLNode& node, std::string name); XMLNode* find_named_node (const XMLNode& node, std::string name);
string placement_as_string (ARDOUR::Placement); std::string placement_as_string (ARDOUR::Placement);
static inline float f_max(float x, float a) { static inline float f_max(float x, float a) {
x -= a; x -= a;
@ -48,12 +46,12 @@ static inline float f_max(float x, float a) {
int cmp_nocase (const std::string& s, const std::string& s2); int cmp_nocase (const std::string& s, const std::string& s2);
int tokenize_fullpath (string fullpath, string& path, string& name); int tokenize_fullpath (std::string fullpath, std::string& path, std::string& name);
int touch_file(string path); int touch_file(std::string path);
uint32_t long get_uid(); uint32_t long get_uid();
string region_name_from_path (string path); std::string region_name_from_path (std::string path);
#endif /* __ardour_utils_h__ */ #endif /* __ardour_utils_h__ */

View file

@ -294,6 +294,11 @@ Configuration::state (bool user_only)
if (!user_only || latched_record_enable_is_user) { if (!user_only || latched_record_enable_is_user) {
node->add_child_nocopy(option_node("latched-record-enable", latched_record_enable?"yes":"no")); node->add_child_nocopy(option_node("latched-record-enable", latched_record_enable?"yes":"no"));
} }
if (!user_only || tape_dir_is_user) {
if (!tape_dir.empty()) {
node->add_child_nocopy(option_node("tape-dir", tape_dir));
}
}
/* use-vst is always per-user */ /* use-vst is always per-user */
node->add_child_nocopy (option_node ("use-vst", use_vst?"yes":"no")); node->add_child_nocopy (option_node ("use-vst", use_vst?"yes":"no"));
@ -436,6 +441,8 @@ Configuration::set_state (const XMLNode& root)
set_midi_feedback_interval_ms (atoi (option_value.c_str())); set_midi_feedback_interval_ms (atoi (option_value.c_str()));
} else if (option_name == "latched-record-enable") { } else if (option_name == "latched-record-enable") {
set_latched_record_enable (option_value == "yes"); set_latched_record_enable (option_value == "yes");
} else if (option_name == "tape-dir") {
set_tape_dir (option_value);
} }
} }
@ -492,6 +499,7 @@ Configuration::set_defaults ()
timecode_source_is_synced = true; timecode_source_is_synced = true;
use_vst = true; /* if we build with VST_SUPPORT, otherwise no effect */ use_vst = true; /* if we build with VST_SUPPORT, otherwise no effect */
quieten_at_speed = true; quieten_at_speed = true;
tape_dir = "";
midi_feedback_interval_ms = 100; midi_feedback_interval_ms = 100;
@ -532,6 +540,7 @@ Configuration::set_defaults ()
quieten_at_speed_is_user = false; quieten_at_speed_is_user = false;
midi_feedback_interval_ms_is_user = false; midi_feedback_interval_ms_is_user = false;
latched_record_enable_is_user = false; latched_record_enable_is_user = false;
tape_dir_is_user = false;
} }
Configuration::MidiPortDescriptor::MidiPortDescriptor (const XMLNode& node) Configuration::MidiPortDescriptor::MidiPortDescriptor (const XMLNode& node)
@ -1151,3 +1160,15 @@ Configuration::get_latched_record_enable ()
{ {
return latched_record_enable; return latched_record_enable;
} }
string
Configuration::get_tape_dir ()
{
return tape_dir;
}
void
Configuration::set_tape_dir (string path)
{
tape_dir = path;
}

View file

@ -117,8 +117,6 @@ DestructiveFileSource::setup_standard_crossfades (jack_nframes_t rate)
int int
DestructiveFileSource::seek (jack_nframes_t frame) DestructiveFileSource::seek (jack_nframes_t frame)
{ {
// file_pos = data_offset + (sizeof (Sample) * frame);
cerr << _name << " Seek to " << frame << " = " << data_offset + (_sample_size * frame) << endl;
return 0; return 0;
} }

View file

@ -1701,7 +1701,6 @@ DiskStream::finish_capture (bool rec_monitors_input)
was_recording = false; was_recording = false;
if (_flags & Recordable) { if (_flags & Recordable) {
cerr << "STOP CAPTURE\n";
for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) { for (ChannelList::iterator chan = channels.begin(); chan != channels.end(); ++chan) {
(*chan).write_source->mark_capture_end (); (*chan).write_source->mark_capture_end ();
} }

View file

@ -21,6 +21,7 @@
#include "ardour/port.h" #include "ardour/port.h"
using namespace ARDOUR; using namespace ARDOUR;
using namespace std;
Port::Port (jack_port_t *p) Port::Port (jack_port_t *p)
: port (p) : port (p)

View file

@ -76,6 +76,7 @@ const char* Session::_template_suffix = X_(".template");
const char* Session::_statefile_suffix = X_(".ardour"); const char* Session::_statefile_suffix = X_(".ardour");
const char* Session::_pending_suffix = X_(".pending"); const char* Session::_pending_suffix = X_(".pending");
const char* Session::sound_dir_name = X_("sounds"); const char* Session::sound_dir_name = X_("sounds");
const char* Session::tape_dir_name = X_("tapes");
const char* Session::peak_dir_name = X_("peaks"); const char* Session::peak_dir_name = X_("peaks");
const char* Session::dead_sound_dir_name = X_("dead_sounds"); const char* Session::dead_sound_dir_name = X_("dead_sounds");
@ -2658,7 +2659,12 @@ Session::create_file_source (DiskStream& ds, int32_t chan, bool destructive)
for (i = session_dirs.begin(); i != session_dirs.end(); ++i) { for (i = session_dirs.begin(); i != session_dirs.end(); ++i) {
spath = (*i).path; spath = (*i).path;
if (destructive) {
spath += tape_dir_name;
} else {
spath += sound_dir_name; spath += sound_dir_name;
}
spath += '/'; spath += '/';
spath += legalized; spath += legalized;

View file

@ -242,9 +242,9 @@ Session::butler_thread_work ()
} }
} }
// for (DiskStreamList::iterator i = diskstreams.begin(); i != diskstreams.end(); ++i) { for (i = diskstreams.begin(); i != diskstreams.end(); ++i) {
// cerr << "BEFORE " << (*i)->name() << ": pb = " << (*i)->playback_buffer_load() << " cp = " << (*i)->capture_buffer_load() << endl; // cerr << "BEFORE " << (*i)->name() << ": pb = " << (*i)->playback_buffer_load() << " cp = " << (*i)->capture_buffer_load() << endl;
// } }
if (transport_work_requested()) { if (transport_work_requested()) {
butler_transport_work (); butler_transport_work ();

View file

@ -486,6 +486,15 @@ Session::create (bool& new_session, string* mix_template, jack_nframes_t initial
} }
} }
dir = tape_dir ();
if (mkdir (dir.c_str(), 0755) < 0) {
if (errno != EEXIST) {
error << string_compose(_("Session: cannot create session tape dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
return -1;
}
}
dir = dead_sound_dir (); dir = dead_sound_dir ();
if (mkdir (dir.c_str(), 0755) < 0) { if (mkdir (dir.c_str(), 0755) < 0) {
@ -1956,11 +1965,17 @@ Session::ensure_sound_dir (string path, string& result)
} }
string string
Session::discover_best_sound_dir () Session::discover_best_sound_dir (bool destructive)
{ {
vector<space_and_path>::iterator i; vector<space_and_path>::iterator i;
string result; string result;
/* destructive files all go into the same place */
if (destructive) {
return tape_dir();
}
/* handle common case without system calls */ /* handle common case without system calls */
if (session_dirs.size() == 1) { if (session_dirs.size() == 1) {
@ -2174,6 +2189,21 @@ Session::sound_dir () const
return res; return res;
} }
string
Session::tape_dir () const
{
string res = Config->get_tape_dir();
if (!res.empty()) {
return res;
}
res = _path;
res += tape_dir_name;
res += '/';
return res;
}
string string
Session::peak_dir () const Session::peak_dir () const
{ {

View file

@ -475,7 +475,7 @@ MachineControl::write_track_record_ready (byte *msg, size_t len)
{ {
size_t n; size_t n;
size_t base_track; ssize_t base_track;
/* Bits 0-4 of the first byte are for special tracks: /* Bits 0-4 of the first byte are for special tracks: