fix required library versions; fix use of shared_ptr by redirect_box; fix double delete of redirects; make delete event work only on button release, in general
git-svn-id: svn://localhost/ardour2/trunk@1193 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4566992139
commit
fd2de30612
|
@ -399,8 +399,8 @@ deps = \
|
|||
'gthread-2.0' : '2.10.1',
|
||||
'gtk+-2.0' : '2.8.1',
|
||||
'libxml-2.0' : '2.6.0',
|
||||
'samplerate' : '0.1.2',
|
||||
'raptor' : '1.4.8',
|
||||
'samplerate' : '0.1.0',
|
||||
'raptor' : '1.4.2',
|
||||
'lrdf' : '0.4.0',
|
||||
'jack' : '0.101.1',
|
||||
'libgnomecanvas-2.0' : '2.0'
|
||||
|
|
|
@ -597,7 +597,7 @@ Editor::Editor (AudioEngine& eng)
|
|||
|
||||
named_selection_display.get_selection()->set_mode (SELECTION_SINGLE);
|
||||
named_selection_display.set_size_request (100, -1);
|
||||
named_selection_display.signal_button_press_event().connect (mem_fun(*this, &Editor::named_selection_display_button_press), false);
|
||||
named_selection_display.signal_button_release_event().connect (mem_fun(*this, &Editor::named_selection_display_button_press), false);
|
||||
named_selection_display.get_selection()->signal_changed().connect (mem_fun (*this, &Editor::named_selection_display_selection_changed));
|
||||
|
||||
/* SNAPSHOTS */
|
||||
|
@ -1537,7 +1537,7 @@ Editor::build_track_region_context_menu (nframes_t frame)
|
|||
|
||||
if (atv) {
|
||||
boost::shared_ptr<Diskstream> ds;
|
||||
Playlist* pl;
|
||||
Playlist* pl = 0;
|
||||
|
||||
if ((ds = atv->get_diskstream()) && ((pl = ds->playlist()))) {
|
||||
Playlist::RegionList* regions = pl->regions_at ((nframes_t) floor ( (double)frame * ds->speed()));
|
||||
|
@ -1564,8 +1564,8 @@ Editor::build_track_crossfade_context_menu (nframes_t frame)
|
|||
|
||||
if (atv) {
|
||||
boost::shared_ptr<Diskstream> ds;
|
||||
Playlist* pl;
|
||||
AudioPlaylist* apl;
|
||||
Playlist* pl = 0;
|
||||
AudioPlaylist* apl = 0;
|
||||
|
||||
if ((ds = atv->get_diskstream()) && ((pl = ds->playlist()) != 0) && ((apl = dynamic_cast<AudioPlaylist*> (pl)) != 0)) {
|
||||
|
||||
|
|
|
@ -342,20 +342,15 @@ Editor::region_list_display_button_press (GdkEventButton *ev)
|
|||
}
|
||||
}
|
||||
|
||||
if (region == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Keyboard::is_delete_event (ev)) {
|
||||
session->remove_region_from_region_list (region);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Keyboard::is_context_menu_event (ev)) {
|
||||
show_region_list_display_context_menu (ev->button, ev->time);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (region == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (ev->button) {
|
||||
case 1:
|
||||
/* audition on double click */
|
||||
|
|
|
@ -79,7 +79,7 @@ Editor::named_selection_display_button_press (GdkEventButton *ev)
|
|||
case 1:
|
||||
if (Keyboard::is_delete_event (ev)) {
|
||||
session->remove_named_selection ((*i)[named_selection_columns.selection]);
|
||||
return stop_signal (named_selection_display, "button_press_event");
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
|
|
|
@ -137,11 +137,12 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, boost::shared_ptr<Rout
|
|||
pack_start (redirect_eventbox, true, true);
|
||||
|
||||
_route->redirects_changed.connect (mem_fun(*this, &RedirectBox::redisplay_redirects));
|
||||
_route->GoingAway.connect (mem_fun (*this, &RedirectBox::route_going_away));
|
||||
|
||||
redirect_eventbox.signal_enter_notify_event().connect (bind (sigc::ptr_fun (RedirectBox::enter_box), this));
|
||||
|
||||
redirect_display.signal_button_press_event().connect (mem_fun(*this, &RedirectBox::redirect_button_press_event), false);
|
||||
redirect_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::redirect_button_press_event));
|
||||
redirect_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::redirect_button_release_event));
|
||||
|
||||
/* start off as a passthru strip. we'll correct this, if necessary,
|
||||
in update_diskstream_display().
|
||||
|
@ -156,6 +157,13 @@ RedirectBox::~RedirectBox ()
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::route_going_away ()
|
||||
{
|
||||
/* don't keep updating display as redirects are deleted */
|
||||
no_redirect_redisplay = true;
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::object_drop (string type, uint32_t cnt, const boost::shared_ptr<Redirect>* ptr)
|
||||
{
|
||||
|
@ -283,13 +291,8 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev)
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
if (redirect && Keyboard::is_delete_event (ev)) {
|
||||
|
||||
Glib::signal_idle().connect (bind (mem_fun(*this, &RedirectBox::idle_delete_redirect), boost::weak_ptr<Redirect>(redirect)));
|
||||
ret = true;
|
||||
|
||||
} else if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS && ev->state == 0))) {
|
||||
|
||||
if (redirect && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS && ev->state == 0))) {
|
||||
|
||||
if (_session.engine().connected()) {
|
||||
/* XXX giving an error message here is hard, because we may be in the midst of a button press */
|
||||
|
@ -297,6 +300,42 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev)
|
|||
}
|
||||
ret = true;
|
||||
|
||||
} else if (redirect && ev->button == 1 && selected) {
|
||||
|
||||
// this is purely informational but necessary
|
||||
RedirectSelected (redirect); // emit
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool
|
||||
RedirectBox::redirect_button_release_event (GdkEventButton *ev)
|
||||
{
|
||||
TreeIter iter;
|
||||
TreeModel::Path path;
|
||||
TreeViewColumn* column;
|
||||
int cellx;
|
||||
int celly;
|
||||
boost::shared_ptr<Redirect> redirect;
|
||||
int ret = false;
|
||||
bool selected = false;
|
||||
|
||||
if (redirect_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
|
||||
if ((iter = model->get_iter (path))) {
|
||||
redirect = (*iter)[columns.redirect];
|
||||
selected = redirect_display.get_selection()->is_selected (iter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (redirect && Keyboard::is_delete_event (ev)) {
|
||||
|
||||
cerr << " redirect clicked was " << redirect->name() << endl;
|
||||
|
||||
Glib::signal_idle().connect (bind (mem_fun(*this, &RedirectBox::idle_delete_redirect), boost::weak_ptr<Redirect>(redirect)));
|
||||
ret = true;
|
||||
|
||||
} else if (Keyboard::is_context_menu_event (ev)) {
|
||||
|
||||
show_redirect_menu(ev->time);
|
||||
|
@ -308,12 +347,7 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev)
|
|||
ret = true;
|
||||
|
||||
}
|
||||
else if (redirect && ev->button == 1 && selected) {
|
||||
|
||||
// this is purely informational but necessary
|
||||
RedirectSelected (redirect); // emit
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -363,7 +397,7 @@ RedirectBox::insert_plugin_chosen (boost::shared_ptr<Plugin> plugin)
|
|||
|
||||
boost::shared_ptr<Redirect> redirect (new PluginInsert (_session, plugin, _placement));
|
||||
|
||||
redirect->active_changed.connect (bind (mem_fun (*this, &RedirectBox::show_redirect_active), boost::weak_ptr<Redirect>(redirect), (void*) 0));
|
||||
redirect->active_changed.connect (bind (mem_fun (*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr<Redirect>(redirect)));
|
||||
|
||||
uint32_t err_streams;
|
||||
|
||||
|
@ -441,7 +475,7 @@ void
|
|||
RedirectBox::choose_insert ()
|
||||
{
|
||||
boost::shared_ptr<Redirect> redirect (new PortInsert (_session, _placement));
|
||||
redirect->active_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_active), boost::weak_ptr<Redirect>(redirect)));
|
||||
redirect->active_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr<Redirect>(redirect)));
|
||||
_route->add_redirect (redirect, this);
|
||||
}
|
||||
|
||||
|
@ -491,7 +525,6 @@ RedirectBox::redisplay_redirects (void *src)
|
|||
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::redisplay_redirects), src));
|
||||
|
||||
if (no_redirect_redisplay) {
|
||||
cerr << "redisplay redirects skipped, no redisplay set\n";
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -526,9 +559,9 @@ RedirectBox::add_redirect_to_display (boost::shared_ptr<Redirect> redirect)
|
|||
row[columns.text] = redirect_name (redirect);
|
||||
row[columns.redirect] = redirect;
|
||||
|
||||
show_redirect_active (redirect, this);
|
||||
show_redirect_active (redirect);
|
||||
|
||||
redirect_active_connections.push_back (redirect->active_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_active), boost::weak_ptr<Redirect>(redirect))));
|
||||
redirect_active_connections.push_back (redirect->active_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_active_r), boost::weak_ptr<Redirect>(redirect))));
|
||||
redirect_name_connections.push_back (redirect->name_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_name), boost::weak_ptr<Redirect>(redirect))));
|
||||
}
|
||||
|
||||
|
@ -605,13 +638,19 @@ void
|
|||
RedirectBox::show_redirect_name (void* src, boost::weak_ptr<Redirect> redirect)
|
||||
{
|
||||
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_name), src, redirect));
|
||||
show_redirect_active (redirect, src);
|
||||
show_redirect_active (redirect);
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::show_redirect_active (void *src, boost::weak_ptr<Redirect> weak_redirect)
|
||||
RedirectBox::show_redirect_active_r (Redirect* r, void *src, boost::weak_ptr<Redirect> weak_redirect)
|
||||
{
|
||||
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_active), weak_redirect, src));
|
||||
show_redirect_active (weak_redirect);
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::show_redirect_active (boost::weak_ptr<Redirect> weak_redirect)
|
||||
{
|
||||
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_active), weak_redirect));
|
||||
|
||||
boost::shared_ptr<Redirect> redirect (weak_redirect.lock());
|
||||
|
||||
|
|
|
@ -151,17 +151,13 @@ class RedirectBox : public Gtk::HBox
|
|||
bool ignore_delete;
|
||||
|
||||
bool redirect_button_press_event (GdkEventButton *);
|
||||
bool redirect_button_release_event (GdkEventButton *);
|
||||
void redisplay_redirects (void* src);
|
||||
void add_redirect_to_display (boost::shared_ptr<ARDOUR::Redirect>);
|
||||
void row_deleted (const Gtk::TreeModel::Path& path);
|
||||
void show_redirect_name (void*, boost::weak_ptr<ARDOUR::Redirect>);
|
||||
|
||||
/* these are handlers for Redirect signals, so they take Redirect*
|
||||
directly, rather than shared_ptr<Redirect>
|
||||
*/
|
||||
|
||||
void show_redirect_active (boost::weak_ptr<ARDOUR::Redirect>, void *);
|
||||
|
||||
void show_redirect_active_r (ARDOUR::Redirect*, void *, boost::weak_ptr<ARDOUR::Redirect>);
|
||||
void show_redirect_active (boost::weak_ptr<ARDOUR::Redirect>);
|
||||
void show_redirect_name (void* src, boost::weak_ptr<ARDOUR::Redirect>);
|
||||
string redirect_name (boost::weak_ptr<ARDOUR::Redirect>);
|
||||
|
||||
void remove_redirect_gui (boost::shared_ptr<ARDOUR::Redirect>);
|
||||
|
|
|
@ -1146,7 +1146,7 @@ boost::shared_ptr<Region>
|
|||
RouteTimeAxisView::find_next_region (nframes_t pos, RegionPoint point, int32_t dir)
|
||||
{
|
||||
boost::shared_ptr<Diskstream> stream;
|
||||
Playlist *playlist;
|
||||
Playlist *playlist = 0;
|
||||
|
||||
if ((stream = get_diskstream()) != 0 && (playlist = stream->playlist()) != 0) {
|
||||
return playlist->find_next_region (pos, point, dir);
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include <pbd/pathscanner.h>
|
||||
#include <pbd/stl_delete.h>
|
||||
#include <pbd/basename.h>
|
||||
#include <pbd/stacktrace.h>
|
||||
|
||||
#include <ardour/audioengine.h>
|
||||
#include <ardour/configuration.h>
|
||||
|
@ -3313,21 +3314,19 @@ Session::remove_redirect (Redirect* redirect)
|
|||
PortInsert* port_insert;
|
||||
PluginInsert* plugin_insert;
|
||||
|
||||
cerr << "Removing a redirect!\n";
|
||||
|
||||
if ((insert = dynamic_cast<Insert *> (redirect)) != 0) {
|
||||
if ((port_insert = dynamic_cast<PortInsert *> (insert)) != 0) {
|
||||
_port_inserts.remove (port_insert);
|
||||
} else if ((plugin_insert = dynamic_cast<PluginInsert *> (insert)) != 0) {
|
||||
_plugin_inserts.remove (plugin_insert);
|
||||
} else {
|
||||
fatal << _("programming error: unknown type of Insert deleted!") << endmsg;
|
||||
fatal << string_compose (_("programming error: %1"),
|
||||
X_("unknown type of Insert deleted!"))
|
||||
<< endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
} else if ((send = dynamic_cast<Send *> (redirect)) != 0) {
|
||||
cerr << "Remove send, used to have " << _sends.size() << endl;
|
||||
_sends.remove (send);
|
||||
cerr << "post removal, have " << _sends.size() << endl;
|
||||
} else {
|
||||
fatal << _("programming error: unknown type of Redirect deleted!") << endmsg;
|
||||
/*NOTREACHED*/
|
||||
|
@ -3349,6 +3348,13 @@ Session::available_capture_duration ()
|
|||
case FormatInt24:
|
||||
sample_bytes_on_disk = 3;
|
||||
break;
|
||||
|
||||
default:
|
||||
/* impossible, but keep some gcc versions happy */
|
||||
fatal << string_compose (_("programming error: %1"),
|
||||
X_("illegal native file data format"))
|
||||
<< endmsg;
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
double scale = 4096.0 / sample_bytes_on_disk;
|
||||
|
|
Loading…
Reference in New Issue
Block a user