13
0

forward-port from 2.X commits 5827-6000 including

git-svn-id: svn://localhost/ardour2/branches/3.0@6914 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-04-15 20:42:05 +00:00
parent d2beb38ea9
commit dc815ea8e8
19 changed files with 158 additions and 75 deletions

View File

@ -49,6 +49,7 @@
</menu>
<menuitem action='record-roll'/>
<menuitem action='Record'/>
<menuitem action='ToggleRollMaybe'/>
<menuitem action='ToggleRollForgetCapture'/>
<menu action="SetLoopMenu">
<menuitem action='set-loop-from-edit-range'/>

View File

@ -498,7 +498,7 @@ AudioRegionView::set_height (gdouble height)
}
}
gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE));
gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE) - 2);
}
manage_zero_line ();

View File

@ -220,6 +220,27 @@ show_me_the_size (Requisition* r, const char* what)
cerr << "size of " << what << " = " << r->width << " x " << r->height << endl;
}
#ifdef GTKOSX
static void
pane_size_watcher (Paned* pane)
{
/* if the handle of a pane vanishes into (at least) the tabs of a notebook,
it is no longer accessible. so stop that. this doesn't happen on X11,
just the quartz backend.
ugh.
*/
int max_width_of_lhs = GTK_WIDGET(pane->gobj())->allocation.width - 25;
gint pos = pane->get_position ();
if (pos > max_width_of_lhs) {
pane->set_position (max_width_of_lhs);
}
}
#endif
Editor::Editor ()
: _join_object_range_state (JOIN_OBJECT_RANGE_NONE)
@ -588,7 +609,10 @@ Editor::Editor ()
edit_pane.pack2 (the_notebook, false, true);
edit_pane.signal_size_allocate().connect (sigc::bind (sigc::mem_fun(*this, &Editor::pane_allocation_handler), static_cast<Paned*> (&edit_pane)));
#ifdef GTKOSX
Glib::PropertyProxy<int> proxy = edit_pane.property_position();
proxy.signal_changed().connect (bind (sigc::ptr_fun (pane_size_watcher), static_cast<Paned*> (&edit_pane)));
#endif
top_hbox.pack_start (toolbar_frame, false, true);
HBox *hbox = manage (new HBox);

View File

@ -103,6 +103,7 @@ This mode provides many different operations on both regions and control points,
@trans|Transport/ToggleRoll|space|toggle roll
@epp|Editor/play-edit-range|<@SECONDARY@>space|play edit range
@epp|Editor/play-from-edit-point-and-return|<@LEVEL4@>space|play from EP \& return
@trans|Transport/ToggleRollMaybe|<@PRIMARY@><@SECONDARY>space|stop but do not leave loop/range play
@trans|Transport/ToggleRollForgetCapture|<@PRIMARY@>space|stop and destroy
@trans|Transport/record-roll|<@TERTIARY@>space|start recording

View File

@ -176,7 +176,7 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
}
};
static const int32_t initial_button_rows = 6;
static const int32_t initial_button_rows = 12;
static const int32_t initial_button_cols = 1;
static const int32_t initial_output_rows = 1;
static const int32_t initial_output_cols = 4;

View File

@ -423,6 +423,9 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
chooser.add_shortcut_folder_uri("file:///Library/Application Support/GarageBand/Instrument Library/Sampler/Sampler Files");
}
#ifdef GTKOSX
chooser.add_shortcut_folder_uri("file:///Volumes");
#endif
//add the file chooser
{

View File

@ -137,7 +137,7 @@ class LadspaPlugin : public ARDOUR::Plugin
class LadspaPluginInfo : public PluginInfo {
public:
LadspaPluginInfo () { };
LadspaPluginInfo ();
~LadspaPluginInfo () { };
PluginPtr load (Session& session);

View File

@ -188,6 +188,9 @@ class Region
void trim_end (framepos_t new_position, void *src);
void trim_to (framepos_t position, framecnt_t length, void *src);
void cut_front (nframes_t new_position, void *src);
void cut_end (nframes_t new_position, void *src);
void set_layer (layer_t l); /* ONLY Playlist can call this */
void raise ();
void lower ();
@ -288,6 +291,8 @@ class Region
void trim_to_internal (framepos_t position, framecnt_t length, void *src);
virtual void set_position_internal (framepos_t pos, bool allow_bbt_recompute);
void modify_front (nframes_t new_position, bool reset_fade, void* src);
void modify_end (nframes_t new_position, bool reset_fade, void* src);
void maybe_uncopy ();
void first_edit ();

View File

@ -101,7 +101,7 @@ class VSTPlugin : public ARDOUR::Plugin
class VSTPluginInfo : public PluginInfo
{
public:
VSTPluginInfo () {}
VSTPluginInfo ();
~VSTPluginInfo () {}
PluginPtr load (Session& session);

View File

@ -948,15 +948,18 @@ AudioRegion::recompute_at_end ()
_envelope->set_max_xval (_length);
_envelope->thaw ();
if (_left_of_split) {
set_default_fade_out ();
_left_of_split = false;
} else if (_fade_out->back()->when > _length) {
_fade_out->extend_to (_length);
send_change (PropertyChange (Properties::fade_out));
}
if (_fade_in->back()->when > _length) {
_fade_in->extend_to (_length);
send_change (PropertyChange (Properties::fade_in));
}
if (_fade_out->back()->when > _length) {
_fade_out->extend_to (_length);
send_change (PropertyChange (Properties::fade_out));
}
}
void
@ -966,7 +969,10 @@ AudioRegion::recompute_at_start ()
_envelope->truncate_start (_length);
if (_fade_in->back()->when > _length) {
if (_right_of_split) {
set_default_fade_in ();
_right_of_split = false;
} else if (_fade_in->back()->when > _length) {
_fade_in->extend_to (_length);
send_change (PropertyChange (Properties::fade_in));
}

View File

@ -548,22 +548,30 @@ AudioSource::read_peaks_with_fpp (PeakData *peaks, framecnt_t npeaks, framepos_t
to_read = min (chunksize, (framecnt_t)(_length - current_frame));
if (to_read == 0) {
/* XXX ARGH .. out by one error ... need to figure out why this happens
and fix it rather than do this band-aid move.
if (current_frame >= _length) {
/* hmm, error condition - we've reached the end of the file
without generating all the peak data. cook up a zero-filled
data buffer and then use it. this is simpler than
adjusting zero_fill and npeaks and then breaking out of
this loop early
*/
zero_fill = npeaks - nvisual_peaks;
npeaks -= zero_fill;
break;
}
if ((frames_read = read_unlocked (raw_staging, current_frame, to_read)) == 0) {
error << string_compose(_("AudioSource[%1]: peak read - cannot read %2 samples at offset %3 of %4 (%5)"),
_name, to_read, current_frame, _length, strerror (errno))
<< endmsg;
goto out;
}
memset (raw_staging, 0, sizeof (Sample) * chunksize);
} else {
to_read = min (chunksize, (_length - current_frame));
if ((frames_read = read_unlocked (raw_staging, current_frame, to_read)) == 0) {
error << string_compose(_("AudioSource[%1]: peak read - cannot read %2 samples at offset %3 of %4 (%5)"),
_name, to_read, current_frame, _length, strerror (errno))
<< endmsg;
goto out;
}
}
i = 0;
}

View File

@ -703,3 +703,8 @@ LadspaPluginInfo::load (Session& session)
return PluginPtr ((Plugin*) 0);
}
}
LadspaPluginInfo::LadspaPluginInfo()
{
type = ARDOUR::LADSPA;
}

View File

@ -680,6 +680,7 @@ LV2PluginInfo::LV2PluginInfo (void* lv2_world, void* slv2_plugin)
: _lv2_world(lv2_world)
, _slv2_plugin(slv2_plugin)
{
type = ARDOUR::LV2;
}
LV2PluginInfo::~LV2PluginInfo()

View File

@ -1004,7 +1004,7 @@ Playlist::partition_internal (framepos_t start, framepos_t end, bool cutting, Re
current->suspend_property_changes ();
thawlist.push_back (current);
current->trim_end (pos2, this);
current->cut_end (pos2, this);
} else if (overlap == OverlapEnd) {
@ -1043,7 +1043,7 @@ Playlist::partition_internal (framepos_t start, framepos_t end, bool cutting, Re
current->suspend_property_changes ();
thawlist.push_back (current);
current->trim_end (pos2, this);
current->cut_end (pos2, this);
} else if (overlap == OverlapStart) {

View File

@ -965,30 +965,7 @@ PluginInsert::signal_latency() const
ARDOUR::PluginType
PluginInsert::type ()
{
boost::shared_ptr<LadspaPlugin> lp;
#ifdef VST_SUPPORT
boost::shared_ptr<VSTPlugin> vp;
#endif
#ifdef HAVE_AUDIOUNITS
boost::shared_ptr<AUPlugin> ap;
#endif
PluginPtr other = plugin ();
if ((lp = boost::dynamic_pointer_cast<LadspaPlugin> (other)) != 0) {
return ARDOUR::LADSPA;
#ifdef VST_SUPPORT
} else if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (other)) != 0) {
return ARDOUR::VST;
#endif
#ifdef HAVE_AUDIOUNITS
} else if ((ap = boost::dynamic_pointer_cast<AUPlugin> (other)) != 0) {
return ARDOUR::AudioUnit;
#endif
} else {
/* NOT REACHED */
return (ARDOUR::PluginType) 0;
}
return plugin()->get_info()->type;
}
PluginInsert::PluginControl::PluginControl (PluginInsert* p, const Evoral::Parameter &param, boost::shared_ptr<AutomationList> list)

View File

@ -763,13 +763,31 @@ Region::trim_start (framepos_t new_position, void */*src*/)
void
Region::trim_front (framepos_t new_position, void *src)
{
modify_front (new_position, false, src);
}
void
Region::cut_front (nframes_t new_position, void *src)
{
modify_front (new_position, true, src);
}
void
Region::cut_end (nframes_t new_endpoint, void *src)
{
modify_end (new_endpoint, true, src);
}
void
Region::modify_front (nframes_t new_position, bool reset_fade, void *src)
{
if (locked()) {
return;
}
framepos_t end = last_frame();
framepos_t source_zero;
nframes_t end = last_frame();
nframes_t source_zero;
if (_position > _start) {
source_zero = _position - _start;
@ -778,44 +796,56 @@ Region::trim_front (framepos_t new_position, void *src)
}
if (new_position < end) { /* can't trim it zero or negative length */
framecnt_t newlen;
nframes_t newlen;
/* can't trim it back passed where source position zero is located */
new_position = max (new_position, source_zero);
if (new_position > _position) {
newlen = _length - (new_position - _position);
} else {
newlen = _length + (_position - new_position);
}
trim_to_internal (new_position, newlen, src);
if (!property_changes_suspended()) {
if (reset_fade) {
_right_of_split = true;
}
if (!property_changes_suspended()) {
recompute_at_start ();
}
}
}
void
Region::modify_end (nframes_t new_endpoint, bool reset_fade, void *src)
{
if (locked()) {
return;
}
if (new_endpoint > _position) {
trim_to_internal (_position, new_endpoint - _position +1, this);
if (reset_fade) {
_left_of_split = true;
}
if (!property_changes_suspended()) {
recompute_at_end ();
}
}
}
/** @param new_endpoint New region end point, such that, for example,
* a region at 0 of length 10 has an endpoint of 9.
*/
void
Region::trim_end (framepos_t new_endpoint, void */*src*/)
Region::trim_end (framepos_t new_endpoint, void* src)
{
if (locked()) {
return;
}
if (new_endpoint > _position) {
trim_to_internal (_position, new_endpoint - _position + 1, this);
if (!property_changes_suspended()) {
recompute_at_end ();
}
}
modify_end (new_endpoint, false, src);
}
void

View File

@ -17,6 +17,7 @@
*/
#include <strings.h>
#include <map>
#include <vector>
@ -177,6 +178,16 @@ sndfile_major_format(int format)
sf_command (0, SFC_GET_FORMAT_MAJOR,
&format_info, sizeof (format_info));
m[format_info.format & SF_FORMAT_TYPEMASK] = format_info.name;
/* normalize a couple of names rather than use what libsndfile gives us */
if (strncasecmp (format_info.name, "OGG", 3) == 0) {
m[format_info.format & SF_FORMAT_TYPEMASK] = "Ogg";
} else if (strncasecmp (format_info.name, "WAV", 3) == 0) {
m[format_info.format & SF_FORMAT_TYPEMASK] = "WAV";
} else {
m[format_info.format & SF_FORMAT_TYPEMASK] = format_info.name;
}
}
}

View File

@ -816,9 +816,15 @@ SndFileSource::get_soundfile_info (const ustring& path, SoundFileInfo& info, str
info.samplerate = sf_info.samplerate;
info.channels = sf_info.channels;
info.length = sf_info.frames;
info.format_name = string_compose("Format: %1, %2",
sndfile_major_format(sf_info.format),
sndfile_minor_format(sf_info.format));
string major = sndfile_major_format(sf_info.format);
string minor = sndfile_minor_format(sf_info.format);
if (major.length() + minor.length() < 16) { /* arbitrary */
info.format_name = string_compose("%1/%2", major, minor);
} else {
info.format_name = string_compose("%1\n%2", major, minor);
}
info.timecode = binfo.load_from_file (sf) ? binfo.get_time_reference() : 0;

View File

@ -524,3 +524,8 @@ VSTPluginInfo::load (Session& session)
return PluginPtr ((Plugin*) 0);
}
}
VSTPluginInfo::VSTPluginInfo()
{
type = ARDOUR::VST;
}