summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-07-27 16:52:14 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-07-27 16:52:14 +0000
commitcc2767caf32486365a33814149e75c6e588e8603 (patch)
tree9d41c606a20ba2e2bb43be653e42050d38293a2e /gtk2_ardour
parentd23fec7b9a0f076256dbd71faae254a78efbe37a (diff)
added RCU handling of Session route list, and major use of shared_ptr<T> everywhere else. plus a few bug fixes for issues discovered with -Wextra
git-svn-id: svn://localhost/ardour2/trunk@707 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/SConscript2
-rw-r--r--gtk2_ardour/ardour.menus4
-rw-r--r--gtk2_ardour/ardour_ui.cc6
-rw-r--r--gtk2_ardour/audio_time_axis.cc102
-rw-r--r--gtk2_ardour/audio_time_axis.h20
-rw-r--r--gtk2_ardour/automation_time_axis.cc4
-rw-r--r--gtk2_ardour/automation_time_axis.h7
-rw-r--r--gtk2_ardour/crossfade_edit.cc6
-rw-r--r--gtk2_ardour/editing_syms.h1
-rw-r--r--gtk2_ardour/editor.cc6
-rw-r--r--gtk2_ardour/editor.h4
-rw-r--r--gtk2_ardour/editor_actions.cc2
-rw-r--r--gtk2_ardour/editor_audio_import.cc30
-rw-r--r--gtk2_ardour/editor_export_audio.cc2
-rw-r--r--gtk2_ardour/editor_mixer.cc4
-rw-r--r--gtk2_ardour/editor_route_list.cc33
-rw-r--r--gtk2_ardour/editor_timefx.cc2
-rw-r--r--gtk2_ardour/export_dialog.cc8
-rw-r--r--gtk2_ardour/gain_automation_time_axis.cc6
-rw-r--r--gtk2_ardour/gain_automation_time_axis.h2
-rw-r--r--gtk2_ardour/gain_meter.cc54
-rw-r--r--gtk2_ardour/gain_meter.h4
-rw-r--r--gtk2_ardour/io_selector.cc84
-rw-r--r--gtk2_ardour/io_selector.h12
-rw-r--r--gtk2_ardour/mixer_strip.cc114
-rw-r--r--gtk2_ardour/mixer_strip.h4
-rw-r--r--gtk2_ardour/mixer_ui.cc41
-rw-r--r--gtk2_ardour/mixer_ui.h4
-rw-r--r--gtk2_ardour/pan_automation_time_axis.cc5
-rw-r--r--gtk2_ardour/pan_automation_time_axis.h10
-rw-r--r--gtk2_ardour/panner_ui.cc94
-rw-r--r--gtk2_ardour/panner_ui.h4
-rw-r--r--gtk2_ardour/playlist_selector.cc6
-rw-r--r--gtk2_ardour/plugin_selector.cc2
-rw-r--r--gtk2_ardour/plugin_selector.h2
-rw-r--r--gtk2_ardour/plugin_ui.cc92
-rw-r--r--gtk2_ardour/plugin_ui.h14
-rw-r--r--gtk2_ardour/redirect_automation_line.cc2
-rw-r--r--gtk2_ardour/redirect_automation_time_axis.cc3
-rw-r--r--gtk2_ardour/redirect_automation_time_axis.h2
-rw-r--r--gtk2_ardour/redirect_box.cc217
-rw-r--r--gtk2_ardour/redirect_box.h54
-rw-r--r--gtk2_ardour/redirect_selection.h3
-rw-r--r--gtk2_ardour/route_params_ui.cc125
-rw-r--r--gtk2_ardour/route_params_ui.h17
-rw-r--r--gtk2_ardour/route_redirect_selection.cc55
-rw-r--r--gtk2_ardour/route_redirect_selection.h18
-rw-r--r--gtk2_ardour/route_selection.h4
-rw-r--r--gtk2_ardour/route_ui.cc143
-rw-r--r--gtk2_ardour/route_ui.h16
-rw-r--r--gtk2_ardour/selection.cc10
-rw-r--r--gtk2_ardour/selection.h9
-rw-r--r--gtk2_ardour/send_ui.cc14
-rw-r--r--gtk2_ardour/send_ui.h6
-rw-r--r--gtk2_ardour/sfdb_ui.cc6
55 files changed, 752 insertions, 749 deletions
diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript
index 68e07ebd22..c5409d7f8b 100644
--- a/gtk2_ardour/SConscript
+++ b/gtk2_ardour/SConscript
@@ -141,8 +141,6 @@ marker.cc
marker_time_axis.cc
marker_time_axis_view.cc
marker_view.cc
-meter_bridge.cc
-meter_bridge_strip.cc
mixer_strip.cc
mixer_ui.cc
new_session_dialog.cc
diff --git a/gtk2_ardour/ardour.menus b/gtk2_ardour/ardour.menus
index 9293883067..b1064b8e87 100644
--- a/gtk2_ardour/ardour.menus
+++ b/gtk2_ardour/ardour.menus
@@ -15,8 +15,10 @@
<separator/>
<menu action='addExistingAudioFiles'>
<menuitem action='addExternalAudioAsRegion'/>
- <menuitem action='addExternalAudioAsTrack'/>
<menuitem action='addExternalAudioToTrack'/>
+ <separator/>
+ <menuitem action='addExternalAudioAsTrack'/>
+ <menuitem action='addExternalAudioAsTapeTrack'/>
</menu>
<separator/>
<menu name='Export' action='Export'>
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 732c829a38..c9116ac4e9 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -876,7 +876,7 @@ ARDOUR_UI::session_add_midi_track ()
void
ARDOUR_UI::session_add_audio_route (bool disk, int32_t input_channels, int32_t output_channels, ARDOUR::TrackMode mode)
{
- Route* route;
+ boost::shared_ptr<Route> route;
if (session == 0) {
warning << _("You cannot add a track without a session already loaded.") << endmsg;
@@ -1165,13 +1165,13 @@ ARDOUR_UI::toggle_record_enable (uint32_t dstream)
return;
}
- Route* r;
+ boost::shared_ptr<Route> r;
if ((r = session->route_by_remote_id (dstream)) != 0) {
AudioTrack* at;
- if ((at = dynamic_cast<AudioTrack*>(r)) != 0) {
+ if ((at = dynamic_cast<AudioTrack*>(r.get())) != 0) {
at->disk_stream().set_record_enabled (!at->disk_stream().record_enabled(), this);
}
}
diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc
index 42bf3f5647..5f6d29f9ff 100644
--- a/gtk2_ardour/audio_time_axis.cc
+++ b/gtk2_ardour/audio_time_axis.cc
@@ -86,7 +86,7 @@ using namespace Gtk;
using namespace Editing;
-AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt, Canvas& canvas)
+AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::shared_ptr<Route> rt, Canvas& canvas)
: AxisView(sess),
RouteUI(rt, sess, _("m"), _("s"), _("r")), // mute, solo, and record
TimeAxisView(sess,ed,(TimeAxisView*) 0, canvas),
@@ -211,12 +211,12 @@ AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, Route& rt
set_state (*xml_node);
- _route.mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
- _route.solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
- _route.redirects_changed.connect (mem_fun(*this, &AudioTimeAxisView::redirects_changed));
- _route.name_changed.connect (mem_fun(*this, &AudioTimeAxisView::route_name_changed));
- _route.solo_safe_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
- _route.panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans));
+ _route->mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
+ _route->solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
+ _route->redirects_changed.connect (mem_fun(*this, &AudioTimeAxisView::redirects_changed));
+ _route->name_changed.connect (mem_fun(*this, &AudioTimeAxisView::route_name_changed));
+ _route->solo_safe_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
+ _route->panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans));
if (is_audio_track()) {
@@ -321,7 +321,7 @@ gint
AudioTimeAxisView::edit_click (GdkEventButton *ev)
{
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
- _route.set_edit_group (0, this);
+ _route->set_edit_group (0, this);
return FALSE;
}
@@ -334,7 +334,7 @@ AudioTimeAxisView::edit_click (GdkEventButton *ev)
items.push_back (RadioMenuElem (group, _("No group"),
bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), (RouteGroup *) 0)));
- if (_route.edit_group() == 0) {
+ if (_route->edit_group() == 0) {
static_cast<RadioMenuItem*>(&items.back())->set_active ();
}
@@ -354,7 +354,7 @@ AudioTimeAxisView::add_edit_group_menu_item (RouteGroup *eg, RadioMenuItem::Grou
cerr << "adding edit group called " << eg->name() << endl;
items.push_back (RadioMenuElem (*group, eg->name(), bind (mem_fun(*this, &AudioTimeAxisView::set_edit_group_from_menu), eg)));
- if (_route.edit_group() == eg) {
+ if (_route->edit_group() == eg) {
static_cast<RadioMenuItem*>(&items.back())->set_active ();
}
}
@@ -363,7 +363,7 @@ void
AudioTimeAxisView::set_edit_group_from_menu (RouteGroup *eg)
{
- _route.set_edit_group (eg, this);
+ _route->set_edit_group (eg, this);
}
void
@@ -387,7 +387,7 @@ AudioTimeAxisView::playlist_changed ()
void
AudioTimeAxisView::label_view ()
{
- string x = _route.name();
+ string x = _route->name();
if (x != name_entry.get_text()) {
name_entry.set_text (x);
@@ -460,14 +460,14 @@ AudioTimeAxisView::show_timestretch (jack_nframes_t start, jack_nframes_t end)
remember that edit_group() == 0 implies the route is *not* in a edit group.
*/
- if (!(ts.track == this || (ts.group != 0 && ts.group == _route.edit_group()))) {
+ if (!(ts.track == this || (ts.group != 0 && ts.group == _route->edit_group()))) {
/* this doesn't apply to us */
return;
}
/* ignore it if our edit group is not active */
- if ((ts.track != this) && _route.edit_group() && !_route.edit_group()->is_active()) {
+ if ((ts.track != this) && _route->edit_group() && !_route->edit_group()->is_active()) {
return;
}
#endif
@@ -515,8 +515,8 @@ AudioTimeAxisView::show_selection (TimeSelection& ts)
that the track is not in an edit group).
*/
- if (((ts.track != this && !is_child (ts.track)) && _route.edit_group() && !_route.edit_group()->is_active()) ||
- (!(ts.track == this || is_child (ts.track) || (ts.group != 0 && ts.group == _route.edit_group())))) {
+ if (((ts.track != this && !is_child (ts.track)) && _route->edit_group() && !_route->edit_group()->is_active()) ||
+ (!(ts.track == this || is_child (ts.track) || (ts.group != 0 && ts.group == _route->edit_group())))) {
hide_selection ();
return;
}
@@ -631,13 +631,13 @@ AudioTimeAxisView::set_height (TrackHeight h)
controls_table.show ();
hide_name_entry ();
show_name_label ();
- name_label.set_text (_route.name());
+ name_label.set_text (_route->name());
break;
}
if (height_changed) {
/* only emit the signal if the height really changed */
- _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
}
@@ -788,7 +788,7 @@ AudioTimeAxisView::build_display_menu ()
items.push_back (SeparatorElem());
items.push_back (CheckMenuElem (_("Active"), mem_fun(*this, &RouteUI::toggle_route_active)));
route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
- route_active_menu_item->set_active (_route.active());
+ route_active_menu_item->set_active (_route->active());
items.push_back (SeparatorElem());
items.push_back (MenuElem (_("Remove"), mem_fun(*this, &RouteUI::remove_this_route)));
@@ -1002,7 +1002,7 @@ AudioTimeAxisView::update_diskstream_display ()
void
AudioTimeAxisView::selection_click (GdkEventButton* ev)
{
- PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route.edit_group());
+ PublicEditor::TrackViewList* tracks = editor.get_valid_views (this, _route->edit_group());
switch (Keyboard::selection_type (ev->state)) {
case Selection::Toggle:
@@ -1082,13 +1082,13 @@ AudioTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectable*>&
RouteGroup*
AudioTimeAxisView::edit_group() const
{
- return _route.edit_group();
+ return _route->edit_group();
}
string
AudioTimeAxisView::name() const
{
- return _route.name();
+ return _route->name();
}
Playlist *
@@ -1110,22 +1110,22 @@ AudioTimeAxisView::name_entry_changed ()
x = name_entry.get_text ();
- if (x == _route.name()) {
+ if (x == _route->name()) {
return;
}
if (x.length() == 0) {
- name_entry.set_text (_route.name());
+ name_entry.set_text (_route->name());
return;
}
strip_whitespace_edges(x);
if (_session.route_name_unique (x)) {
- _route.set_name (x, this);
+ _route->set_name (x, this);
} else {
ARDOUR_UI::instance()->popup_error (_("a track already exists with that name"));
- name_entry.set_text (_route.name());
+ name_entry.set_text (_route->name());
}
}
@@ -1166,13 +1166,13 @@ AudioTimeAxisView::add_gain_automation_child ()
*this,
parent_canvas,
_("gain"),
- _route.gain_automation_curve());
+ _route->gain_automation_curve());
line = new AutomationGainLine ("automation gain",
_session,
*gain_track,
*gain_track->canvas_display,
- _route.gain_automation_curve());
+ _route->gain_automation_curve());
line->set_line_color (color_map[cAutomationLine]);
@@ -1241,11 +1241,11 @@ AudioTimeAxisView::update_pans ()
/* we don't draw lines for "greater than stereo" panning.
*/
- if (_route.n_outputs() > 2) {
+ if (_route->n_outputs() > 2) {
return;
}
- for (p = _route.panner().begin(); p != _route.panner().end(); ++p) {
+ for (p = _route->panner().begin(); p != _route->panner().end(); ++p) {
AutomationLine* line;
@@ -1253,7 +1253,7 @@ AudioTimeAxisView::update_pans ()
*pan_track->canvas_display,
(*p)->automation());
- if (p == _route.panner().begin()) {
+ if (p == _route->panner().begin()) {
/* first line is a nice orange */
line->set_line_color (color_map[cLeftPanAutomationLine]);
} else {
@@ -1285,7 +1285,7 @@ AudioTimeAxisView::toggle_gain_track ()
/* now trigger a redisplay */
if (!no_redraw) {
- _route.gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
}
}
}
@@ -1299,7 +1299,7 @@ AudioTimeAxisView::gain_hidden ()
gain_automation_item->set_active (false);
}
- _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
void
@@ -1321,7 +1321,7 @@ AudioTimeAxisView::toggle_pan_track ()
/* now trigger a redisplay */
if (!no_redraw) {
- _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
}
}
@@ -1335,7 +1335,7 @@ AudioTimeAxisView::pan_hidden ()
pan_automation_item->set_active (false);
}
- _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
AudioTimeAxisView::RedirectAutomationInfo::~RedirectAutomationInfo ()
@@ -1364,7 +1364,7 @@ AudioTimeAxisView::remove_ran (RedirectAutomationNode* ran)
}
AudioTimeAxisView::RedirectAutomationNode*
-AudioTimeAxisView::find_redirect_automation_node (Redirect *redirect, uint32_t what)
+AudioTimeAxisView::find_redirect_automation_node (boost::shared_ptr<Redirect> redirect, uint32_t what)
{
for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ++i) {
@@ -1401,7 +1401,7 @@ legalize_for_xml_node (string str)
void
-AudioTimeAxisView::add_redirect_automation_curve (Redirect *redirect, uint32_t what)
+AudioTimeAxisView::add_redirect_automation_curve (boost::shared_ptr<Redirect> redirect, uint32_t what)
{
RedirectAutomationLine* ral;
string name;
@@ -1454,7 +1454,7 @@ AudioTimeAxisView::add_redirect_automation_curve (Redirect *redirect, uint32_t w
}
void
-AudioTimeAxisView::redirect_automation_track_hidden (AudioTimeAxisView::RedirectAutomationNode* ran, Redirect* r)
+AudioTimeAxisView::redirect_automation_track_hidden (AudioTimeAxisView::RedirectAutomationNode* ran, boost::shared_ptr<Redirect> r)
{
if (!_hidden) {
ran->menu_item->set_active (false);
@@ -1462,11 +1462,11 @@ AudioTimeAxisView::redirect_automation_track_hidden (AudioTimeAxisView::Redirect
r->mark_automation_visible (ran->what, false);
- _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
void
-AudioTimeAxisView::add_existing_redirect_automation_curves (Redirect *redirect)
+AudioTimeAxisView::add_existing_redirect_automation_curves (boost::shared_ptr<Redirect> redirect)
{
set<uint32_t> s;
RedirectAutomationLine *ral;
@@ -1484,7 +1484,7 @@ AudioTimeAxisView::add_existing_redirect_automation_curves (Redirect *redirect)
}
void
-AudioTimeAxisView::add_redirect_to_subplugin_menu (Redirect* r)
+AudioTimeAxisView::add_redirect_to_subplugin_menu (boost::shared_ptr<Redirect> r)
{
using namespace Menu_Helpers;
RedirectAutomationInfo *rai;
@@ -1598,7 +1598,7 @@ AudioTimeAxisView::redirect_menu_item_toggled (AudioTimeAxisView::RedirectAutoma
/* now trigger a redisplay */
- _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
}
@@ -1614,8 +1614,8 @@ AudioTimeAxisView::redirects_changed (void *src)
subplugin_menu.items().clear ();
- _route.foreach_redirect (this, &AudioTimeAxisView::add_redirect_to_subplugin_menu);
- _route.foreach_redirect (this, &AudioTimeAxisView::add_existing_redirect_automation_curves);
+ _route->foreach_redirect (this, &AudioTimeAxisView::add_redirect_to_subplugin_menu);
+ _route->foreach_redirect (this, &AudioTimeAxisView::add_existing_redirect_automation_curves);
for (list<RedirectAutomationInfo*>::iterator i = redirect_automation.begin(); i != redirect_automation.end(); ) {
@@ -1636,11 +1636,11 @@ AudioTimeAxisView::redirects_changed (void *src)
/* change in visibility was possible */
- _route.gui_changed ("track_height", this);
+ _route->gui_changed ("track_height", this);
}
RedirectAutomationLine *
-AudioTimeAxisView::find_redirect_automation_curve (Redirect *redirect, uint32_t what)
+AudioTimeAxisView::find_redirect_automation_curve (boost::shared_ptr<Redirect> redirect, uint32_t what)
{
RedirectAutomationNode* ran;
@@ -1673,7 +1673,7 @@ AudioTimeAxisView::show_all_automation ()
no_redraw = false;
- _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
void
@@ -1694,7 +1694,7 @@ AudioTimeAxisView::show_existing_automation ()
no_redraw = false;
- _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
void
@@ -1712,7 +1712,7 @@ AudioTimeAxisView::hide_all_automation ()
}
no_redraw = false;
- _route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
bool
@@ -1931,7 +1931,7 @@ AudioTimeAxisView::route_active_changed ()
RouteUI::route_active_changed ();
if (is_audio_track()) {
- if (_route.active()) {
+ if (_route->active()) {
controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
controls_base_selected_name = "AudioTrackControlsBaseSelected";
controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
@@ -1941,7 +1941,7 @@ AudioTimeAxisView::route_active_changed ()
controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
}
} else {
- if (_route.active()) {
+ if (_route->active()) {
controls_ebox.set_name ("BusControlsBaseUnselected");
controls_base_selected_name = "BusControlsBaseSelected";
controls_base_unselected_name = "BusControlsBaseUnselected";
diff --git a/gtk2_ardour/audio_time_axis.h b/gtk2_ardour/audio_time_axis.h
index b319d0ea99..8a7cf4f9a2 100644
--- a/gtk2_ardour/audio_time_axis.h
+++ b/gtk2_ardour/audio_time_axis.h
@@ -77,7 +77,7 @@ class AutomationTimeAxisView;
class AudioTimeAxisView : public RouteUI, public TimeAxisView
{
public:
- AudioTimeAxisView (PublicEditor&, ARDOUR::Session&, ARDOUR::Route&, ArdourCanvas::Canvas& canvas);
+ AudioTimeAxisView (PublicEditor&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, ArdourCanvas::Canvas& canvas);
virtual ~AudioTimeAxisView ();
void show_selection (TimeSelection&);
@@ -177,7 +177,7 @@ class AudioTimeAxisView : public RouteUI, public TimeAxisView
void redirect_edit ();
void redirect_relist ();
void redirect_row_selected (gint row, gint col, GdkEvent *ev);
- void add_to_redirect_display (ARDOUR::Redirect *);
+ void add_to_redirect_display (boost::shared_ptr<ARDOUR::Redirect>);
void redirects_changed (void *);
sigc::connection modified_connection;
@@ -259,33 +259,33 @@ class AudioTimeAxisView : public RouteUI, public TimeAxisView
};
struct RedirectAutomationInfo {
- ARDOUR::Redirect* redirect;
+ boost::shared_ptr<ARDOUR::Redirect> redirect;
bool valid;
Gtk::Menu* menu;
vector<RedirectAutomationNode*> lines;
- RedirectAutomationInfo (ARDOUR::Redirect* r)
+ RedirectAutomationInfo (boost::shared_ptr<ARDOUR::Redirect> r)
: redirect (r), valid (true) {}
~RedirectAutomationInfo ();
};
list<RedirectAutomationInfo*> redirect_automation;
- RedirectAutomationNode* find_redirect_automation_node (ARDOUR::Redirect *redirect, uint32_t what);
+ RedirectAutomationNode* find_redirect_automation_node (boost::shared_ptr<ARDOUR::Redirect> redirect, uint32_t what);
Gtk::Menu subplugin_menu;
- void add_redirect_to_subplugin_menu (ARDOUR::Redirect *);
+ void add_redirect_to_subplugin_menu (boost::shared_ptr<ARDOUR::Redirect>);
void remove_ran (RedirectAutomationNode* ran);
void redirect_menu_item_toggled (AudioTimeAxisView::RedirectAutomationInfo*,
AudioTimeAxisView::RedirectAutomationNode*);
- void redirect_automation_track_hidden (RedirectAutomationNode*, ARDOUR::Redirect*);
+ void redirect_automation_track_hidden (RedirectAutomationNode*, boost::shared_ptr<ARDOUR::Redirect>);
vector<RedirectAutomationLine*> redirect_automation_curves;
- RedirectAutomationLine *find_redirect_automation_curve (ARDOUR::Redirect*,uint32_t);
- void add_redirect_automation_curve (ARDOUR::Redirect*, uint32_t);
- void add_existing_redirect_automation_curves (ARDOUR::Redirect*);
+ RedirectAutomationLine *find_redirect_automation_curve (boost::shared_ptr<ARDOUR::Redirect>,uint32_t);
+ void add_redirect_automation_curve (boost::shared_ptr<ARDOUR::Redirect>, uint32_t);
+ void add_existing_redirect_automation_curves (boost::shared_ptr<ARDOUR::Redirect>);
ArdourCanvas::SimpleRect *timestretch_rect;
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index 90a9544f97..02a88b578b 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -20,7 +20,7 @@ using namespace PBD;
using namespace Gtk;
using namespace Editing;
-AutomationTimeAxisView::AutomationTimeAxisView (Session& s, Route& r, PublicEditor& e, TimeAxisView& rent,
+AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Route> r, PublicEditor& e, TimeAxisView& rent,
ArdourCanvas::Canvas& canvas, const string & nom,
const string & state_name, const string & nomparent)
@@ -410,7 +410,7 @@ AutomationTimeAxisView::set_height (TrackHeight ht)
if (changed) {
/* only emit the signal if the height really changed */
- route.gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
}
diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h
index b4d434610d..0c72ed14f9 100644
--- a/gtk2_ardour/automation_time_axis.h
+++ b/gtk2_ardour/automation_time_axis.h
@@ -4,6 +4,9 @@
#include <vector>
#include <list>
#include <string>
+
+#include <boost/shared_ptr.hpp>
+
#include <ardour/types.h>
#include "canvas.h"
@@ -31,7 +34,7 @@ class Selectable;
class AutomationTimeAxisView : public TimeAxisView {
public:
AutomationTimeAxisView (ARDOUR::Session&,
- ARDOUR::Route&,
+ boost::shared_ptr<ARDOUR::Route>,
PublicEditor&,
TimeAxisView& parent,
ArdourCanvas::Canvas& canvas,
@@ -75,7 +78,7 @@ class AutomationTimeAxisView : public TimeAxisView {
XMLNode* get_state_node ();
protected:
- ARDOUR::Route& route;
+ boost::shared_ptr<ARDOUR::Route> route;
ArdourCanvas::SimpleRect* base_rect;
string _name;
string _state_name;
diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc
index 5b587594de..b2967dc4a9 100644
--- a/gtk2_ardour/crossfade_edit.cc
+++ b/gtk2_ardour/crossfade_edit.cc
@@ -1077,7 +1077,7 @@ CrossfadeEditor::peaks_ready (AudioRegion* r, WhichFade which)
void
CrossfadeEditor::audition_both ()
{
- AudioPlaylist& pl (session.the_auditioner().prepare_playlist());
+ AudioPlaylist& pl (session.the_auditioner()->prepare_playlist());
jack_nframes_t preroll;
jack_nframes_t postroll;
jack_nframes_t length;
@@ -1140,7 +1140,7 @@ CrossfadeEditor::audition_left_dry ()
void
CrossfadeEditor::audition_left ()
{
- AudioPlaylist& pl (session.the_auditioner().prepare_playlist());
+ AudioPlaylist& pl (session.the_auditioner()->prepare_playlist());
AudioRegion* left = new AudioRegion (xfade.out(), xfade.out().length() - xfade.length(), xfade.length(), "xfade left",
0, Region::DefaultFlags, false);
@@ -1172,7 +1172,7 @@ CrossfadeEditor::audition_right_dry ()
void
CrossfadeEditor::audition_right ()
{
- AudioPlaylist& pl (session.the_auditioner().prepare_playlist());
+ AudioPlaylist& pl (session.the_auditioner()->prepare_playlist());
AudioRegion* left = new AudioRegion (xfade.out(), xfade.out().length() - xfade.length(), xfade.length(), "xfade out",
0, Region::DefaultFlags, false);
diff --git a/gtk2_ardour/editing_syms.h b/gtk2_ardour/editing_syms.h
index cf36550fb4..654ddc8852 100644
--- a/gtk2_ardour/editing_syms.h
+++ b/gtk2_ardour/editing_syms.h
@@ -56,4 +56,5 @@ DISPLAYCONTROL(ShowWaveformsRecording)
IMPORTMODE(ImportAsRegion)
IMPORTMODE(ImportAsTrack)
+IMPORTMODE(ImportAsTapeTrack)
IMPORTMODE(ImportToTrack)
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 24b367e921..95bcf785f9 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -1376,7 +1376,7 @@ Editor::connect_to_session (Session *t)
AudioTimeAxisView *atv;
if ((atv = dynamic_cast<AudioTimeAxisView*>(tv)) != 0) {
- if (atv->route().master()) {
+ if (atv->route()->master()) {
route_list_display.get_selection()->unselect (i);
}
}
@@ -3054,7 +3054,7 @@ Editor::get_relevant_audio_tracks (AudioTimeAxisView& base, set<AudioTimeAxisVie
continue;
}
- RouteGroup* group = atv->route().edit_group();
+ RouteGroup* group = atv->route()->edit_group();
if (group && group->is_active()) {
@@ -3066,7 +3066,7 @@ Editor::get_relevant_audio_tracks (AudioTimeAxisView& base, set<AudioTimeAxisVie
if ((tatv = dynamic_cast<AudioTimeAxisView*> (*i)) != 0) {
- if (tatv->route().edit_group() == group) {
+ if (tatv->route()->edit_group() == group) {
relevant_tracks.insert (tatv);
}
}
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 9e2fda142e..bfc49b7d0d 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -459,8 +459,8 @@ class Editor : public PublicEditor
void add_crossfade_context_items (StreamView*, ARDOUR::Crossfade*, Gtk::Menu_Helpers::MenuList&, bool many);
void add_selection_context_items (Gtk::Menu_Helpers::MenuList&);
- void handle_new_route (ARDOUR::Route&);
- void handle_new_route_p (ARDOUR::Route*);
+ void handle_new_route (boost::shared_ptr<ARDOUR::Route>);
+ void handle_new_route_p (boost::shared_ptr<ARDOUR::Route>);
void remove_route (TimeAxisView *);
bool route_removal;
diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc
index e20e6ee8eb..65195ca822 100644
--- a/gtk2_ardour/editor_actions.cc
+++ b/gtk2_ardour/editor_actions.cc
@@ -357,6 +357,8 @@ Editor::register_actions ()
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, X_("addExternalAudioAsTrack"), _("as Tracks"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsTrack));
ActionManager::session_sensitive_actions.push_back (act);
+ act = ActionManager::register_action (editor_actions, X_("addExternalAudioAsTapeTrack"), _("as Tape Tracks"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportAsTapeTrack));
+ ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (editor_actions, X_("addExternalAudioToTrack"), _("to Tracks"), bind (mem_fun(*this, &Editor::add_external_audio_action), ImportToTrack));
ActionManager::session_sensitive_actions.push_back (act);
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc
index f3e2ee1cb2..68c481aa01 100644
--- a/gtk2_ardour/editor_audio_import.cc
+++ b/gtk2_ardour/editor_audio_import.cc
@@ -267,7 +267,7 @@ Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool
idspec += string_compose(":%1", n);
try {
- source = AudioFileSource::create (idspec.c_str());
+ source = AudioFileSource::create (idspec.c_str(), (mode == ImportAsTrack ? AudioFileSource::Destructive : AudioFileSource::Flag (0)));
sources.push_back(source);
}
@@ -305,12 +305,14 @@ Editor::embed_sndfile (Glib::ustring path, bool split, bool multiple_files, bool
}
int
- Editor::finish_bringing_in_audio (AudioRegion& region, uint32_t in_chans, uint32_t out_chans, AudioTrack* track, jack_nframes_t& pos, ImportMode mode)
- {
- switch (mode) {
- case ImportAsRegion:
- /* relax, its been done */
- break;
+Editor::finish_bringing_in_audio (AudioRegion& region, uint32_t in_chans, uint32_t out_chans, AudioTrack* track, jack_nframes_t& pos, ImportMode mode)
+{
+ AudioRegion* copy;
+
+ switch (mode) {
+ case ImportAsRegion:
+ /* relax, its been done */
+ break;
case ImportToTrack:
if (track) {
@@ -328,12 +330,22 @@ int
break;
case ImportAsTrack:
- AudioTrack* at = session->new_audio_track (in_chans, out_chans);
- AudioRegion* copy = new AudioRegion (region);
+ {
+ boost::shared_ptr<AudioTrack> at (session->new_audio_track (in_chans, out_chans, Normal));
+ copy = new AudioRegion (region);
at->disk_stream().playlist()->add_region (*copy, pos);
break;
}
+ case ImportAsTapeTrack:
+ {
+ boost::shared_ptr<AudioTrack> at (session->new_audio_track (in_chans, out_chans, Destructive));
+ copy = new AudioRegion (region);
+ at->disk_stream().playlist()->add_region (*copy, pos);
+ break;
+ }
+ }
+
return 0;
}
diff --git a/gtk2_ardour/editor_export_audio.cc b/gtk2_ardour/editor_export_audio.cc
index 7339536e42..0be0a61b23 100644
--- a/gtk2_ardour/editor_export_audio.cc
+++ b/gtk2_ardour/editor_export_audio.cc
@@ -140,7 +140,7 @@ Editor::bounce_region_selection ()
AudioRegion& region ((*i)->region);
AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*>(&(*i)->get_time_axis_view());
- AudioTrack* track = dynamic_cast<AudioTrack*>(&(atv->route()));
+ AudioTrack* track = dynamic_cast<AudioTrack*>(atv->route().get());
InterThreadInfo itt;
diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc
index a55b6f2066..1418ece574 100644
--- a/gtk2_ardour/editor_mixer.cc
+++ b/gtk2_ardour/editor_mixer.cc
@@ -131,7 +131,7 @@ Editor::set_selected_mixer_strip (TimeAxisView& view)
/* might be nothing to do */
- if (&current_mixer_strip->route() == &at->route()) {
+ if (current_mixer_strip->route() == at->route()) {
return;
}
@@ -221,7 +221,7 @@ Editor::current_mixer_strip_hidden ()
AudioTimeAxisView* tmp;
if ((tmp = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
- if (&(tmp->route()) == &(current_mixer_strip->route())) {
+ if (tmp->route() == current_mixer_strip->route()) {
(*i)->set_selected (false);
break;
}
diff --git a/gtk2_ardour/editor_route_list.cc b/gtk2_ardour/editor_route_list.cc
index 95ac358095..12240dfb13 100644
--- a/gtk2_ardour/editor_route_list.cc
+++ b/gtk2_ardour/editor_route_list.cc
@@ -39,21 +39,21 @@ using namespace PBD;
using namespace Gtk;
void
-Editor::handle_new_route_p (Route* route)
+Editor::handle_new_route_p (boost::shared_ptr<Route> route)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::handle_new_route_p), route));
- handle_new_route (*route);
+ handle_new_route (route);
}
void
-Editor::handle_new_route (Route& route)
+Editor::handle_new_route (boost::shared_ptr<Route> route)
{
TimeAxisView *tv;
AudioTimeAxisView *atv;
TreeModel::Row parent;
TreeModel::Row row;
- if (route.hidden()) {
+ if (route->hidden()) {
return;
}
@@ -75,7 +75,7 @@ Editor::handle_new_route (Route& route)
}
- if (dynamic_cast<AudioTrack*>(&route) != 0) {
+ if (dynamic_cast<AudioTrack*>(route.get()) != 0) {
TreeModel::iterator iter = route_display_model->get_iter ("1"); // audio tracks
parent = *iter;
} else {
@@ -89,7 +89,7 @@ Editor::handle_new_route (Route& route)
row = *(route_display_model->append ());
#endif
- row[route_display_columns.text] = route.name();
+ row[route_display_columns.text] = route->name();
row[route_display_columns.visible] = tv->marked_for_display();
row[route_display_columns.tv] = tv;
@@ -99,14 +99,14 @@ Editor::handle_new_route (Route& route)
if ((atv = dynamic_cast<AudioTimeAxisView*> (tv)) != 0) {
/* added a new fresh one at the end */
- if (atv->route().order_key(N_("editor")) == -1) {
- atv->route().set_order_key (N_("editor"), route_display_model->children().size()-1);
+ if (atv->route()->order_key(N_("editor")) == -1) {
+ atv->route()->set_order_key (N_("editor"), route_display_model->children().size()-1);
}
}
ignore_route_list_reorder = false;
- route.gui_changed.connect (mem_fun(*this, &Editor::handle_gui_changes));
+ route->gui_changed.connect (mem_fun(*this, &Editor::handle_gui_changes));
tv->GoingAway.connect (bind (mem_fun(*this, &Editor::remove_route), tv));
@@ -188,7 +188,7 @@ Editor::hide_track_in_display (TimeAxisView& tv)
AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (&tv);
- if (atv && current_mixer_strip && &(atv->route()) == &(current_mixer_strip->route())) {
+ if (atv && current_mixer_strip && (atv->route() == current_mixer_strip->route())) {
// this will hide the mixer strip
set_selected_mixer_strip (tv);
}
@@ -244,7 +244,7 @@ Editor::redisplay_route_list ()
*/
if ((at = dynamic_cast<AudioTimeAxisView*> (tv)) != 0) {
- at->route().set_order_key (N_("editor"), order);
+ at->route()->set_order_key (N_("editor"), order);
++order;
}
}
@@ -477,7 +477,7 @@ Editor::route_list_selection_filter (const Glib::RefPtr<TreeModel>& model, const
}
struct EditorOrderRouteSorter {
- bool operator() (Route* a, Route* b) {
+ bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
/* use of ">" forces the correct sort order */
return a->order_key ("editor") < b->order_key ("editor");
}
@@ -486,17 +486,18 @@ struct EditorOrderRouteSorter {
void
Editor::initial_route_list_display ()
{
- Session::RouteList routes = session->get_routes();
+ boost::shared_ptr<Session::RouteList> routes = session->get_routes();
+ Session::RouteList r (*routes);
EditorOrderRouteSorter sorter;
- routes.sort (sorter);
+ r.sort (sorter);
no_route_list_redisplay = true;
route_display_model->clear ();
- for (Session::RouteList::iterator i = routes.begin(); i != routes.end(); ++i) {
- handle_new_route (**i);
+ for (Session::RouteList::iterator i = r.begin(); i != r.end(); ++i) {
+ handle_new_route (*i);
}
no_route_list_redisplay = false;
diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc
index 6ff467454d..278ab57ebd 100644
--- a/gtk2_ardour/editor_timefx.cc
+++ b/gtk2_ardour/editor_timefx.cc
@@ -179,7 +179,7 @@ Editor::do_timestretch (TimeStretchDialog& dialog)
continue;
}
- if ((at = dynamic_cast<AudioTrack*> (&atv->route())) == 0) {
+ if ((at = atv->audio_track()) == 0) {
i = tmp;
continue;
}
diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc
index bcf8cd85ad..b5a4757090 100644
--- a/gtk2_ardour/export_dialog.cc
+++ b/gtk2_ardour/export_dialog.cc
@@ -1082,11 +1082,11 @@ ExportDialog::fill_lists ()
track_list->clear();
master_list->clear();
- Session::RouteList routes = session->get_routes ();
+ boost::shared_ptr<Session::RouteList> routes = session->get_routes ();
- for (Session::RouteList::iterator ri = routes.begin(); ri != routes.end(); ++ri) {
-
- Route* route = (*ri);
+ for (Session::RouteList::iterator ri = routes->begin(); ri != routes->end(); ++ri) {
+
+ boost::shared_ptr<Route> route = (*ri);
if (route->hidden()) {
continue;
diff --git a/gtk2_ardour/gain_automation_time_axis.cc b/gtk2_ardour/gain_automation_time_axis.cc
index 8f41f5def0..5352015f11 100644
--- a/gtk2_ardour/gain_automation_time_axis.cc
+++ b/gtk2_ardour/gain_automation_time_axis.cc
@@ -31,7 +31,9 @@ using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
-GainAutomationTimeAxisView::GainAutomationTimeAxisView (Session& s, Route& r, PublicEditor& e, TimeAxisView& parent, ArdourCanvas::Canvas& canvas, const string & n, ARDOUR::Curve& c)
+GainAutomationTimeAxisView::GainAutomationTimeAxisView (Session& s, boost::shared_ptr<Route> r,
+ PublicEditor& e, TimeAxisView& parent,
+ ArdourCanvas::Canvas& canvas, const string & n, ARDOUR::Curve& c)
: AxisView (s),
AutomationTimeAxisView (s, r, e, parent, canvas, n, X_("gain"), ""),
@@ -72,6 +74,6 @@ void
GainAutomationTimeAxisView::set_automation_state (AutoState state)
{
if (!ignore_state_request) {
- route.set_gain_automation_state (state);
+ route->set_gain_automation_state (state);
}
}
diff --git a/gtk2_ardour/gain_automation_time_axis.h b/gtk2_ardour/gain_automation_time_axis.h
index 50f1cba3f9..dc6d5bd28e 100644
--- a/gtk2_ardour/gain_automation_time_axis.h
+++ b/gtk2_ardour/gain_automation_time_axis.h
@@ -13,7 +13,7 @@ class GainAutomationTimeAxisView : public AutomationTimeAxisView
{
public:
GainAutomationTimeAxisView (ARDOUR::Session&,
- ARDOUR::Route&,
+ boost::shared_ptr<ARDOUR::Route>,
PublicEditor&,
TimeAxisView& parent_axis,
ArdourCanvas::Canvas& canvas,
diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc
index 7fa2c33335..5fa8c462bc 100644
--- a/gtk2_ardour/gain_meter.cc
+++ b/gtk2_ardour/gain_meter.cc
@@ -79,7 +79,7 @@ GainMeter::setup_slider_pix ()
return 0;
}
-GainMeter::GainMeter (IO& io, Session& s)
+GainMeter::GainMeter (boost::shared_ptr<IO> io, Session& s)
: _io (io),
_session (s),
gain_slider (0),
@@ -99,7 +99,7 @@ GainMeter::GainMeter (IO& io, Session& s)
gain_slider = manage (new VSliderController (slider, rail,
&gain_adjustment,
- _io.gain_control(),
+ _io->gain_control(),
false));
gain_slider->signal_button_press_event().connect (mem_fun(*this, &GainMeter::start_gain_touch));
@@ -152,7 +152,7 @@ GainMeter::GainMeter (IO& io, Session& s)
Route* r;
- if ((r = dynamic_cast<Route*> (&_io)) != 0) {
+ if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
/*
if we don't have a route (if we're the click),
pack some route-dependent stuff.
@@ -165,13 +165,13 @@ GainMeter::GainMeter (IO& io, Session& s)
using namespace Menu_Helpers;
gain_astate_menu.items().push_back (MenuElem (_("Off"),
- bind (mem_fun (&_io, &IO::set_gain_automation_state), (AutoState) Off)));
+ bind (mem_fun (*_io, &IO::set_gain_automation_state), (AutoState) Off)));
gain_astate_menu.items().push_back (MenuElem (_("Play"),
- bind (mem_fun (&_io, &IO::set_gain_automation_state), (AutoState) Play)));
+ bind (mem_fun (*_io, &IO::set_gain_automation_state), (AutoState) Play)));
gain_astate_menu.items().push_back (MenuElem (_("Write"),
- bind (mem_fun (&_io, &IO::set_gain_automation_state), (AutoState) Write)));
+ bind (mem_fun (*_io, &IO::set_gain_automation_state), (AutoState) Write)));
gain_astate_menu.items().push_back (MenuElem (_("Touch"),
- bind (mem_fun (&_io, &IO::set_gain_automation_state), (AutoState) Touch)));
+ bind (mem_fun (*_io, &IO::set_gain_automation_state), (AutoState) Touch)));
gain_astyle_menu.items().push_back (MenuElem (_("Trim")));
gain_astyle_menu.items().push_back (MenuElem (_("Abs")));
@@ -195,7 +195,7 @@ GainMeter::GainMeter (IO& io, Session& s)
pack_start (gain_display_box, Gtk::PACK_SHRINK);
pack_start (hbox, Gtk::PACK_SHRINK);
- _io.gain_changed.connect (mem_fun(*this, &GainMeter::gain_changed));
+ _io->gain_changed.connect (mem_fun(*this, &GainMeter::gain_changed));
meter_metric_area.signal_expose_event().connect (mem_fun(*this, &GainMeter::meter_metrics_expose));
gain_adjustment.signal_value_changed().connect (mem_fun(*this, &GainMeter::gain_adjusted));
@@ -323,7 +323,7 @@ GainMeter::update_meters ()
for (n = 0, i = meters.begin(); i != meters.end(); ++i, ++n) {
if ((*i).packed) {
- peak = _io.peak_input_power (n);
+ peak = _io->peak_input_power (n);
(*i).meter->set (log_meter (peak), peak);
@@ -382,14 +382,14 @@ GainMeter::hide_all_meters ()
void
GainMeter::setup_meters ()
{
- uint32_t nmeters = _io.n_outputs();
+ uint32_t nmeters = _io->n_outputs();
guint16 width;
hide_all_meters ();
Route* r;
- if ((r = dynamic_cast<Route*> (&_io)) != 0) {
+ if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
switch (r->meter_point()) {
case MeterPreFader:
@@ -403,7 +403,7 @@ GainMeter::setup_meters ()
} else {
- nmeters = _io.n_outputs();
+ nmeters = _io->n_outputs();
}
@@ -451,7 +451,7 @@ GainMeter::peak_button_release (GdkEventButton* ev)
ResetAllPeakDisplays ();
} else if (ev->button == 1 && Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
Route* r;
- if ((r = dynamic_cast<Route*> (&_io)) != 0) {
+ if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
ResetGroupPeakDisplays (r->mix_group());
}
} else {
@@ -472,7 +472,7 @@ void
GainMeter::reset_group_peak_display (RouteGroup* group)
{
Route* r;
- if ((r = dynamic_cast<Route*> (&_io)) != 0) {
+ if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
if (group == r->mix_group()) {
reset_peak_display ();
}
@@ -541,14 +541,14 @@ void
GainMeter::gain_adjusted ()
{
if (!ignore_toggle) {
- _io.set_gain (slider_position_to_gain (gain_adjustment.get_value()), this);
+ _io->set_gain (slider_position_to_gain (gain_adjustment.get_value()), this);
}
}
void
GainMeter::effective_gain_display ()
{
- gfloat value = gain_to_slider_position (_io.effective_gain());
+ gfloat value = gain_to_slider_position (_io->effective_gain());
if (gain_adjustment.get_value() != value) {
ignore_toggle = true;
@@ -578,7 +578,7 @@ GainMeter::set_fader_name (const char * name)
void
GainMeter::update_gain_sensitive ()
{
- static_cast<Gtkmm2ext::SliderController*>(gain_slider)->set_sensitive (!(_io.gain_automation_state() & Play));
+ static_cast<Gtkmm2ext::SliderController*>(gain_slider)->set_sensitive (!(_io->gain_automation_state() & Play));
}
@@ -609,7 +609,7 @@ GainMeter::meter_press(GdkEventButton* ev)
wait_for_release = false;
- if ((_route = dynamic_cast<Route*>(&_io)) == 0) {
+ if ((_route = dynamic_cast<Route*>(_io.get())) == 0) {
return FALSE;
}
@@ -671,7 +671,7 @@ GainMeter::meter_release(GdkEventButton* ev)
if(!ignore_toggle){
if (wait_for_release){
wait_for_release = false;
- set_meter_point (*(dynamic_cast<Route*>(&_io)), old_meter_point);
+ set_meter_point (*(dynamic_cast<Route*>(_io.get())), old_meter_point);
}
}
return true;
@@ -700,7 +700,7 @@ GainMeter::meter_point_clicked ()
{
Route* r;
- if ((r = dynamic_cast<Route*> (&_io)) != 0) {
+ if ((r = dynamic_cast<Route*> (_io.get())) != 0) {
}
}
@@ -708,14 +708,14 @@ GainMeter::meter_point_clicked ()
gint
GainMeter::start_gain_touch (GdkEventButton* ev)
{
- _io.start_gain_touch ();
+ _io->start_gain_touch ();
return FALSE;
}
gint
GainMeter::end_gain_touch (GdkEventButton* ev)
{
- _io.end_gain_touch ();
+ _io->end_gain_touch ();
return FALSE;
}
@@ -819,10 +819,10 @@ GainMeter::gain_automation_style_changed ()
// Route* _route = dynamic_cast<Route*>(&_io);
switch (_width) {
case Wide:
- gain_automation_style_button.set_label (astyle_string(_io.gain_automation_curve().automation_style()));
+ gain_automation_style_button.set_label (astyle_string(_io->gain_automation_curve().automation_style()));
break;
case Narrow:
- gain_automation_style_button.set_label (short_astyle_string(_io.gain_automation_curve().automation_style()));
+ gain_automation_style_button.set_label (short_astyle_string(_io->gain_automation_curve().automation_style()));
break;
}
}
@@ -837,14 +837,14 @@ GainMeter::gain_automation_state_changed ()
switch (_width) {
case Wide:
- gain_automation_state_button.set_label (astate_string(_io.gain_automation_curve().automation_state()));
+ gain_automation_state_button.set_label (astate_string(_io->gain_automation_curve().automation_state()));
break;
case Narrow:
- gain_automation_state_button.set_label (short_astate_string(_io.gain_automation_curve().automation_state()));
+ gain_automation_state_button.set_label (short_astate_string(_io->gain_automation_curve().automation_state()));
break;
}
- x = (_io.gain_automation_state() != Off);
+ x = (_io->gain_automation_state() != Off);
if (gain_automation_state_button.get_active() != x) {
ignore_toggle = true;
diff --git a/gtk2_ardour/gain_meter.h b/gtk2_ardour/gain_meter.h
index 0ed09ee383..1dfc088248 100644
--- a/gtk2_ardour/gain_meter.h
+++ b/gtk2_ardour/gain_meter.h
@@ -56,7 +56,7 @@ namespace Gtk {
class GainMeter : public Gtk::VBox
{
public:
- GainMeter (ARDOUR::IO&, ARDOUR::Session&);
+ GainMeter (boost::shared_ptr<ARDOUR::IO>, ARDOUR::Session&);
~GainMeter ();
void update_gain_sensitive ();
@@ -75,7 +75,7 @@ class GainMeter : public Gtk::VBox
private:
friend class MixerStrip;
- ARDOUR::IO& _io;
+ boost::shared_ptr<ARDOUR::IO> _io;
ARDOUR::Session& _session;
bool ignore_toggle;
diff --git a/gtk2_ardour/io_selector.cc b/gtk2_ardour/io_selector.cc
index b0ecd05077..f754435112 100644
--- a/gtk2_ardour/io_selector.cc
+++ b/gtk2_ardour/io_selector.cc
@@ -52,7 +52,7 @@ using namespace ARDOUR;
using namespace PBD;
using namespace Gtkmm2ext;
-IOSelectorWindow::IOSelectorWindow (Session& sess, IO& ior, bool input, bool can_cancel)
+IOSelectorWindow::IOSelectorWindow (Session& sess, boost::shared_ptr<IO> ior, bool input, bool can_cancel)
: ArdourDialog ("i/o selector"),
_selector (sess, ior, input),
ok_button (can_cancel ? _("OK"): _("Close")),
@@ -65,9 +65,9 @@ IOSelectorWindow::IOSelectorWindow (Session& sess, IO& ior, bool input, bool can
string title;
if (input) {
- title = string_compose(_("%1 input"), ior.name());
+ title = string_compose(_("%1 input"), ior->name());
} else {
- title = string_compose(_("%1 output"), ior.name());
+ title = string_compose(_("%1 output"), ior->name());
}
ok_button.set_name ("IOSelectorButton");
@@ -135,7 +135,7 @@ IOSelectorWindow::on_map ()
The IO Selector "widget"
*************************/
-IOSelector::IOSelector (Session& sess, IO& ior, bool input)
+IOSelector::IOSelector (Session& sess, boost::shared_ptr<IO> ior, bool input)
: session (sess),
io (ior),
for_input (input),
@@ -184,14 +184,14 @@ IOSelector::IOSelector (Session& sess, IO& ior, bool input)
port_button_box.pack_start (add_port_button, false, false);
if (for_input) {
- if (io.input_maximum() < 0 || io.input_maximum() > (int) io.n_inputs()) {
+ if (io->input_maximum() < 0 || io->input_maximum() > (int) io->n_inputs()) {
add_port_button.set_sensitive (true);
} else {
add_port_button.set_sensitive (false);
}
} else {
- if (io.output_maximum() < 0 || io.output_maximum() > (int) io.n_outputs()) {
+ if (io->output_maximum() < 0 || io->output_maximum() > (int) io->n_outputs()) {
add_port_button.set_sensitive (true);
} else {
add_port_button.set_sensitive (false);
@@ -202,14 +202,14 @@ IOSelector::IOSelector (Session& sess, IO& ior, bool input)
port_button_box.pack_start (remove_port_button, false, false);
if (for_input) {
- if (io.input_minimum() < 0 || io.input_minimum() < (int) io.n_inputs()) {
+ if (io->input_minimum() < 0 || io->input_minimum() < (int) io->n_inputs()) {
remove_port_button.set_sensitive (true);
} else {
remove_port_button.set_sensitive (false);
}
} else {
- if (io.output_minimum() < 0 || io.output_minimum() < (int) io.n_outputs()) {
+ if (io->output_minimum() < 0 || io->output_minimum() < (int) io->n_outputs()) {
remove_port_button.set_sensitive (true);
} else {
remove_port_button.set_sensitive (false);
@@ -241,12 +241,12 @@ IOSelector::IOSelector (Session& sess, IO& ior, bool input)
remove_port_button.signal_clicked().connect (mem_fun(*this, &IOSelector::remove_port));
if (for_input) {
- io.input_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
+ io->input_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
} else {
- io.output_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
+ io->output_changed.connect (mem_fun(*this, &IOSelector::ports_changed));
}
- io.name_changed.connect (mem_fun(*this, &IOSelector::name_changed));
+ io->name_changed.connect (mem_fun(*this, &IOSelector::name_changed));
}
IOSelector::~IOSelector ()
@@ -265,9 +265,9 @@ void
IOSelector::clear_connections ()
{
if (for_input) {
- io.disconnect_inputs (this);
+ io->disconnect_inputs (this);
} else {
- io.disconnect_outputs (this);
+ io->disconnect_outputs (this);
}
}
@@ -374,9 +374,9 @@ IOSelector::display_ports ()
uint32_t limit;
if (for_input) {
- limit = io.n_inputs();
+ limit = io->n_inputs();
} else {
- limit = io.n_outputs();
+ limit = io->n_outputs();
}
for (slist<TreeView *>::iterator i = port_displays.begin(); i != port_displays.end(); ) {
@@ -401,9 +401,9 @@ IOSelector::display_ports ()
string really_short_name;
if (for_input) {
- port = io.input (n);
+ port = io->input (n);
} else {
- port = io.output (n);
+ port = io->output (n);
}
/* we know there is '/' because we put it there */
@@ -443,7 +443,7 @@ IOSelector::display_ports ()
if (for_input) {
- if (io.input_maximum() == 1) {
+ if (io->input_maximum() == 1) {
selected_port = port;
selected_port_tview = tview;
} else {
@@ -454,7 +454,7 @@ IOSelector::display_ports ()
} else {
- if (io.output_maximum() == 1) {
+ if (io->output_maximum() == 1) {
selected_port = port;
selected_port_tview = tview;
} else {
@@ -516,12 +516,12 @@ IOSelector::port_selection_changed (GdkEventButton *ev, TreeView* treeview)
ustring other_port_name = (*i)[port_display_columns.full_name];
if (for_input) {
- if ((status = io.connect_input (selected_port, other_port_name, this)) == 0) {
+ if ((status = io->connect_input (selected_port, other_port_name, this)) == 0) {
Port *p = session.engine().get_port_by_name (other_port_name);
p->enable_metering();
}
} else {
- status = io.connect_output (selected_port, other_port_name, this);
+ status = io->connect_output (selected_port, other_port_name, this);
}
if (status == 0) {
@@ -548,7 +548,7 @@ IOSelector::add_port ()
if (for_input) {
try {
- io.add_input_port ("", this);
+ io->add_input_port ("", this);
}
catch (AudioEngine::PortRegistrationFailure& err) {
@@ -556,18 +556,18 @@ IOSelector::add_port ()
msg.run ();
}
- if (io.input_maximum() >= 0 && io.input_maximum() <= (int) io.n_inputs()) {
+ if (io->input_maximum() >= 0 && io->input_maximum() <= (int) io->n_inputs()) {
add_port_button.set_sensitive (false);
}
- if (io.input_minimum() < (int) io.n_inputs()) {
+ if (io->input_minimum() < (int) io->n_inputs()) {
remove_port_button.set_sensitive (true);
}
} else {
try {
- io.add_output_port ("", this);
+ io->add_output_port ("", this);
}
catch (AudioEngine::PortRegistrationFailure& err) {
@@ -575,7 +575,7 @@ IOSelector::add_port ()
msg.run ();
}
- if (io.output_maximum() >= 0 && io.output_maximum() <= (int) io.n_outputs()) {
+ if (io->output_maximum() >= 0 && io->output_maximum() <= (int) io->n_outputs()) {
add_port_button.set_sensitive (false);
}
}
@@ -589,15 +589,15 @@ IOSelector::remove_port ()
// always remove last port
if (for_input) {
- if ((nports = io.n_inputs()) > 0) {
- io.remove_input_port (io.input(nports-1), this);
+ if ((nports = io->n_inputs()) > 0) {
+ io->remove_input_port (io->input(nports-1), this);
}
- if (io.input_minimum() == (int) io.n_inputs()) {
+ if (io->input_minimum() == (int) io->n_inputs()) {
remove_port_button.set_sensitive (false);
}
} else {
- if ((nports = io.n_outputs()) > 0) {
- io.remove_output_port (io.output(nports-1), this);
+ if ((nports = io->n_outputs()) > 0) {
+ io->remove_output_port (io->output(nports-1), this);
}
}
}
@@ -606,9 +606,9 @@ gint
IOSelector::remove_port_when_idle (Port *port)
{
if (for_input) {
- io.remove_input_port (port, this);
+ io->remove_input_port (port, this);
} else {
- io.remove_output_port (port, this);
+ io->remove_output_port (port, this);
}
return FALSE;
@@ -651,9 +651,9 @@ IOSelector::connection_button_release (GdkEventButton *ev, TreeView *treeview)
if (for_input) {
Port *p = session.engine().get_port_by_name (connected_port_name);
p->disable_metering();
- io.disconnect_input (port, connected_port_name, this);
+ io->disconnect_input (port, connected_port_name, this);
} else {
- io.disconnect_output (port, connected_port_name, this);
+ io->disconnect_output (port, connected_port_name, this);
}
}
@@ -749,17 +749,17 @@ IOSelector::redisplay ()
display_ports ();
if (for_input) {
- if (io.input_maximum() != 0) {
+ if (io->input_maximum() != 0) {
rescan ();
}
} else {
- if (io.output_maximum() != 0) {
+ if (io->output_maximum() != 0) {
rescan();
}
}
}
-PortInsertUI::PortInsertUI (Session& sess, PortInsert& pi)
+PortInsertUI::PortInsertUI (Session& sess, boost::shared_ptr<PortInsert> pi)
: input_selector (sess, pi, true),
output_selector (sess, pi, false)
{
@@ -786,9 +786,9 @@ PortInsertUI::finished(IOSelector::Result r)
}
-PortInsertWindow::PortInsertWindow (Session& sess, PortInsert& pi, bool can_cancel)
+PortInsertWindow::PortInsertWindow (Session& sess, boost::shared_ptr<PortInsert> pi, bool can_cancel)
: ArdourDialog ("port insert dialog"),
- _portinsertui(sess, pi),
+ _portinsertui (sess, pi),
ok_button (can_cancel ? _("OK"): _("Close")),
cancel_button (_("Cancel")),
rescan_button (_("Rescan"))
@@ -796,7 +796,7 @@ PortInsertWindow::PortInsertWindow (Session& sess, PortInsert& pi, bool can_canc
set_name ("IOSelectorWindow");
string title = _("ardour: ");
- title += pi.name();
+ title += pi->name();
set_title (title);
ok_button.set_name ("IOSelectorButton");
@@ -823,7 +823,7 @@ PortInsertWindow::PortInsertWindow (Session& sess, PortInsert& pi, bool can_canc
rescan_button.signal_clicked().connect (mem_fun(*this, &PortInsertWindow::rescan));
signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window *> (this)));
- pi.GoingAway.connect (mem_fun(*this, &PortInsertWindow::plugin_going_away));
+ pi->GoingAway.connect (mem_fun(*this, &PortInsertWindow::plugin_going_away));
}
void
diff --git a/gtk2_ardour/io_selector.h b/gtk2_ardour/io_selector.h
index 44518e6759..993d4aa1ad 100644
--- a/gtk2_ardour/io_selector.h
+++ b/gtk2_ardour/io_selector.h
@@ -53,7 +53,7 @@ namespace ARDOUR {
class IOSelector : public Gtk::VBox {
public:
- IOSelector (ARDOUR::Session&, ARDOUR::IO&, bool for_input);
+ IOSelector (ARDOUR::Session&, boost::shared_ptr<ARDOUR::IO>, bool for_input);
~IOSelector ();
void redisplay ();
@@ -67,9 +67,9 @@ class IOSelector : public Gtk::VBox {
protected:
ARDOUR::Session& session;
-
+
private:
- ARDOUR::IO& io;
+ boost::shared_ptr<ARDOUR::IO> io;
bool for_input;
ARDOUR::Port *selected_port;
@@ -135,7 +135,7 @@ class IOSelector : public Gtk::VBox {
class IOSelectorWindow : public ArdourDialog
{
public:
- IOSelectorWindow (ARDOUR::Session&, ARDOUR::IO&, bool for_input, bool can_cancel=false);
+ IOSelectorWindow (ARDOUR::Session&, boost::shared_ptr<ARDOUR::IO>, bool for_input, bool can_cancel=false);
~IOSelectorWindow ();
IOSelector& selector() { return _selector; }
@@ -162,7 +162,7 @@ class IOSelectorWindow : public ArdourDialog
class PortInsertUI : public Gtk::VBox
{
public:
- PortInsertUI (ARDOUR::Session&, ARDOUR::PortInsert&);
+ PortInsertUI (ARDOUR::Session&, boost::shared_ptr<ARDOUR::PortInsert>);
void redisplay ();
void finished (IOSelector::Result);
@@ -178,7 +178,7 @@ class PortInsertUI : public Gtk::VBox
class PortInsertWindow : public ArdourDialog
{
public:
- PortInsertWindow (ARDOUR::Session&, ARDOUR::PortInsert&, bool can_cancel=false);
+ PortInsertWindow (ARDOUR::Session&, boost::shared_ptr<ARDOUR::PortInsert>, bool can_cancel=false);
protected:
void on_map ();
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 9913e483fa..1313fc4082 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -80,7 +80,7 @@ speed_printer (char buf[32], Gtk::Adjustment& adj, void* arg)
}
#endif
-MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
+MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr<Route> rt, bool in_mixer)
: AxisView(sess),
RouteUI (rt, sess, _("Mute"), _("Solo"), _("Record")),
_mixer(mx),
@@ -125,12 +125,12 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
output_button.set_name ("MixerIOButton");
output_label.set_name ("MixerIOButtonLabel");
- _route.meter_change.connect (mem_fun(*this, &MixerStrip::meter_changed));
+ _route->meter_change.connect (mem_fun(*this, &MixerStrip::meter_changed));
meter_point_button.add (meter_point_label);
meter_point_button.set_name ("MixerStripMeterPreButton");
meter_point_label.set_name ("MixerStripMeterPreButton");
- switch (_route.meter_point()) {
+ switch (_route->meter_point()) {
case MeterInput:
meter_point_label.set_text (_("input"));
break;
@@ -191,7 +191,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
rec_enable_button->unset_flags (Gtk::CAN_FOCUS);
rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press));
- AudioTrack* at = dynamic_cast<AudioTrack*>(&_route);
+ AudioTrack* at = audio_track();
at->FreezeChange.connect (mem_fun(*this, &MixerStrip::map_frozen));
@@ -217,10 +217,10 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
Gtkmm2ext::set_size_request_to_display_given_text (name_button, "longest label", 2, 2);
name_label.set_name ("MixerNameButtonLabel");
- if (_route.phase_invert()) {
+ if (_route->phase_invert()) {
name_label.set_text (X_("Ø ") + name_label.get_text());
} else {
- name_label.set_text (_route.name());
+ name_label.set_text (_route->name());
}
group_button.add (group_label);
@@ -229,9 +229,9 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
comment_button.set_name ("MixerCommentButton");
- ARDOUR_UI::instance()->tooltips().set_tip (comment_button, _route.comment()=="" ?
+ ARDOUR_UI::instance()->tooltips().set_tip (comment_button, _route->comment()=="" ?
_("Click to Add/Edit Comments"):
- _route.comment());
+ _route->comment());
comment_button.signal_clicked().connect (mem_fun(*this, &MixerStrip::comment_button_clicked));
@@ -281,22 +281,22 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, Route& rt, bool in_mixer)
_session.engine().Stopped.connect (mem_fun(*this, &MixerStrip::engine_stopped));
_session.engine().Running.connect (mem_fun(*this, &MixerStrip::engine_running));
- _route.input_changed.connect (mem_fun(*this, &MixerStrip::input_changed));
- _route.output_changed.connect (mem_fun(*this, &MixerStrip::output_changed));
- _route.mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
- _route.solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
- _route.solo_safe_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
- _route.mix_group_changed.connect (mem_fun(*this, &MixerStrip::mix_group_changed));
- _route.panner().Changed.connect (mem_fun(*this, &MixerStrip::connect_to_pan));
+ _route->input_changed.connect (mem_fun(*this, &MixerStrip::input_changed));
+ _route->output_changed.connect (mem_fun(*this, &MixerStrip::output_changed));
+ _route->mute_changed.connect (mem_fun(*this, &RouteUI::mute_changed));
+ _route->solo_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
+ _route->solo_safe_changed.connect (mem_fun(*this, &RouteUI::solo_changed));
+ _route->mix_group_changed.connect (mem_fun(*this, &MixerStrip::mix_group_changed));
+ _route->panner().Changed.connect (mem_fun(*this, &MixerStrip::connect_to_pan));
if (is_audio_track()) {
audio_track()->diskstream_changed.connect (mem_fun(*this, &MixerStrip::diskstream_changed));
get_diskstream()->speed_changed.connect (mem_fun(*this, &MixerStrip::speed_changed));
}
- _route.name_changed.connect (mem_fun(*this, &RouteUI::name_changed));
- _route.comment_changed.connect (mem_fun(*this, &MixerStrip::comment_changed));
- _route.gui_changed.connect (mem_fun(*this, &MixerStrip::route_gui_changed));
+ _route->name_changed.connect (mem_fun(*this, &RouteUI::name_changed));
+ _route->comment_changed.connect (mem_fun(*this, &MixerStrip::comment_changed));
+ _route->gui_changed.connect (mem_fun(*this, &MixerStrip::route_gui_changed));
input_button.signal_button_press_event().connect (mem_fun(*this, &MixerStrip::input_press), false);
output_button.signal_button_press_event().connect (mem_fun(*this, &MixerStrip::output_press), false);
@@ -419,16 +419,16 @@ MixerStrip::set_width (Width w)
mute_button->set_label (_("mute"));
solo_button->set_label (_("solo"));
- if (_route.comment() == "") {
+ if (_route->comment() == "") {
comment_button.set_label (_("comments"));
} else {
comment_button.set_label (_("*comments*"));
}
- gpm.gain_automation_style_button.set_label (gpm.astyle_string(_route.gain_automation_curve().automation_style()));
- gpm.gain_automation_state_button.set_label (gpm.astate_string(_route.gain_automation_curve().automation_state()));
- panners.pan_automation_style_button.set_label (panners.astyle_string(_route.panner().automation_style()));
- panners.pan_automation_state_button.set_label (panners.astate_string(_route.panner().automation_state()));
+ gpm.gain_automation_style_button.set_label (gpm.astyle_string(_route->gain_automation_curve().automation_style()));
+ gpm.gain_automation_state_button.set_label (gpm.astate_string(_route->gain_automation_curve().automation_state()));
+ panners.pan_automation_style_button.set_label (panners.astyle_string(_route->panner().automation_style()));
+ panners.pan_automation_state_button.set_label (panners.astate_string(_route->panner().automation_state()));
Gtkmm2ext::set_size_request_to_display_given_text (name_button, "long", 2, 2);
break;
@@ -442,16 +442,16 @@ MixerStrip::set_width (Width w)
mute_button->set_label (_("M"));
solo_button->set_label (_("S"));
- if (_route.comment() == "") {
+ if (_route->comment() == "") {
comment_button.set_label (_("Cmt"));
} else {
comment_button.set_label (_("*Cmt*"));
}
- gpm.gain_automation_style_button.set_label (gpm.short_astyle_string(_route.gain_automation_curve().automation_style()));
- gpm.gain_automation_state_button.set_label (gpm.short_astate_string(_route.gain_automation_curve().automation_state()));
- panners.pan_automation_style_button.set_label (panners.short_astyle_string(_route.panner().automation_style()));
- panners.pan_automation_state_button.set_label (panners.short_astate_string(_route.panner().automation_state()));
+ gpm.gain_automation_style_button.set_label (gpm.short_astyle_string(_route->gain_automation_curve().automation_style()));
+ gpm.gain_automation_state_button.set_label (gpm.short_astate_string(_route->gain_automation_curve().automation_state()));
+ panners.pan_automation_style_button.set_label (panners.short_astyle_string(_route->panner().automation_style()));
+ panners.pan_automation_state_button.set_label (panners.short_astate_string(_route->panner().automation_state()));
Gtkmm2ext::set_size_request_to_display_given_text (name_button, "longest label", 2, 2);
break;
}
@@ -584,7 +584,7 @@ MixerStrip::connection_input_chosen (ARDOUR::Connection *c)
if (!ignore_toggle) {
try {
- _route.use_input_connection (*c, this);
+ _route->use_input_connection (*c, this);
}
catch (AudioEngine::PortRegistrationFailure& err) {
@@ -600,7 +600,7 @@ MixerStrip::connection_output_chosen (ARDOUR::Connection *c)
if (!ignore_toggle) {
try {
- _route.use_output_connection (*c, this);
+ _route->use_output_connection (*c, this);
}
catch (AudioEngine::PortRegistrationFailure& err) {
@@ -621,11 +621,11 @@ MixerStrip::add_connection_to_input_menu (ARDOUR::Connection* c)
MenuList& citems = input_menu.items();
- if (c->nports() == _route.n_inputs()) {
+ if (c->nports() == _route->n_inputs()) {
citems.push_back (CheckMenuElem (c->name(), bind (mem_fun(*this, &MixerStrip::connection_input_chosen), c)));
- ARDOUR::Connection *current = _route.input_connection();
+ ARDOUR::Connection *current = _route->input_connection();
if (current == c) {
ignore_toggle = true;
@@ -644,12 +644,12 @@ MixerStrip::add_connection_to_output_menu (ARDOUR::Connection* c)
return;
}
- if (c->nports() == _route.n_outputs()) {
+ if (c->nports() == _route->n_outputs()) {
MenuList& citems = output_menu.items();
citems.push_back (CheckMenuElem (c->name(), bind (mem_fun(*this, &MixerStrip::connection_output_chosen), c)));
- ARDOUR::Connection *current = _route.output_connection();
+ ARDOUR::Connection *current = _route->output_connection();
if (current == c) {
ignore_toggle = true;
@@ -727,8 +727,8 @@ MixerStrip::connect_to_pan ()
panstate_connection.disconnect ();
panstyle_connection.disconnect ();
- if (!_route.panner().empty()) {
- StreamPanner* sp = _route.panner().front();
+ if (!_route->panner().empty()) {
+ StreamPanner* sp = _route->panner().front();
panstate_connection = sp->automation().automation_state_changed.connect (mem_fun(panners, &PannerUI::pan_automation_state_changed));
panstyle_connection = sp->automation().automation_style_changed.connect (mem_fun(panners, &PannerUI::pan_automation_style_changed));
@@ -742,7 +742,7 @@ MixerStrip::update_input_display ()
{
ARDOUR::Connection *c;
- if ((c = _route.input_connection()) != 0) {
+ if ((c = _route->input_connection()) != 0) {
input_label.set_text (c->name());
} else {
switch (_width) {
@@ -762,7 +762,7 @@ MixerStrip::update_output_display ()
{
ARDOUR::Connection *c;
- if ((c = _route.output_connection()) != 0) {
+ if ((c = _route->output_connection()) != 0) {
output_label.set_text (c->name());
} else {
switch (_width) {
@@ -813,8 +813,8 @@ MixerStrip::comment_button_clicked ()
if (comment_window->is_visible()) {
string str = comment_area->get_buffer()->get_text();
- if (_route.comment() != str) {
- _route.set_comment (str, this);
+ if (_route->comment() != str) {
+ _route->set_comment (str, this);
switch (_width) {
@@ -858,7 +858,7 @@ void
MixerStrip::setup_comment_editor ()
{
string title;
- title = _route.name();
+ title = _route->name();
title += _(": comment editor");
comment_window = new ArdourDialog (title, false);
@@ -870,7 +870,7 @@ MixerStrip::setup_comment_editor ()
comment_area->set_size_request (110, 178);
comment_area->set_wrap_mode (WRAP_WORD);
comment_area->set_editable (true);
- comment_area->get_buffer()->set_text (_route.comment());
+ comment_area->get_buffer()->set_text (_route->comment());
comment_area->show ();
comment_window->get_vbox()->pack_start (*comment_area);
@@ -885,7 +885,7 @@ MixerStrip::comment_changed (void *src)
if (src != this) {
ignore_comment_edit = true;
if (comment_area) {
- comment_area->get_buffer()->set_text (_route.comment());
+ comment_area->get_buffer()->set_text (_route->comment());
}
ignore_comment_edit = false;
}
@@ -894,7 +894,7 @@ MixerStrip::comment_changed (void *src)
void
MixerStrip::set_mix_group (RouteGroup *rg)
{
- _route.set_mix_group (rg, this);
+ _route->set_mix_group (rg, this);
}
void
@@ -906,7 +906,7 @@ MixerStrip::add_mix_group_to_menu (RouteGroup *rg, RadioMenuItem::Group* group)
items.push_back (RadioMenuElem (*group, rg->name(), bind (mem_fun(*this, &MixerStrip::set_mix_group), rg)));
- if (_route.mix_group() == rg) {
+ if (_route->mix_group() == rg) {
static_cast<RadioMenuItem*>(&items.back())->set_active ();
}
}
@@ -946,7 +946,7 @@ MixerStrip::mix_group_changed (void *ignored)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &MixerStrip::mix_group_changed), ignored));
- RouteGroup *rg = _route.mix_group();
+ RouteGroup *rg = _route->mix_group();
if (rg) {
group_label.set_text (rg->name());
@@ -1002,11 +1002,11 @@ MixerStrip::build_route_ops_menu ()
items.push_back (SeparatorElem());
items.push_back (CheckMenuElem (_("Active"), mem_fun (*this, &RouteUI::toggle_route_active)));
route_active_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
- route_active_menu_item->set_active (_route.active());
+ route_active_menu_item->set_active (_route->active());
items.push_back (SeparatorElem());
items.push_back (CheckMenuElem (_("Invert Polarity"), mem_fun (*this, &RouteUI::toggle_polarity)));
polarity_menu_item = dynamic_cast<CheckMenuItem *> (&items.back());
- polarity_menu_item->set_active (_route.phase_invert());
+ polarity_menu_item->set_active (_route->phase_invert());
build_remote_control_menu ();
@@ -1096,10 +1096,10 @@ MixerStrip::name_changed (void *src)
RouteUI::name_changed (src);
break;
case Narrow:
- name_label.set_text (PBD::short_version (_route.name(), 5));
+ name_label.set_text (PBD::short_version (_route->name(), 5));
break;
}
- if (_route.phase_invert()) {
+ if (_route->phase_invert()) {
name_label.set_text (X_("Ø ") + name_label.get_text());
}
}
@@ -1138,7 +1138,7 @@ MixerStrip::map_frozen ()
{
ENSURE_GUI_THREAD (mem_fun(*this, &MixerStrip::map_frozen));
- AudioTrack* at = dynamic_cast<AudioTrack*>(&_route);
+ AudioTrack* at = audio_track();
if (at) {
switch (at->freeze_state()) {
@@ -1154,11 +1154,11 @@ MixerStrip::map_frozen ()
break;
}
}
- _route.foreach_redirect (this, &MixerStrip::hide_redirect_editor);
+ _route->foreach_redirect (this, &MixerStrip::hide_redirect_editor);
}
void
-MixerStrip::hide_redirect_editor (Redirect* redirect)
+MixerStrip::hide_redirect_editor (boost::shared_ptr<Redirect> redirect)
{
void* gui = redirect->get_gui ();
@@ -1173,7 +1173,7 @@ MixerStrip::route_active_changed ()
RouteUI::route_active_changed ();
if (is_audio_track()) {
- if (_route.active()) {
+ if (_route->active()) {
set_name ("AudioTrackStripBase");
gpm.set_meter_strip_name ("AudioTrackStripBase");
} else {
@@ -1182,7 +1182,7 @@ MixerStrip::route_active_changed ()
}
gpm.set_fader_name ("AudioTrackFader");
} else {
- if (_route.active()) {
+ if (_route->active()) {
set_name ("AudioBusStripBase");
gpm.set_meter_strip_name ("AudioBusStripBase");
} else {
@@ -1196,7 +1196,7 @@ MixerStrip::route_active_changed ()
RouteGroup*
MixerStrip::mix_group() const
{
- return _route.mix_group();
+ return _route->mix_group();
}
void
@@ -1225,7 +1225,7 @@ MixerStrip::meter_changed (void *src)
ENSURE_GUI_THREAD (bind (mem_fun(*this, &MixerStrip::meter_changed), src));
- switch (_route.meter_point()) {
+ switch (_route->meter_point()) {
case MeterInput:
meter_point_label.set_text (_("input"));
break;
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index c914d12404..e7b68ade48 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -84,7 +84,7 @@ class Mixer_UI;
class MixerStrip : public RouteUI, public Gtk::EventBox
{
public:
- MixerStrip (Mixer_UI&, ARDOUR::Session&, ARDOUR::Route &, bool in_mixer = true);
+ MixerStrip (Mixer_UI&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, bool in_mixer = true);
~MixerStrip ();
void set_width (Width);
@@ -239,7 +239,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
void name_changed (void *src);
void update_speed_display ();
void map_frozen ();
- void hide_redirect_editor (ARDOUR::Redirect* redirect);
+ void hide_redirect_editor (boost::shared_ptr<ARDOUR::Redirect> redirect);
bool ignore_speed_adjustment;
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc
index 983903d6dd..c2eb588b2f 100644
--- a/gtk2_ardour/mixer_ui.cc
+++ b/gtk2_ardour/mixer_ui.cc
@@ -251,7 +251,7 @@ Mixer_UI::show_window ()
}
void
-Mixer_UI::add_strip (Route* route)
+Mixer_UI::add_strip (boost::shared_ptr<Route> route)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &Mixer_UI::add_strip), route));
@@ -261,7 +261,7 @@ Mixer_UI::add_strip (Route* route)
return;
}
- strip = new MixerStrip (*this, *session, *route);
+ strip = new MixerStrip (*this, *session, route);
strips.push_back (strip);
strip->set_width (_strip_width);
@@ -310,7 +310,7 @@ void
Mixer_UI::follow_strip_selection ()
{
for (list<MixerStrip *>::iterator i = strips.begin(); i != strips.end(); ++i) {
- (*i)->set_selected (_selection.selected (&(*i)->route()));
+ (*i)->set_selected (_selection.selected ((*i)->route()));
}
}
@@ -324,13 +324,13 @@ Mixer_UI::strip_button_release_event (GdkEventButton *ev, MixerStrip *strip)
at the same time.
*/
- if (_selection.selected (&strip->route())) {
- _selection.remove (&strip->route());
+ if (_selection.selected (strip->route())) {
+ _selection.remove (strip->route());
} else {
if (Keyboard::modifier_state_equals (ev->state, Keyboard::Shift)) {
- _selection.add (&strip->route());
+ _selection.add (strip->route());
} else {
- _selection.set (&strip->route());
+ _selection.set (strip->route());
}
}
}
@@ -444,7 +444,7 @@ Mixer_UI::set_all_strips_visibility (bool yn)
continue;
}
- if (strip->route().master() || strip->route().control()) {
+ if (strip->route()->master() || strip->route()->control()) {
continue;
}
@@ -472,11 +472,11 @@ Mixer_UI::set_all_audio_visibility (int tracks, bool yn)
continue;
}
- if (strip->route().master() || strip->route().control()) {
+ if (strip->route()->master() || strip->route()->control()) {
continue;
}
- AudioTrack* at = dynamic_cast<AudioTrack*> (&strip->route());
+ AudioTrack* at = strip->audio_track();
switch (tracks) {
case 0:
@@ -570,11 +570,11 @@ Mixer_UI::redisplay_track_list ()
if (visible) {
strip->set_marked_for_display (true);
- strip->route().set_order_key (N_("signal"), order);
+ strip->route()->set_order_key (N_("signal"), order);
if (strip->packed()) {
- if (strip->route().master() || strip->route().control()) {
+ if (strip->route()->master() || strip->route()->control()) {
out_packer.reorder_child (*strip, -1);
} else {
strip_packer.reorder_child (*strip, -1); /* put at end */
@@ -582,7 +582,7 @@ Mixer_UI::redisplay_track_list ()
} else {
- if (strip->route().master() || strip->route().control()) {
+ if (strip->route()->master() || strip->route()->control()) {
out_packer.pack_start (*strip, false, false);
} else {
strip_packer.pack_start (*strip, false, false);
@@ -593,7 +593,7 @@ Mixer_UI::redisplay_track_list ()
} else {
- if (strip->route().master() || strip->route().control()) {
+ if (strip->route()->master() || strip->route()->control()) {
/* do nothing, these cannot be hidden */
} else {
strip_packer.remove (*strip);
@@ -604,7 +604,7 @@ Mixer_UI::redisplay_track_list ()
}
struct SignalOrderRouteSorter {
- bool operator() (Route* a, Route* b) {
+ bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
/* use of ">" forces the correct sort order */
return a->order_key ("signal") < b->order_key ("signal");
}
@@ -613,16 +613,17 @@ struct SignalOrderRouteSorter {
void
Mixer_UI::initial_track_display ()
{
- Session::RouteList routes = session->get_routes();
+ boost::shared_ptr<Session::RouteList> routes = session->get_routes();
+ Session::RouteList copy (*routes);
SignalOrderRouteSorter sorter;
- routes.sort (sorter);
+ copy.sort (sorter);
no_track_list_redisplay = true;
track_model->clear ();
- for (Session::RouteList::iterator i = routes.begin(); i != routes.end(); ++i) {
+ for (Session::RouteList::iterator i = copy.begin(); i != copy.end(); ++i) {
add_strip (*i);
}
@@ -670,7 +671,7 @@ Mixer_UI::track_display_button_press (GdkEventButton* ev)
MixerStrip* strip = (*iter)[track_columns.strip];
if (strip) {
- if (!strip->route().master() && !strip->route().control()) {
+ if (!strip->route()->master() && !strip->route()->control()) {
bool visible = (*iter)[track_columns.visible];
(*iter)[track_columns.visible] = !visible;
}
@@ -715,7 +716,7 @@ Mixer_UI::strip_name_changed (void* src, MixerStrip* mx)
for (i = rows.begin(); i != rows.end(); ++i) {
if ((*i)[track_columns.strip] == mx) {
- (*i)[track_columns.text] = mx->route().name();
+ (*i)[track_columns.text] = mx->route()->name();
return;
}
}
diff --git a/gtk2_ardour/mixer_ui.h b/gtk2_ardour/mixer_ui.h
index 864a110de7..6fe4120427 100644
--- a/gtk2_ardour/mixer_ui.h
+++ b/gtk2_ardour/mixer_ui.h
@@ -111,7 +111,7 @@ class Mixer_UI : public Gtk::Window
bool strip_scroller_button_release (GdkEventButton*);
- void add_strip (ARDOUR::Route*);
+ void add_strip (boost::shared_ptr<ARDOUR::Route>);
void remove_strip (MixerStrip *);
void hide_all_strips (bool with_select);
@@ -194,7 +194,7 @@ class Mixer_UI : public Gtk::Window
}
Gtk::TreeModelColumn<bool> visible;
Gtk::TreeModelColumn<Glib::ustring> text;
- Gtk::TreeModelColumn<ARDOUR::Route*> route;
+ Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
Gtk::TreeModelColumn<MixerStrip*> strip;
};
diff --git a/gtk2_ardour/pan_automation_time_axis.cc b/gtk2_ardour/pan_automation_time_axis.cc
index a39f2996f8..de1fae1732 100644
--- a/gtk2_ardour/pan_automation_time_axis.cc
+++ b/gtk2_ardour/pan_automation_time_axis.cc
@@ -34,7 +34,8 @@ using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
-PanAutomationTimeAxisView::PanAutomationTimeAxisView (Session& s, Route& r, PublicEditor& e, TimeAxisView& parent, Canvas& canvas, std::string n)
+PanAutomationTimeAxisView::PanAutomationTimeAxisView (Session& s, boost::shared_ptr<Route> r, PublicEditor& e,
+ TimeAxisView& parent, Canvas& canvas, std::string n)
: AxisView (s),
AutomationTimeAxisView (s, r, e, parent, canvas, n, X_("pan"), "")
@@ -140,6 +141,6 @@ void
PanAutomationTimeAxisView::set_automation_state (AutoState state)
{
if (!ignore_state_request) {
- route.panner().set_automation_state (state);
+ route->panner().set_automation_state (state);
}
}
diff --git a/gtk2_ardour/pan_automation_time_axis.h b/gtk2_ardour/pan_automation_time_axis.h
index 638c17cb3b..ca4a4db8e7 100644
--- a/gtk2_ardour/pan_automation_time_axis.h
+++ b/gtk2_ardour/pan_automation_time_axis.h
@@ -14,11 +14,11 @@ class PanAutomationTimeAxisView : public AutomationTimeAxisView
{
public:
PanAutomationTimeAxisView (ARDOUR::Session&,
- ARDOUR::Route&,
- PublicEditor&,
- TimeAxisView& parent_axis,
- ArdourCanvas::Canvas& canvas,
- std::string name);
+ boost::shared_ptr<ARDOUR::Route>,
+ PublicEditor&,
+ TimeAxisView& parent_axis,
+ ArdourCanvas::Canvas& canvas,
+ std::string name);
~PanAutomationTimeAxisView();
diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc
index fac92a2844..f4720c6ed5 100644
--- a/gtk2_ardour/panner_ui.cc
+++ b/gtk2_ardour/panner_ui.cc
@@ -47,7 +47,7 @@ using namespace Gtk;
using namespace sigc;
-PannerUI::PannerUI (IO& io, Session& s)
+PannerUI::PannerUI (boost::shared_ptr<IO> io, Session& s)
: _io (io),
_session (s),
hAdjustment(0.0, 0.0, 0.0),
@@ -87,13 +87,13 @@ PannerUI::PannerUI (IO& io, Session& s)
using namespace Menu_Helpers;
pan_astate_menu.items().push_back (MenuElem (_("Off"),
- bind (mem_fun (_io.panner(), &Panner::set_automation_state), (AutoState) Off)));
+ bind (mem_fun (_io->panner(), &Panner::set_automation_state), (AutoState) Off)));
pan_astate_menu.items().push_back (MenuElem (_("Play"),
- bind (mem_fun (_io.panner(), &Panner::set_automation_state), (AutoState) Play)));
+ bind (mem_fun (_io->panner(), &Panner::set_automation_state), (AutoState) Play)));
pan_astate_menu.items().push_back (MenuElem (_("Write"),
- bind (mem_fun (_io.panner(), &Panner::set_automation_state), (AutoState) Write)));
+ bind (mem_fun (_io->panner(), &Panner::set_automation_state), (AutoState) Write)));
pan_astate_menu.items().push_back (MenuElem (_("Touch"),
- bind (mem_fun (_io.panner(), &Panner::set_automation_state), (AutoState) Touch)));
+ bind (mem_fun (_io->panner(), &Panner::set_automation_state), (AutoState) Touch)));
pan_astyle_menu.items().push_back (MenuElem (_("Trim")));
pan_astyle_menu.items().push_back (MenuElem (_("Abs")));
@@ -143,9 +143,9 @@ PannerUI::PannerUI (IO& io, Session& s)
set_width(Narrow);
- _io.panner().Changed.connect (mem_fun(*this, &PannerUI::panner_changed));
- _io.panner().LinkStateChanged.connect (mem_fun(*this, &PannerUI::update_pan_linkage));
- _io.panner().StateChanged.connect (mem_fun(*this, &PannerUI::update_pan_state));
+ _io->panner().Changed.connect (mem_fun(*this, &PannerUI::panner_changed));
+ _io->panner().LinkStateChanged.connect (mem_fun(*this, &PannerUI::update_pan_linkage));
+ _io->panner().StateChanged.connect (mem_fun(*this, &PannerUI::update_pan_state));
pan_changed (0);
update_pan_sensitive ();
@@ -165,7 +165,7 @@ PannerUI::panning_link_button_release (GdkEventButton* ev)
{
cerr << "link release\n";
if (!ignore_toggle) {
- _io.panner().set_linked (!_io.panner().linked());
+ _io->panner().set_linked (!_io->panner().linked());
}
return true;
}
@@ -173,12 +173,12 @@ PannerUI::panning_link_button_release (GdkEventButton* ev)
void
PannerUI::panning_link_direction_clicked()
{
- switch (_io.panner().link_direction()) {
+ switch (_io->panner().link_direction()) {
case Panner::SameDirection:
- _io.panner().set_link_direction (Panner::OppositeDirection);
+ _io->panner().set_link_direction (Panner::OppositeDirection);
break;
default:
- _io.panner().set_link_direction (Panner::SameDirection);
+ _io->panner().set_link_direction (Panner::SameDirection);
break;
}
}
@@ -188,7 +188,7 @@ PannerUI::update_pan_linkage ()
{
ENSURE_GUI_THREAD(mem_fun(*this, &PannerUI::update_pan_linkage));
- bool x = _io.panner().linked();
+ bool x = _io->panner().linked();
bool bx = panning_link_button.get_active();
if (x != bx) {
@@ -200,7 +200,7 @@ PannerUI::update_pan_linkage ()
panning_link_direction_button.set_sensitive (x);
- switch (_io.panner().link_direction()) {
+ switch (_io->panner().link_direction()) {
case Panner::SameDirection:
panning_link_direction_button.set_image (*(manage (new Image (get_xpm ("forwardblarrow.xpm")))));
break;
@@ -278,7 +278,7 @@ PannerUI::update_pan_state ()
void
PannerUI::setup_pan ()
{
- uint32_t nouts = _io.n_outputs ();
+ uint32_t nouts = _io->n_outputs ();
if (nouts == 0 || nouts == 1) {
@@ -292,7 +292,7 @@ PannerUI::setup_pan ()
} else if (nouts == 2) {
vector<Adjustment*>::size_type asz;
- uint32_t npans = _io.panner().size();
+ uint32_t npans = _io->panner().size();
while (!pan_adjustments.empty()) {
delete pan_bars.back();
@@ -308,23 +308,23 @@ PannerUI::setup_pan ()
/* initialize adjustment with current value of panner */
- _io.panner()[asz]->get_position (x);
+ _io->panner()[asz]->get_position (x);
pan_adjustments.push_back (new Adjustment (x, 0, 1.0, 0.05, 0.1));
pan_adjustments.back()->signal_value_changed().connect (bind (mem_fun(*this, &PannerUI::pan_adjustment_changed), (uint32_t) asz));
- _io.panner()[asz]->Changed.connect (bind (mem_fun(*this, &PannerUI::pan_value_changed), (uint32_t) asz));
+ _io->panner()[asz]->Changed.connect (bind (mem_fun(*this, &PannerUI::pan_value_changed), (uint32_t) asz));
bc = new BarController (*pan_adjustments[asz],
- _io.panner()[asz]->control(),
+ _io->panner()[asz]->control(),
bind (mem_fun(*this, &PannerUI::pan_printer), pan_adjustments[asz]));
bc->set_name ("PanSlider");
bc->set_shadow_type (Gtk::SHADOW_NONE);
bc->set_style (BarController::Line);
- bc->StartGesture.connect (bind (mem_fun (_io, &IO::start_pan_touch), (uint32_t) asz));
- bc->StopGesture.connect (bind (mem_fun (_io, &IO::end_pan_touch), (uint32_t) asz));
+ bc->StartGesture.connect (bind (mem_fun (*_io, &IO::start_pan_touch), (uint32_t) asz));
+ bc->StopGesture.connect (bind (mem_fun (*_io, &IO::end_pan_touch), (uint32_t) asz));
char buf[64];
#ifdef __APPLE__
@@ -375,13 +375,13 @@ PannerUI::setup_pan ()
}
if (panner == 0) {
- panner = new Panner2d (_io.panner(), w, 61);
+ panner = new Panner2d (_io->panner(), w, 61);
panner->set_name ("MixerPanZone");
panner->show ();
}
update_pan_sensitive ();
- panner->reset (_io.n_inputs());
+ panner->reset (_io->n_inputs());
panner->set_size_request (w, 61);
/* and finally, add it to the panner frame */
@@ -424,7 +424,7 @@ PannerUI::build_pan_menu (uint32_t which)
/* set state first, connect second */
- (dynamic_cast<CheckMenuItem*> (&items.back()))->set_active (_io.panner()[which]->muted());
+ (dynamic_cast<CheckMenuItem*> (&items.back()))->set_active (_io->panner()[which]->muted());
(dynamic_cast<CheckMenuItem*> (&items.back()))->signal_toggled().connect
(bind (mem_fun(*this, &PannerUI::pan_mute), which));
@@ -433,7 +433,7 @@ PannerUI::build_pan_menu (uint32_t which)
/* set state first, connect second */
- bypass_menu_item->set_active (_io.panner().bypassed());
+ bypass_menu_item->set_active (_io->panner().bypassed());
bypass_menu_item->signal_toggled().connect (mem_fun(*this, &PannerUI::pan_bypass_toggle));
items.push_back (MenuElem (_("Reset"), mem_fun(*this, &PannerUI::pan_reset)));
@@ -444,15 +444,15 @@ PannerUI::build_pan_menu (uint32_t which)
void
PannerUI::pan_mute (uint32_t which)
{
- StreamPanner* sp = _io.panner()[which];
+ StreamPanner* sp = _io->panner()[which];
sp->set_muted (!sp->muted());
}
void
PannerUI::pan_bypass_toggle ()
{
- if (bypass_menu_item && (_io.panner().bypassed() != bypass_menu_item->get_active())) {
- _io.panner().set_bypassed (!_io.panner().bypassed());
+ if (bypass_menu_item && (_io->panner().bypassed() != bypass_menu_item->get_active())) {
+ _io->panner().set_bypassed (!_io->panner().bypassed());
}
}
@@ -464,11 +464,11 @@ PannerUI::pan_reset ()
void
PannerUI::effective_pan_display ()
{
- if (_io.panner().empty()) {
+ if (_io->panner().empty()) {
return;
}
- switch (_io.n_outputs()) {
+ switch (_io->n_outputs()) {
case 0:
case 1:
/* relax */
@@ -491,7 +491,7 @@ PannerUI::pan_changed (void *src)
return;
}
- switch (_io.panner().size()) {
+ switch (_io->panner().size()) {
case 0:
panning_link_direction_button.set_sensitive (false);
panning_link_button.set_sensitive (false);
@@ -505,7 +505,7 @@ PannerUI::pan_changed (void *src)
panning_link_button.set_sensitive (true);
}
- uint32_t nouts = _io.n_outputs();
+ uint32_t nouts = _io->n_outputs();
switch (nouts) {
case 0:
@@ -526,11 +526,11 @@ PannerUI::pan_changed (void *src)
void
PannerUI::pan_adjustment_changed (uint32_t which)
{
- if (!in_pan_update && which < _io.panner().size()) {
+ if (!in_pan_update && which < _io->panner().size()) {
float xpos;
float val = pan_adjustments[which]->get_value ();
- _io.panner()[which]->get_position (xpos);
+ _io->panner()[which]->get_position (xpos);
/* add a kinda-sorta detent for the middle */
@@ -547,7 +547,7 @@ PannerUI::pan_adjustment_changed (uint32_t which)
if (!Panner::equivalent (val, xpos)) {
- _io.panner()[which]->set_position (val);
+ _io->panner()[which]->set_position (val);
/* XXX
the panner objects have no access to the session,
so do this here. ick.
@@ -562,11 +562,11 @@ PannerUI::pan_value_changed (uint32_t which)
{
ENSURE_GUI_THREAD (bind (mem_fun(*this, &PannerUI::pan_value_changed), which));
- if (_io.n_outputs() > 1 && which < _io.panner().size()) {
+ if (_io->n_outputs() > 1 && which < _io->panner().size()) {
float xpos;
float val = pan_adjustments[which]->get_value ();
- _io.panner()[which]->get_position (xpos);
+ _io->panner()[which]->get_position (xpos);
if (!Panner::equivalent (val, xpos)) {
in_pan_update = true;
@@ -592,14 +592,14 @@ PannerUI::update_pan_bars (bool only_if_aplay)
float xpos, val;
if (only_if_aplay) {
- AutomationList& alist (_io.panner()[n]->automation());
+ AutomationList& alist (_io->panner()[n]->automation());
if (!alist.automation_playback()) {
continue;
}
}
- _io.panner()[n]->get_effective_position (xpos);
+ _io->panner()[n]->get_effective_position (xpos);
val = (*i)->get_value ();
if (!Panner::equivalent (val, xpos)) {
@@ -630,9 +630,9 @@ PannerUI::pan_printer (char *buf, uint32_t len, Adjustment* adj)
void
PannerUI::update_pan_sensitive ()
{
- bool sensitive = !(_io.panner().automation_state() & Play);
+ bool sensitive = !(_io->panner().automation_state() & Play);
- switch (_io.n_outputs()) {
+ switch (_io->n_outputs()) {
case 0:
case 1:
break;
@@ -693,10 +693,10 @@ PannerUI::pan_automation_style_changed ()
switch (_width) {
case Wide:
- pan_automation_style_button.set_label (astyle_string(_io.panner().automation_style()));
+ pan_automation_style_button.set_label (astyle_string(_io->panner().automation_style()));
break;
case Narrow:
- pan_automation_style_button.set_label (short_astyle_string(_io.panner().automation_style()));
+ pan_automation_style_button.set_label (short_astyle_string(_io->panner().automation_style()));
break;
}
}
@@ -710,10 +710,10 @@ PannerUI::pan_automation_state_changed ()
switch (_width) {
case Wide:
- pan_automation_state_button.set_label (astate_string(_io.panner().automation_state()));
+ pan_automation_state_button.set_label (astate_string(_io->panner().automation_state()));
break;
case Narrow:
- pan_automation_state_button.set_label (short_astate_string(_io.panner().automation_state()));
+ pan_automation_state_button.set_label (short_astate_string(_io->panner().automation_state()));
break;
}
@@ -722,11 +722,11 @@ PannerUI::pan_automation_state_changed ()
here.
*/
- if (_io.panner().empty()) {
+ if (_io->panner().empty()) {
return;
}
- x = (_io.panner().front()->automation().automation_state() != Off);
+ x = (_io->panner().front()->automation().automation_state() != Off);
if (pan_automation_state_button.get_active() != x) {
ignore_toggle = true;
diff --git a/gtk2_ardour/panner_ui.h b/gtk2_ardour/panner_ui.h
index 86a8575802..7658978233 100644
--- a/gtk2_ardour/panner_ui.h
+++ b/gtk2_ardour/panner_ui.h
@@ -55,7 +55,7 @@ namespace Gtk {
class PannerUI : public Gtk::HBox
{
public:
- PannerUI (ARDOUR::IO&, ARDOUR::Session&);
+ PannerUI (boost::shared_ptr<ARDOUR::IO>, ARDOUR::Session&);
~PannerUI ();
void pan_changed (void *);
@@ -72,7 +72,7 @@ class PannerUI : public Gtk::HBox
private:
friend class MixerStrip;
- ARDOUR::IO& _io;
+ boost::shared_ptr<ARDOUR::IO> _io;
ARDOUR::Session& _session;
bool ignore_toggle;
diff --git a/gtk2_ardour/playlist_selector.cc b/gtk2_ardour/playlist_selector.cc
index 9022c8acb4..5633404094 100644
--- a/gtk2_ardour/playlist_selector.cc
+++ b/gtk2_ardour/playlist_selector.cc
@@ -96,7 +96,7 @@ PlaylistSelector::show_for (RouteUI* ruix)
rui = ruix;
str = _("ardour: playlist for ");
- str += rui->route().name();
+ str += rui->route()->name();
set_title (str);
@@ -223,7 +223,7 @@ PlaylistSelector::selection_changed ()
TreeModel::iterator iter = tree.get_selection()->get_selected();
- if (!iter) {
+ if (!iter || rui == 0) {
/* nothing selected */
return;
}
@@ -233,7 +233,7 @@ PlaylistSelector::selection_changed ()
AudioTrack* at;
AudioPlaylist* apl;
- if ((at = dynamic_cast<AudioTrack*> (&rui->route())) == 0) {
+ if ((at = rui->audio_track()) == 0) {
/* eh? */
return;
}
diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc
index 16796df160..a762a0b186 100644
--- a/gtk2_ardour/plugin_selector.cc
+++ b/gtk2_ardour/plugin_selector.cc
@@ -253,7 +253,7 @@ PluginSelector::use_plugin (PluginInfo* pi)
return;
}
- Plugin *plugin = manager->load (*session, pi);
+ boost::shared_ptr<Plugin> plugin = manager->load (*session, pi);
if (plugin) {
PluginCreated (plugin);
diff --git a/gtk2_ardour/plugin_selector.h b/gtk2_ardour/plugin_selector.h
index 125ce1b80a..220de74871 100644
--- a/gtk2_ardour/plugin_selector.h
+++ b/gtk2_ardour/plugin_selector.h
@@ -35,7 +35,7 @@ class PluginSelector : public ArdourDialog
{
public:
PluginSelector (ARDOUR::PluginManager *);
- sigc::signal<void,ARDOUR::Plugin *> PluginCreated;
+ sigc::signal<void,boost::shared_ptr<ARDOUR::Plugin> > PluginCreated;
int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ?
diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc
index e5c8534df6..beddad4e16 100644
--- a/gtk2_ardour/plugin_ui.cc
+++ b/gtk2_ardour/plugin_ui.cc
@@ -61,19 +61,19 @@ using namespace Gtkmm2ext;
using namespace Gtk;
using namespace sigc;
-PluginUIWindow::PluginUIWindow (AudioEngine &engine, PluginInsert& insert, bool scrollable)
+PluginUIWindow::PluginUIWindow (AudioEngine &engine, boost::shared_ptr<PluginInsert> insert, bool scrollable)
: ArdourDialog ("plugin ui")
{
- if (insert.plugin().has_editor()) {
+ if (insert->plugin()->has_editor()) {
#ifdef VST_SUPPORT
- VSTPlugin* vp;
+ boost::shared_ptr<VSTPlugin> vp;
- if ((vp = dynamic_cast<VSTPlugin*> (&insert.plugin())) != 0) {
+ if ((vp = boost::dynamic_pointer_cast<VSTPlugin> (insert->plugin())) != 0) {
- VSTPluginUI* vpu = new VSTPluginUI (insert, *vp);
+ VSTPluginUI* vpu = new VSTPluginUI (insert, vp);
_pluginui = vpu;
get_vbox()->add (*vpu);
@@ -104,7 +104,7 @@ PluginUIWindow::PluginUIWindow (AudioEngine &engine, PluginInsert& insert, bool
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)));
- insert.GoingAway.connect (mem_fun(*this, &PluginUIWindow::plugin_going_away));
+ insert->GoingAway.connect (mem_fun(*this, &PluginUIWindow::plugin_going_away));
if (scrollable) {
gint h = _pluginui->get_preferred_height ();
@@ -117,7 +117,7 @@ PluginUIWindow::~PluginUIWindow ()
{
}
-PluginUI::PluginUI (AudioEngine &engine, PluginInsert& pi, bool scrollable)
+PluginUI::PluginUI (AudioEngine &engine, boost::shared_ptr<PluginInsert> pi, bool scrollable)
: PlugUIBase (pi),
engine(engine),
button_table (initial_button_rows, initial_button_cols),
@@ -165,8 +165,8 @@ PluginUI::PluginUI (AudioEngine &engine, PluginInsert& pi, bool scrollable)
pack_start (hpacker, false, false);
}
- insert.active_changed.connect (mem_fun(*this, &PluginUI::redirect_active_changed));
- bypass_button.set_active (!insert.active());
+ insert->active_changed.connect (mem_fun(*this, &PluginUI::redirect_active_changed));
+ bypass_button.set_active (!insert->active());
build (engine);
}
@@ -233,13 +233,13 @@ PluginUI::build (AudioEngine &engine)
/* find all ports. build control elements for all appropriate control ports */
- for (i = 0; i < plugin.parameter_count(); ++i) {
+ for (i = 0; i < plugin->parameter_count(); ++i) {
- if (plugin.parameter_is_control (i)) {
+ if (plugin->parameter_is_control (i)) {
/* Don't show latency control ports */
- if (plugin.describe_parameter (i) == X_("latency")) {
+ if (plugin->describe_parameter (i) == X_("latency")) {
continue;
}
@@ -263,7 +263,7 @@ PluginUI::build (AudioEngine &engine)
}
}
- if ((cui = build_control_ui (engine, i, plugin.get_nth_control (i))) == 0) {
+ if ((cui = build_control_ui (engine, i, plugin->get_nth_control (i))) == 0) {
error << string_compose(_("Plugin Editor: could not build control element for port %1"), i) << endmsg;
continue;
}
@@ -326,8 +326,8 @@ PluginUI::build (AudioEngine &engine)
}
}
- n_ins = plugin.get_info().n_inputs;
- n_outs = plugin.get_info().n_outputs;
+ n_ins = plugin->get_info().n_inputs;
+ n_outs = plugin->get_info().n_outputs;
if (box->children().empty()) {
hpacker.remove (*frame);
@@ -387,7 +387,7 @@ PluginUI::automation_state_changed (ControlUI* cui)
{
/* update button label */
- switch (insert.get_port_automation_state (cui->port_index) & (Off|Play|Touch|Write)) {
+ switch (insert->get_port_automation_state (cui->port_index) & (Off|Play|Touch|Write)) {
case Off:
cui->automate_button.set_label (_("Off"));
break;
@@ -415,7 +415,7 @@ static void integer_printer (char buf[32], Adjustment &adj, void *arg)
void
PluginUI::print_parameter (char *buf, uint32_t len, uint32_t param)
{
- plugin.print_parameter (param, buf, len);
+ plugin->print_parameter (param, buf, len);
}
PluginUI::ControlUI*
@@ -425,7 +425,7 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, PBD::Contro
ControlUI* control_ui;
Plugin::ParameterDescriptor desc;
- plugin.get_parameter_descriptor (port_index, desc);
+ plugin->get_parameter_descriptor (port_index, desc);
control_ui = manage (new ControlUI ());
control_ui->adjustment = 0;
@@ -439,11 +439,11 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, PBD::Contro
control_ui->set_spacing (5);
- if (plugin.parameter_is_input (port_index)) {
+ if (plugin->parameter_is_input (port_index)) {
- LadspaPlugin* lp;
+ boost::shared_ptr<LadspaPlugin> lp;
- if ((lp = dynamic_cast<LadspaPlugin*>(&plugin)) != 0) {
+ if ((lp = boost::dynamic_pointer_cast<LadspaPlugin>(plugin)) != 0) {
lrdf_defaults* defaults = lrdf_get_scale_values(lp->unique_id(), port_index);
@@ -453,7 +453,7 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, PBD::Contro
//control_ui->combo->set_value_in_list(true, false);
set_popdown_strings (*control_ui->combo, setup_scale_values(port_index, control_ui));
control_ui->combo->signal_changed().connect (bind (mem_fun(*this, &PluginUI::control_combo_changed), control_ui));
- plugin.ParameterChanged.connect (bind (mem_fun (*this, &PluginUI::parameter_changed), control_ui));
+ plugin->ParameterChanged.connect (bind (mem_fun (*this, &PluginUI::parameter_changed), control_ui));
control_ui->pack_start(control_ui->label, true, true);
control_ui->pack_start(*control_ui->combo, false, true);
@@ -478,7 +478,7 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, PBD::Contro
control_ui->button->signal_clicked().connect (bind (mem_fun(*this, &PluginUI::control_port_toggled), control_ui));
- if(plugin.get_parameter (port_index) == 1){
+ if(plugin->get_parameter (port_index) == 1){
control_ui->button->set_active(true);
}
@@ -529,9 +529,9 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, PBD::Contro
}
if (control_ui->logarithmic) {
- control_ui->adjustment->set_value(log(plugin.get_parameter(port_index)));
+ control_ui->adjustment->set_value(log(plugin->get_parameter(port_index)));
} else{
- control_ui->adjustment->set_value(plugin.get_parameter(port_index));
+ control_ui->adjustment->set_value(plugin->get_parameter(port_index));
}
/* XXX memory leak: SliderController not destroyed by ControlUI
@@ -552,11 +552,11 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, PBD::Contro
automation_state_changed (control_ui);
- plugin.ParameterChanged.connect (bind (mem_fun(*this, &PluginUI::parameter_changed), control_ui));
- insert.automation_list (port_index).automation_state_changed.connect
+ plugin->ParameterChanged.connect (bind (mem_fun(*this, &PluginUI::parameter_changed), control_ui));
+ insert->automation_list (port_index).automation_state_changed.connect
(bind (mem_fun(*this, &PluginUI::automation_state_changed), control_ui));
- } else if (plugin.parameter_is_output (port_index)) {
+ } else if (plugin->parameter_is_output (port_index)) {
control_ui->display = manage (new EventBox);
control_ui->display->set_name ("ParameterValueDisplay");
@@ -603,20 +603,20 @@ PluginUI::build_control_ui (AudioEngine &engine, guint32 port_index, PBD::Contro
output_controls.push_back (control_ui);
}
- plugin.ParameterChanged.connect (bind (mem_fun(*this, &PluginUI::parameter_changed), control_ui));
+ plugin->ParameterChanged.connect (bind (mem_fun(*this, &PluginUI::parameter_changed), control_ui));
return control_ui;
}
void
PluginUI::start_touch (PluginUI::ControlUI* cui)
{
- insert.automation_list (cui->port_index).start_touch ();
+ insert->automation_list (cui->port_index).start_touch ();
}
void
PluginUI::stop_touch (PluginUI::ControlUI* cui)
{
- insert.automation_list (cui->port_index).stop_touch ();
+ insert->automation_list (cui->port_index).stop_touch ();
}
void
@@ -647,7 +647,7 @@ PluginUI::astate_clicked (ControlUI* cui, uint32_t port)
void
PluginUI::set_automation_state (AutoState state, ControlUI* cui)
{
- insert.set_port_automation_state (cui->port_index, state);
+ insert->set_port_automation_state (cui->port_index, state);
}
void
@@ -663,7 +663,7 @@ PluginUI::control_adjustment_changed (ControlUI* cui)
value = exp(value);
}
- insert.set_parameter (cui->port_index, (float) value);
+ insert->set_parameter (cui->port_index, (float) value);
}
void
@@ -684,7 +684,7 @@ PluginUI::update_control_display (ControlUI* cui)
cui->update_pending = false;
- float val = plugin.get_parameter (cui->port_index);
+ float val = plugin->get_parameter (cui->port_index);
cui->ignore_change++;
if (cui->combo) {
@@ -718,7 +718,7 @@ void
PluginUI::control_port_toggled (ControlUI* cui)
{
if (!cui->ignore_change) {
- insert.set_parameter (cui->port_index, cui->button->get_active());
+ insert->set_parameter (cui->port_index, cui->button->get_active());
}
}
@@ -728,7 +728,7 @@ PluginUI::control_combo_changed (ControlUI* cui)
if (!cui->ignore_change) {
string value = cui->combo->get_active_text();
std::map<string,float> mapping = *cui->combo_map;
- insert.set_parameter (cui->port_index, mapping[value]);
+ insert->set_parameter (cui->port_index, mapping[value]);
}
}
@@ -774,7 +774,7 @@ void
PluginUI::output_update ()
{
for (vector<ControlUI*>::iterator i = output_controls.begin(); i != output_controls.end(); ++i) {
- float val = plugin.get_parameter ((*i)->port_index);
+ float val = plugin->get_parameter ((*i)->port_index);
char buf[32];
snprintf (buf, sizeof(buf), "%.2f", val);
(*i)->display_label->set_text (buf);
@@ -808,7 +808,7 @@ vector<string>
PluginUI::setup_scale_values(guint32 port_index, ControlUI* cui)
{
vector<string> enums;
- LadspaPlugin* lp = dynamic_cast<LadspaPlugin*> (&plugin);
+ boost::shared_ptr<LadspaPlugin> lp = boost::dynamic_pointer_cast<LadspaPlugin> (plugin);
cui->combo_map = new std::map<string, float>;
lrdf_defaults* defaults = lrdf_get_scale_values(lp->unique_id(), port_index);
@@ -827,14 +827,14 @@ PluginUI::setup_scale_values(guint32 port_index, ControlUI* cui)
return enums;
}
-PlugUIBase::PlugUIBase (PluginInsert& pi)
+PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
: insert (pi),
- plugin (insert.plugin()),
+ plugin (insert->plugin()),
save_button(_("Add")),
bypass_button (_("Bypass"))
{
//combo.set_use_arrows_always(true);
- set_popdown_strings (combo, plugin.get_presets());
+ set_popdown_strings (combo, plugin->get_presets());
combo.set_size_request (100, -1);
combo.set_active_text ("");
combo.signal_changed().connect(mem_fun(*this, &PlugUIBase::setting_selected));
@@ -850,7 +850,7 @@ void
PlugUIBase::setting_selected()
{
if (combo.get_active_text().length() > 0) {
- if (!plugin.load_preset(combo.get_active_text())) {
+ if (!plugin->load_preset(combo.get_active_text())) {
warning << string_compose(_("Plugin preset %1 not found"), combo.get_active_text()) << endmsg;
}
}
@@ -875,8 +875,8 @@ PlugUIBase::save_plugin_setting ()
prompter.get_result(name);
if (name.length()) {
- if(plugin.save_preset(name)){
- set_popdown_strings (combo, plugin.get_presets());
+ if(plugin->save_preset(name)){
+ set_popdown_strings (combo, plugin->get_presets());
combo.set_active_text (name);
}
}
@@ -889,8 +889,8 @@ PlugUIBase::bypass_toggled ()
{
bool x;
- if ((x = bypass_button.get_active()) == insert.active()) {
- insert.set_active (!x, this);
+ if ((x = bypass_button.get_active()) == insert->active()) {
+ insert->set_active (!x, this);
}
}
diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h
index 351ab0dc2b..570a224b66 100644
--- a/gtk2_ardour/plugin_ui.h
+++ b/gtk2_ardour/plugin_ui.h
@@ -67,7 +67,7 @@ namespace Gtkmm2ext {
class PlugUIBase : public virtual sigc::trackable
{
public:
- PlugUIBase (ARDOUR::PluginInsert&);
+ PlugUIBase (boost::shared_ptr<ARDOUR::PluginInsert>);
virtual ~PlugUIBase() {}
virtual gint get_preferred_height () = 0;
@@ -75,8 +75,8 @@ class PlugUIBase : public virtual sigc::trackable
virtual bool stop_updating(GdkEventAny*) = 0;
protected:
- ARDOUR::PluginInsert& insert;
- ARDOUR::Plugin& plugin;
+ boost::shared_ptr<ARDOUR::PluginInsert> insert;
+ boost::shared_ptr<ARDOUR::Plugin> plugin;
Gtk::ComboBoxText combo;
Gtk::Button save_button;
Gtk::ToggleButton bypass_button;
@@ -89,7 +89,7 @@ class PlugUIBase : public virtual sigc::trackable
class PluginUI : public PlugUIBase, public Gtk::VBox
{
public:
- PluginUI (ARDOUR::AudioEngine &, ARDOUR::PluginInsert& plug, bool scrollable=false);
+ PluginUI (ARDOUR::AudioEngine &, boost::shared_ptr<ARDOUR::PluginInsert> plug, bool scrollable=false);
~PluginUI ();
gint get_preferred_height () { return prefheight; }
@@ -196,7 +196,7 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
class PluginUIWindow : public ArdourDialog
{
public:
- PluginUIWindow (ARDOUR::AudioEngine &, ARDOUR::PluginInsert& insert, bool scrollable=false);
+ PluginUIWindow (ARDOUR::AudioEngine &, boost::shared_ptr<ARDOUR::PluginInsert> insert, bool scrollable=false);
~PluginUIWindow ();
PlugUIBase& pluginui() { return *_pluginui; }
@@ -213,7 +213,7 @@ class PluginUIWindow : public ArdourDialog
class VSTPluginUI : public PlugUIBase, public Gtk::VBox
{
public:
- VSTPluginUI (ARDOUR::PluginInsert&, ARDOUR::VSTPlugin&);
+ VSTPluginUI (boost::shared_ptr<ARDOUR::PluginInsert>, boost::shared_ptr<ARDOUR::VSTPlugin>);
~VSTPluginUI ();
gint get_preferred_height ();
@@ -223,7 +223,7 @@ class VSTPluginUI : public PlugUIBase, public Gtk::VBox
int package (Gtk::Window&);
private:
- ARDOUR::VSTPlugin& vst;
+ boost::shared_ptr<ARDOUR::VSTPlugin> vst;
Gtk::Socket socket;
Gtk::HBox preset_box;
Gtk::VBox vpacker;
diff --git a/gtk2_ardour/redirect_automation_line.cc b/gtk2_ardour/redirect_automation_line.cc
index 8971e8ff10..1ea5013295 100644
--- a/gtk2_ardour/redirect_automation_line.cc
+++ b/gtk2_ardour/redirect_automation_line.cc
@@ -55,7 +55,7 @@ RedirectAutomationLine::RedirectAutomationLine (const string & name, Redirect& r
/*NOTREACHED*/
}
- pi->plugin().get_parameter_descriptor (_port, desc);
+ pi->plugin()->get_parameter_descriptor (_port, desc);
upper = desc.upper;
lower = desc.lower;
diff --git a/gtk2_ardour/redirect_automation_time_axis.cc b/gtk2_ardour/redirect_automation_time_axis.cc
index e1b71310ac..a53c1a20e4 100644
--- a/gtk2_ardour/redirect_automation_time_axis.cc
+++ b/gtk2_ardour/redirect_automation_time_axis.cc
@@ -32,7 +32,8 @@ using namespace ARDOUR;
using namespace PBD;
using namespace Gtk;
-RedirectAutomationTimeAxisView::RedirectAutomationTimeAxisView (Session& s, Route& r, PublicEditor& e, TimeAxisView& parent, Canvas& canvas, std::string n,
+RedirectAutomationTimeAxisView::RedirectAutomationTimeAxisView (Session& s, boost::shared_ptr<Route> r,
+ PublicEditor& e, TimeAxisView& parent, Canvas& canvas, std::string n,
uint32_t prt, Redirect& rd, string state_name)
: AxisView (s),
diff --git a/gtk2_ardour/redirect_automation_time_axis.h b/gtk2_ardour/redirect_automation_time_axis.h
index b8d94b2a3e..6976dc2358 100644
--- a/gtk2_ardour/redirect_automation_time_axis.h
+++ b/gtk2_ardour/redirect_automation_time_axis.h
@@ -14,7 +14,7 @@ class RedirectAutomationTimeAxisView : public AutomationTimeAxisView
{
public:
RedirectAutomationTimeAxisView (ARDOUR::Session&,
- ARDOUR::Route&,
+ boost::shared_ptr<ARDOUR::Route>,
PublicEditor&,
TimeAxisView& parent,
ArdourCanvas::Canvas& canvas,
diff --git a/gtk2_ardour/redirect_box.cc b/gtk2_ardour/redirect_box.cc
index f5cb9522e0..0455dfdeb4 100644
--- a/gtk2_ardour/redirect_box.cc
+++ b/gtk2_ardour/redirect_box.cc
@@ -76,7 +76,7 @@ bool RedirectBox::get_colors = true;
Gdk::Color* RedirectBox::active_redirect_color;
Gdk::Color* RedirectBox::inactive_redirect_color;
-RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelector &plugsel,
+RedirectBox::RedirectBox (Placement pcmnt, Session& sess, boost::shared_ptr<Route> rt, PluginSelector &plugsel,
RouteRedirectSelection & rsel, bool owner_is_mixer)
: _route(rt),
_session(sess),
@@ -132,7 +132,7 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelec
pack_start (redirect_eventbox, true, true);
- _route.redirects_changed.connect (mem_fun(*this, &RedirectBox::redisplay_redirects));
+ _route->redirects_changed.connect (mem_fun(*this, &RedirectBox::redisplay_redirects));
redirect_eventbox.signal_enter_notify_event().connect (bind (sigc::ptr_fun (RedirectBox::enter_box), this));
@@ -161,10 +161,10 @@ RedirectBox::object_drop (string type, uint32_t cnt, void** ptr)
/* do something with the dropped redirects */
- list<Redirect*> redirects;
-
+ list<boost::shared_ptr<Redirect> > redirects;
+
for (uint32_t n = 0; n < cnt; ++n) {
- redirects.push_back ((Redirect*) ptr[n]);
+ redirects.push_back (boost::shared_ptr<Redirect> ((Redirect*) ptr[n]));
}
paste_redirect_list (redirects);
@@ -189,21 +189,21 @@ RedirectBox::set_width (Width w)
}
void
-RedirectBox::remove_redirect_gui (Redirect *redirect)
+RedirectBox::remove_redirect_gui (boost::shared_ptr<Redirect> redirect)
{
- Insert *insert = 0;
- Send *send = 0;
- PortInsert *port_insert = 0;
+ boost::shared_ptr<Insert> insert;
+ boost::shared_ptr<Send> send;
+ boost::shared_ptr<PortInsert> port_insert;
- if ((insert = dynamic_cast<Insert *> (redirect)) != 0) {
+ if ((insert = boost::dynamic_pointer_cast<Insert> (redirect)) != 0) {
- if ((port_insert = dynamic_cast<PortInsert *> (insert)) != 0) {
+ if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) {
PortInsertUI *io_selector = reinterpret_cast<PortInsertUI *> (port_insert->get_gui());
port_insert->set_gui (0);
delete io_selector;
}
- } else if ((send = dynamic_cast<Send *> (insert)) != 0) {
+ } else if ((send = boost::dynamic_pointer_cast<Send> (insert)) != 0) {
SendUIWindow *sui = reinterpret_cast<SendUIWindow*> (send->get_gui());
send->set_gui (0);
delete sui;
@@ -268,7 +268,7 @@ RedirectBox::redirect_button_press_event (GdkEventButton *ev)
TreeViewColumn* column;
int cellx;
int celly;
- Redirect* redirect = 0;
+ boost::shared_ptr<Redirect> redirect;
int ret = false;
bool selected = false;
@@ -353,25 +353,25 @@ RedirectBox::choose_plugin ()
}
void
-RedirectBox::insert_plugin_chosen (Plugin *plugin)
+RedirectBox::insert_plugin_chosen (boost::shared_ptr<Plugin> plugin)
{
if (plugin) {
- Redirect *redirect = new PluginInsert (_session, *plugin, _placement);
+ boost::shared_ptr<Redirect> redirect (new PluginInsert (_session, plugin, _placement));
redirect->active_changed.connect (mem_fun(*this, &RedirectBox::show_redirect_active));
uint32_t err_streams;
- if (_route.add_redirect (redirect, this, &err_streams)) {
+ if (_route->add_redirect (redirect, this, &err_streams)) {
wierd_plugin_dialog (*plugin, err_streams, _route);
- delete redirect;
+ // XXX SHAREDPTR delete plugin here .. do we even need to care?
}
}
}
void
-RedirectBox::wierd_plugin_dialog (Plugin& p, uint32_t streams, IO& io)
+RedirectBox::wierd_plugin_dialog (Plugin& p, uint32_t streams, boost::shared_ptr<IO> io)
{
ArdourDialog dialog ("wierd plugin dialog");
Label label;
@@ -417,8 +417,8 @@ RedirectBox::wierd_plugin_dialog (Plugin& p, uint32_t streams, IO& io)
p.name(),
p.get_info().n_inputs,
p.get_info().n_outputs,
- io.n_inputs(),
- io.n_outputs(),
+ io->n_inputs(),
+ io->n_outputs(),
streams));
}
@@ -436,36 +436,36 @@ RedirectBox::wierd_plugin_dialog (Plugin& p, uint32_t streams, IO& io)
void
RedirectBox::choose_insert ()
{
- Redirect *redirect = new PortInsert (_session, _placement);
+ boost::shared_ptr<Redirect> redirect (new PortInsert (_session, _placement));
redirect->active_changed.connect (mem_fun(*this, &RedirectBox::show_redirect_active));
- _route.add_redirect (redirect, this);
+ _route->add_redirect (redirect, this);
}
void
RedirectBox::choose_send ()
{
- Send *send = new Send (_session, _placement);
+ boost::shared_ptr<Send> send (new Send (_session, _placement));
/* XXX need redirect lock on route */
- send->ensure_io (0, _route.max_redirect_outs(), false, this);
+ send->ensure_io (0, _route->max_redirect_outs(), false, this);
- IOSelectorWindow *ios = new IOSelectorWindow (_session, *send, false, true);
+ IOSelectorWindow *ios = new IOSelectorWindow (_session, send, false, true);
ios->show_all ();
- ios->selector().Finished.connect (bind (mem_fun(*this, &RedirectBox::send_io_finished), static_cast<Redirect*>(send), ios));
+ ios->selector().Finished.connect (bind (mem_fun(*this, &RedirectBox::send_io_finished), boost::static_pointer_cast<Redirect>(send), ios));
}
void
-RedirectBox::send_io_finished (IOSelector::Result r, Redirect* redirect, IOSelectorWindow* ios)
+RedirectBox::send_io_finished (IOSelector::Result r, boost::shared_ptr<Redirect> redirect, IOSelectorWindow* ios)
{
switch (r) {
case IOSelector::Cancelled:
- delete redirect;
+ // delete redirect; XXX SHAREDPTR HOW TO DESTROY THE REDIRECT ? do we even need to think about it?
break;
case IOSelector::Accepted:
- _route.add_redirect (redirect, this);
+ _route->add_redirect (redirect, this);
break;
}
@@ -488,7 +488,8 @@ RedirectBox::redisplay_redirects (void *src)
redirect_active_connections.clear ();
redirect_name_connections.clear ();
- _route.foreach_redirect (this, &RedirectBox::add_redirect_to_display);
+ void (RedirectBox::*pmf)(boost::shared_ptr<Redirect>) = &RedirectBox::add_redirect_to_display;
+ _route->foreach_redirect (this, pmf);
switch (_placement) {
case PreFader:
@@ -501,33 +502,33 @@ RedirectBox::redisplay_redirects (void *src)
}
void
-RedirectBox::add_redirect_to_display (Redirect *redirect)
+RedirectBox::add_redirect_to_display (boost::shared_ptr<Redirect> redirect)
{
if (redirect->placement() != _placement) {
return;
}
Gtk::TreeModel::Row row = *(model->append());
- row[columns.text] = redirect_name (*redirect);
+ row[columns.text] = redirect_name (redirect);
row[columns.redirect] = redirect;
- show_redirect_active (redirect, this);
+ show_redirect_active (redirect.get(), this);
redirect_active_connections.push_back (redirect->active_changed.connect (mem_fun(*this, &RedirectBox::show_redirect_active)));
redirect_name_connections.push_back (redirect->name_changed.connect (bind (mem_fun(*this, &RedirectBox::show_redirect_name), redirect)));
}
string
-RedirectBox::redirect_name (Redirect& redirect)
+RedirectBox::redirect_name (boost::shared_ptr<Redirect> redirect)
{
- Send *send;
+ boost::shared_ptr<Send> send;
string name_display;
- if (!redirect.active()) {
+ if (!redirect->active()) {
name_display = " (";
}
- if ((send = dynamic_cast<Send *> (&redirect)) != 0) {
+ if ((send = boost::dynamic_pointer_cast<Send> (redirect)) != 0) {
name_display += '>';
@@ -550,16 +551,16 @@ RedirectBox::redirect_name (Redirect& redirect)
switch (_width) {
case Wide:
- name_display += redirect.name();
+ name_display += redirect->name();
break;
case Narrow:
- name_display += PBD::short_version (redirect.name(), 5);
+ name_display += PBD::short_version (redirect->name(), 5);
break;
}
}
- if (!redirect.active()) {
+ if (!redirect->active()) {
name_display += ')';
}
@@ -581,34 +582,36 @@ RedirectBox::build_redirect_tooltip (EventBox& box, string start)
}
void
-RedirectBox::show_redirect_name (void* src, Redirect *redirect)
+RedirectBox::show_redirect_name (void* src, boost::shared_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.get(), src);
}
void
-RedirectBox::show_redirect_active (Redirect *redirect, void *src)
+RedirectBox::show_redirect_active (Redirect* redirect, void *src)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RedirectBox::show_redirect_active), redirect, src));
Gtk::TreeModel::Children children = model->children();
Gtk::TreeModel::Children::iterator iter = children.begin();
- while( iter != children.end())
- {
- if ((*iter)[columns.redirect] == redirect)
- break;
- iter++;
- }
+ while (iter != children.end()) {
- (*iter)[columns.text] = redirect_name (*redirect);
+ boost::shared_ptr<Redirect> r = (*iter)[columns.redirect];
- if (redirect->active()) {
- (*iter)[columns.color] = *active_redirect_color;
- } else {
- (*iter)[columns.color] = *inactive_redirect_color;
+ if (r.get() == redirect) {
+ (*iter)[columns.text] = redirect_name (r);
+
+ if (redirect->active()) {
+ (*iter)[columns.color] = *active_redirect_color;
+ } else {
+ (*iter)[columns.color] = *inactive_redirect_color;
+ }
+ break;
+ }
+
+ iter++;
}
}
@@ -627,12 +630,12 @@ RedirectBox::compute_redirect_sort_keys ()
Gtk::TreeModel::Children children = model->children();
for (Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter) {
- Redirect *redirect = (*iter)[columns.redirect];
- redirect->set_sort_key (sort_key);
+ boost::shared_ptr<Redirect> r = (*iter)[columns.redirect];
+ r->set_sort_key (sort_key);
sort_key++;
}
- if (_route.sort_redirects ()) {
+ if (_route->sort_redirects ()) {
redisplay_redirects (0);
@@ -661,7 +664,7 @@ outputs do not work correctly."));
void
RedirectBox::rename_redirects ()
{
- vector<Redirect*> to_be_renamed;
+ vector<boost::shared_ptr<Redirect> > to_be_renamed;
get_selected_redirects (to_be_renamed);
@@ -669,7 +672,7 @@ RedirectBox::rename_redirects ()
return;
}
- for (vector<Redirect*>::iterator i = to_be_renamed.begin(); i != to_be_renamed.end(); ++i) {
+ for (vector<boost::shared_ptr<Redirect> >::iterator i = to_be_renamed.begin(); i != to_be_renamed.end(); ++i) {
rename_redirect (*i);
}
}
@@ -677,7 +680,7 @@ RedirectBox::rename_redirects ()
void
RedirectBox::cut_redirects ()
{
- vector<Redirect*> to_be_removed;
+ vector<boost::shared_ptr<Redirect> > to_be_removed;
get_selected_redirects (to_be_removed);
@@ -692,7 +695,7 @@ RedirectBox::cut_redirects ()
_rr_selection.set (to_be_removed);
- for (vector<Redirect*>::iterator i = to_be_removed.begin(); i != to_be_removed.end(); ++i) {
+ for (vector<boost::shared_ptr<Redirect> >::iterator i = to_be_removed.begin(); i != to_be_removed.end(); ++i) {
void* gui = (*i)->get_gui ();
@@ -700,7 +703,7 @@ RedirectBox::cut_redirects ()
static_cast<Gtk::Widget*>(gui)->hide ();
}
- if (_route.remove_redirect (*i, this)) {
+ if (_route->remove_redirect (*i, this)) {
/* removal failed */
_rr_selection.remove (*i);
}
@@ -711,8 +714,8 @@ RedirectBox::cut_redirects ()
void
RedirectBox::copy_redirects ()
{
- vector<Redirect*> to_be_copied;
- vector<Redirect*> copies;
+ vector<boost::shared_ptr<Redirect> > to_be_copied;
+ vector<boost::shared_ptr<Redirect> > copies;
get_selected_redirects (to_be_copied);
@@ -720,29 +723,24 @@ RedirectBox::copy_redirects ()
return;
}
- for (vector<Redirect*>::iterator i = to_be_copied.begin(); i != to_be_copied.end(); ++i) {
- copies.push_back (Redirect::clone (**i));
+ for (vector<boost::shared_ptr<Redirect> >::iterator i = to_be_copied.begin(); i != to_be_copied.end(); ++i) {
+ copies.push_back (Redirect::clone (*i));
}
_rr_selection.set (copies);
}
gint
-RedirectBox::idle_delete_redirect (Redirect *redirect)
+RedirectBox::idle_delete_redirect (boost::shared_ptr<Redirect> redirect)
{
/* NOT copied to _mixer.selection() */
- if (_route.remove_redirect (redirect, this)) {
- /* removal failed */
- return FALSE;
- }
-
- delete redirect;
+ _route->remove_redirect (redirect, this);
return FALSE;
}
void
-RedirectBox::rename_redirect (Redirect* redirect)
+RedirectBox::rename_redirect (boost::shared_ptr<Redirect> redirect)
{
ArdourPrompter name_prompter (true);
string result;
@@ -767,7 +765,7 @@ RedirectBox::rename_redirect (Redirect* redirect)
}
void
-RedirectBox::cut_redirect (Redirect *redirect)
+RedirectBox::cut_redirect (boost::shared_ptr<Redirect> redirect)
{
/* this essentially transfers ownership of the redirect
of the redirect from the route to the mixer
@@ -782,15 +780,15 @@ RedirectBox::cut_redirect (Redirect *redirect)
static_cast<Gtk::Widget*>(gui)->hide ();
}
- if (_route.remove_redirect (redirect, this)) {
+ if (_route->remove_redirect (redirect, this)) {
_rr_selection.remove (redirect);
}
}
void
-RedirectBox::copy_redirect (Redirect *redirect)
+RedirectBox::copy_redirect (boost::shared_ptr<Redirect> redirect)
{
- Redirect* copy = Redirect::clone (*redirect);
+ boost::shared_ptr<Redirect> copy = Redirect::clone (redirect);
_rr_selection.add (copy);
}
@@ -805,22 +803,19 @@ RedirectBox::paste_redirects ()
}
void
-RedirectBox::paste_redirect_list (list<Redirect*>& redirects)
+RedirectBox::paste_redirect_list (list<boost::shared_ptr<Redirect> >& redirects)
{
- list<Redirect*> copies;
+ list<boost::shared_ptr<Redirect> > copies;
- for (list<Redirect*>::iterator i = redirects.begin(); i != redirects.end(); ++i) {
+ for (list<boost::shared_ptr<Redirect> >::iterator i = redirects.begin(); i != redirects.end(); ++i) {
- Redirect* copy = Redirect::clone (**i);
+ boost::shared_ptr<Redirect> copy = Redirect::clone (*i);
copy->set_placement (_placement, this);
copies.push_back (copy);
}
- if (_route.add_redirects (copies, this)) {
- for (list<Redirect*>::iterator i = copies.begin(); i != copies.end(); ++i) {
- delete *i;
- }
+ if (_route->add_redirects (copies, this)) {
string msg = _(
"Copying the set of redirects on the clipboard failed,\n\
@@ -832,19 +827,19 @@ could not match the configuration of this track.");
}
void
-RedirectBox::activate_redirect (Redirect *r)
+RedirectBox::activate_redirect (boost::shared_ptr<Redirect> r)
{
r->set_active (true, 0);
}
void
-RedirectBox::deactivate_redirect (Redirect *r)
+RedirectBox::deactivate_redirect (boost::shared_ptr<Redirect> r)
{
r->set_active (false, 0);
}
void
-RedirectBox::get_selected_redirects (vector<Redirect*>& redirects)
+RedirectBox::get_selected_redirects (vector<boost::shared_ptr<Redirect> >& redirects)
{
vector<Gtk::TreeModel::Path> pathlist = redirect_display.get_selection()->get_selected_rows();
@@ -853,12 +848,12 @@ RedirectBox::get_selected_redirects (vector<Redirect*>& redirects)
}
void
-RedirectBox::for_selected_redirects (void (RedirectBox::*pmf)(Redirect*))
+RedirectBox::for_selected_redirects (void (RedirectBox::*pmf)(boost::shared_ptr<Redirect>))
{
vector<Gtk::TreeModel::Path> pathlist = redirect_display.get_selection()->get_selected_rows();
for (vector<Gtk::TreeModel::Path>::iterator iter = pathlist.begin(); iter != pathlist.end(); ++iter) {
- Redirect* redirect = (*(model->get_iter(*iter)))[columns.redirect];
+ boost::shared_ptr<Redirect> redirect = (*(model->get_iter(*iter)))[columns.redirect];
(this->*pmf)(redirect);
}
}
@@ -869,7 +864,7 @@ RedirectBox::clone_redirects ()
RouteSelection& routes (_rr_selection.routes);
if (!routes.empty()) {
- if (_route.copy_redirects (*routes.front(), _placement)) {
+ if (_route->copy_redirects (*routes.front(), _placement)) {
string msg = _(
"Copying the set of redirects on the clipboard failed,\n\
probably because the I/O configuration of the plugins\n\
@@ -883,7 +878,7 @@ could not match the configuration of this track.");
void
RedirectBox::all_redirects_active (bool state)
{
- _route.all_redirects_active (state);
+ _route->all_redirects_active (state);
}
void
@@ -892,7 +887,7 @@ RedirectBox::clear_redirects()
string prompt;
vector<string> choices;
- if (dynamic_cast<AudioTrack*>(&_route) != 0) {
+ if (boost::dynamic_pointer_cast<AudioTrack>(_route) != 0) {
prompt = _("Do you really want to remove all redirects from this track?\n"
"(this cannot be undone)");
} else {
@@ -906,23 +901,23 @@ RedirectBox::clear_redirects()
Gtkmm2ext::Choice prompter (prompt, choices);
if (prompter.run () == 1) {
- _route.clear_redirects (this);
+ _route->clear_redirects (this);
}
}
void
-RedirectBox::edit_redirect (Redirect* redirect)
+RedirectBox::edit_redirect (boost::shared_ptr<Redirect> redirect)
{
- Insert *insert;
+ boost::shared_ptr<Insert> insert;
- if (dynamic_cast<AudioTrack*>(&_route) != 0) {
+ if (boost::dynamic_pointer_cast<AudioTrack>(_route) != 0) {
- if (dynamic_cast<AudioTrack*> (&_route)->freeze_state() == AudioTrack::Frozen) {
+ if (boost::dynamic_pointer_cast<AudioTrack> (_route)->freeze_state() == AudioTrack::Frozen) {
return;
}
}
- if ((insert = dynamic_cast<Insert *> (redirect)) == 0) {
+ if ((insert = boost::dynamic_pointer_cast<Insert> (redirect)) == 0) {
/* its a send */
@@ -930,7 +925,7 @@ RedirectBox::edit_redirect (Redirect* redirect)
return;
}
- Send *send = dynamic_cast<Send*> (redirect);
+ boost::shared_ptr<Send> send = boost::dynamic_pointer_cast<Send> (redirect);
SendUIWindow *send_ui;
@@ -939,7 +934,7 @@ RedirectBox::edit_redirect (Redirect* redirect)
string title;
title = string_compose(_("ardour: %1"), send->name());
- send_ui = new SendUIWindow (*send, _session);
+ send_ui = new SendUIWindow (send, _session);
send_ui->set_title (title);
send->set_gui (send_ui);
@@ -957,17 +952,17 @@ RedirectBox::edit_redirect (Redirect* redirect)
/* its an insert */
- PluginInsert *plugin_insert;
- PortInsert *port_insert;
+ boost::shared_ptr<PluginInsert> plugin_insert;
+ boost::shared_ptr<PortInsert> port_insert;
- if ((plugin_insert = dynamic_cast<PluginInsert *> (insert)) != 0) {
+ if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) {
PluginUIWindow *plugin_ui;
if (plugin_insert->get_gui() == 0) {
string title;
- string maker = plugin_insert->plugin().maker();
+ string maker = plugin_insert->plugin()->maker();
string::size_type email_pos;
if ((email_pos = maker.find_first_of ('<')) != string::npos) {
@@ -979,9 +974,9 @@ RedirectBox::edit_redirect (Redirect* redirect)
maker += " ...";
}
- title = string_compose(_("ardour: %1: %2 (by %3)"), _route.name(), plugin_insert->name(), maker);
+ title = string_compose(_("ardour: %1: %2 (by %3)"), _route->name(), plugin_insert->name(), maker);
- plugin_ui = new PluginUIWindow (_session.engine(), *plugin_insert);
+ plugin_ui = new PluginUIWindow (_session.engine(), plugin_insert);
if (_owner_is_mixer) {
ARDOUR_UI::instance()->the_mixer()->ensure_float (*plugin_ui);
} else {
@@ -1000,7 +995,7 @@ RedirectBox::edit_redirect (Redirect* redirect)
plugin_ui->show_all ();
}
- } else if ((port_insert = dynamic_cast<PortInsert *> (insert)) != 0) {
+ } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) {
if (!_session.engine().connected()) {
MessageDialog msg ( _("Not connected to JACK - no I/O changes are possible"));
@@ -1011,7 +1006,7 @@ RedirectBox::edit_redirect (Redirect* redirect)
PortInsertWindow *io_selector;
if (port_insert->get_gui() == 0) {
- io_selector = new PortInsertWindow (_session, *port_insert);
+ io_selector = new PortInsertWindow (_session, port_insert);
port_insert->set_gui (io_selector);
} else {
diff --git a/gtk2_ardour/redirect_box.h b/gtk2_ardour/redirect_box.h
index 0a4a6d5dee..51c17cad51 100644
--- a/gtk2_ardour/redirect_box.h
+++ b/gtk2_ardour/redirect_box.h
@@ -65,7 +65,8 @@ namespace ARDOUR {
class RedirectBox : public Gtk::HBox
{
public:
- RedirectBox (ARDOUR::Placement, ARDOUR::Session&, ARDOUR::Route &, PluginSelector &, RouteRedirectSelection &, bool owner_is_mixer = false);
+ RedirectBox (ARDOUR::Placement, ARDOUR::Session&,
+ boost::shared_ptr<ARDOUR::Route>, PluginSelector &, RouteRedirectSelection &, bool owner_is_mixer = false);
~RedirectBox ();
void set_width (Width);
@@ -78,8 +79,8 @@ class RedirectBox : public Gtk::HBox
void select_all_inserts ();
void select_all_sends ();
- sigc::signal<void,ARDOUR::Redirect *> RedirectSelected;
- sigc::signal<void,ARDOUR::Redirect *> RedirectUnselected;
+ sigc::signal<void,boost::shared_ptr<ARDOUR::Redirect> > RedirectSelected;
+ sigc::signal<void,boost::shared_ptr<ARDOUR::Redirect> > RedirectUnselected;
static void register_actions();
@@ -87,7 +88,7 @@ class RedirectBox : public Gtk::HBox
void set_stuff_from_route ();
private:
- ARDOUR::Route & _route;
+ boost::shared_ptr<ARDOUR::Route> _route;
ARDOUR::Session & _session;
bool _owner_is_mixer;
@@ -103,7 +104,7 @@ class RedirectBox : public Gtk::HBox
add (color);
}
Gtk::TreeModelColumn<std::string> text;
- Gtk::TreeModelColumn<ARDOUR::Redirect*> redirect;
+ Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Redirect> > redirect;
Gtk::TreeModelColumn<Gdk::Color> color;
};
@@ -138,24 +139,29 @@ class RedirectBox : public Gtk::HBox
void show_redirect_menu (gint arg);
void choose_send ();
- void send_io_finished (IOSelector::Result, ARDOUR::Redirect*, IOSelectorWindow*);
+ void send_io_finished (IOSelector::Result, boost::shared_ptr<ARDOUR::Redirect>, IOSelectorWindow*);
void choose_insert ();
void choose_plugin ();
- void insert_plugin_chosen (ARDOUR::Plugin *);
+ void insert_plugin_chosen (boost::shared_ptr<ARDOUR::Plugin>);
bool no_redirect_redisplay;
bool ignore_delete;
bool redirect_button_press_event (GdkEventButton *);
void redisplay_redirects (void* src);
- void show_redirect_active (ARDOUR::Redirect *, void *);
- void show_redirect_name (void*, ARDOUR::Redirect *);
- void add_redirect_to_display (ARDOUR::Redirect *);
+ void add_redirect_to_display (boost::shared_ptr<ARDOUR::Redirect>);
void row_deleted (const Gtk::TreeModel::Path& path);
+ void show_redirect_name (void*, boost::shared_ptr<ARDOUR::Redirect>);
- string redirect_name (ARDOUR::Redirect&);
+ /* these are handlers for Redirect signals, so they take Redirect*
+ directly, rather than shared_ptr<Redirect>
+ */
- void remove_redirect_gui (ARDOUR::Redirect *);
+ void show_redirect_active (ARDOUR::Redirect*, void *);
+
+ string redirect_name (boost::shared_ptr<ARDOUR::Redirect>);
+
+ void remove_redirect_gui (boost::shared_ptr<ARDOUR::Redirect>);
void redirects_reordered (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&, int*);
void compute_redirect_sort_keys ();
@@ -174,23 +180,23 @@ class RedirectBox : public Gtk::HBox
void clone_redirects ();
void rename_redirects ();
- void for_selected_redirects (void (RedirectBox::*pmf)(ARDOUR::Redirect*));
- void get_selected_redirects (vector<ARDOUR::Redirect*>&);
+ void for_selected_redirects (void (RedirectBox::*pmf)(boost::shared_ptr<ARDOUR::Redirect>));
+ void get_selected_redirects (vector<boost::shared_ptr<ARDOUR::Redirect> >&);
static Glib::RefPtr<Gtk::Action> paste_action;
- void paste_redirect_list (std::list<ARDOUR::Redirect*>& redirects);
+ void paste_redirect_list (std::list<boost::shared_ptr<ARDOUR::Redirect> >& redirects);
- void activate_redirect (ARDOUR::Redirect*);
- void deactivate_redirect (ARDOUR::Redirect*);
- void cut_redirect (ARDOUR::Redirect*);
- void copy_redirect (ARDOUR::Redirect*);
- void edit_redirect (ARDOUR::Redirect*);
- void hide_redirect_editor (ARDOUR::Redirect*);
- void rename_redirect (ARDOUR::Redirect*);
+ void activate_redirect (boost::shared_ptr<ARDOUR::Redirect>);
+ void deactivate_redirect (boost::shared_ptr<ARDOUR::Redirect>);
+ void cut_redirect (boost::shared_ptr<ARDOUR::Redirect>);
+ void copy_redirect (boost::shared_ptr<ARDOUR::Redirect>);
+ void edit_redirect (boost::shared_ptr<ARDOUR::Redirect>);
+ void hide_redirect_editor (boost::shared_ptr<ARDOUR::Redirect>);
+ void rename_redirect (boost::shared_ptr<ARDOUR::Redirect>);
- gint idle_delete_redirect (ARDOUR::Redirect *);
+ gint idle_delete_redirect (boost::shared_ptr<ARDOUR::Redirect>);
- void wierd_plugin_dialog (ARDOUR::Plugin& p, uint32_t streams, ARDOUR::IO& io);
+ void wierd_plugin_dialog (ARDOUR::Plugin& p, uint32_t streams, boost::shared_ptr<ARDOUR::IO> io);
static RedirectBox* _current_redirect_box;
static bool enter_box (GdkEventCrossing*, RedirectBox*);
diff --git a/gtk2_ardour/redirect_selection.h b/gtk2_ardour/redirect_selection.h
index 3695f85c60..5bcd77cfe4 100644
--- a/gtk2_ardour/redirect_selection.h
+++ b/gtk2_ardour/redirect_selection.h
@@ -2,11 +2,12 @@
#define __ardour_gtk_redirect_selection_h__
#include <list>
+#include <boost/shared_ptr.hpp>
namespace ARDOUR {
class Redirect;
}
-struct RedirectSelection : list<ARDOUR::Redirect*> {};
+struct RedirectSelection : list<boost::shared_ptr<ARDOUR::Redirect> > {};
#endif /* __ardour_gtk_redirect_selection_h__ */
diff --git a/gtk2_ardour/route_params_ui.cc b/gtk2_ardour/route_params_ui.cc
index d6ec7eab6c..8b47a17511 100644
--- a/gtk2_ardour/route_params_ui.cc
+++ b/gtk2_ardour/route_params_ui.cc
@@ -59,14 +59,10 @@ using namespace sigc;
RouteParams_UI::RouteParams_UI (AudioEngine& eng)
: ArdourDialog ("track/bus inspector"),
engine (eng),
- _route(0),
track_menu(0)
{
pre_redirect_box = 0;
post_redirect_box = 0;
- _route = 0;
- _pre_redirect = 0;
- _post_redirect = 0;
_input_iosel = 0;
_output_iosel = 0;
_active_pre_view = 0;
@@ -163,7 +159,7 @@ RouteParams_UI::~RouteParams_UI ()
}
void
-RouteParams_UI::add_route (Route* route)
+RouteParams_UI::add_route (boost::shared_ptr<Route> route)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::add_route), route));
@@ -183,22 +179,22 @@ RouteParams_UI::add_route (Route* route)
void
-RouteParams_UI::route_name_changed (void *src, Route *route)
+RouteParams_UI::route_name_changed (void *src, boost::shared_ptr<Route> route)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::route_name_changed), src, route));
bool found = false ;
TreeModel::Children rows = route_display_model->children();
for(TreeModel::Children::iterator iter = rows.begin(); iter != rows.end(); ++iter) {
- if((*iter)[route_display_columns.route] == route) {
+ boost::shared_ptr<Route> r =(*iter)[route_display_columns.route];
+ if (r == route) {
(*iter)[route_display_columns.text] = route->name() ;
found = true ;
break;
}
}
- if(!found)
- {
+ if(!found) {
error << _("route display list item for renamed route not found!") << endmsg;
}
@@ -217,8 +213,8 @@ RouteParams_UI::setup_redirect_boxes()
cleanup_redirect_boxes();
// construct new redirect boxes
- pre_redirect_box = new RedirectBox(PreFader, *session, *_route, *_plugin_selector, _rr_selection);
- post_redirect_box = new RedirectBox(PostFader, *session, *_route, *_plugin_selector, _rr_selection);
+ pre_redirect_box = new RedirectBox(PreFader, *session, _route, *_plugin_selector, _rr_selection);
+ post_redirect_box = new RedirectBox(PostFader, *session, _route, *_plugin_selector, _rr_selection);
pre_redir_hpane.pack1 (*pre_redirect_box);
post_redir_hpane.pack1 (*post_redirect_box);
@@ -256,13 +252,13 @@ RouteParams_UI::setup_io_frames()
cleanup_io_frames();
// input
- _input_iosel = new IOSelector (*session, *_route, true);
+ _input_iosel = new IOSelector (*session, _route, true);
_input_iosel->redisplay ();
input_frame.add (*_input_iosel);
input_frame.show_all();
// output
- _output_iosel = new IOSelector (*session, *_route, false);
+ _output_iosel = new IOSelector (*session, _route, false);
_output_iosel->redisplay ();
output_frame.add (*_output_iosel);
output_frame.show_all();
@@ -322,36 +318,31 @@ RouteParams_UI::cleanup_post_view (bool stopupdate)
void
-RouteParams_UI::route_removed (Route *route)
+RouteParams_UI::route_removed (boost::shared_ptr<Route> route)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::route_removed), route));
- /*
- route_select_list.freeze ();
- route_select_list.clear ();
- session->foreach_route (this, &RouteParams_UI::add_route);
- route_select_list.thaw ();
- */
TreeModel::Children rows = route_display_model->children();
TreeModel::Children::iterator ri;
for(TreeModel::Children::iterator iter = rows.begin(); iter != rows.end(); ++iter) {
- if((*iter)[route_display_columns.route] == route) {
+ boost::shared_ptr<Route> r =(*iter)[route_display_columns.route];
+
+ if (r == route) {
route_display_model->erase(iter);
break;
}
}
- if (route == _route)
- {
+ if (route == _route) {
cleanup_io_frames();
cleanup_pre_view();
cleanup_post_view();
cleanup_redirect_boxes();
- _route = 0;
- _pre_redirect = 0;
- _post_redirect = 0;
+ _route.reset ((Route*) 0);
+ _pre_redirect.reset ((Redirect*) 0);
+ _post_redirect.reset ((Redirect*) 0);
update_title();
}
}
@@ -390,9 +381,9 @@ RouteParams_UI::session_gone ()
cleanup_post_view();
cleanup_redirect_boxes();
- _route = 0;
- _pre_redirect = 0;
- _post_redirect = 0;
+ _route.reset ((Route*) 0);
+ _pre_redirect.reset ((Redirect*) 0);
+ _post_redirect.reset ((Redirect*) 0);
update_title();
ArdourDialog::session_gone();
@@ -406,7 +397,7 @@ RouteParams_UI::route_selected()
TreeModel::iterator iter = selection->get_selected(); // only used with Gtk::SELECTION_SINGLE
if(iter) {
//If anything is selected
- Route* route = (*iter)[route_display_columns.route] ;
+ boost::shared_ptr<Route> route = (*iter)[route_display_columns.route] ;
if (_route == route) {
// do nothing
@@ -447,9 +438,9 @@ RouteParams_UI::route_selected()
cleanup_post_view();
cleanup_redirect_boxes();
- _route = 0;
- _pre_redirect = 0;
- _post_redirect = 0;
+ _route.reset ((Route*) 0);
+ _pre_redirect.reset ((Redirect*) 0);
+ _post_redirect.reset ((Redirect *) 0);
track_input_label.set_text(_("NO TRACK"));
update_title();
}
@@ -468,7 +459,7 @@ RouteParams_UI::route_selected()
// cleanup_post_view();
// cleanup_redirect_boxes();
-// _route = 0;
+// _route.reset ((Route*)0);
// _pre_redirect = 0;
// _post_redirect = 0;
// track_input_label.set_text(_("NO TRACK"));
@@ -495,8 +486,8 @@ RouteParams_UI::redirects_changed (void *src)
cleanup_pre_view();
cleanup_post_view();
- _pre_redirect = 0;
- _post_redirect = 0;
+ _pre_redirect.reset ((Redirect*) 0);
+ _post_redirect.reset ((Redirect*) 0);
//update_title();
}
@@ -520,24 +511,24 @@ RouteParams_UI::show_track_menu()
void
-RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement place)
+RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Redirect> redirect, ARDOUR::Placement place)
{
- Insert *insert;
+ boost::shared_ptr<Insert> insert;
if ((place == PreFader && _pre_redirect == redirect)
|| (place == PostFader && _post_redirect == redirect)){
return;
}
- if ((insert = dynamic_cast<Insert *> (redirect)) == 0) {
-
- Send *send;
+ if ((insert = boost::dynamic_pointer_cast<Insert> (redirect)) == 0) {
- if ((send = dynamic_cast<Send *> (redirect)) != 0) {
+ boost::shared_ptr<Send> send;
+
+ if ((send = boost::dynamic_pointer_cast<Send> (redirect)) != 0) {
/* its a send */
- SendUI *send_ui = new SendUI (*send, *session);
+ SendUI *send_ui = new SendUI (send, *session);
if (place == PreFader) {
cleanup_pre_view();
@@ -560,16 +551,16 @@ RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement
} else {
/* its an insert, though we don't know what kind yet. */
- PluginInsert *plugin_insert;
- PortInsert *port_insert;
+ boost::shared_ptr<PluginInsert> plugin_insert;
+ boost::shared_ptr<PortInsert> port_insert;
- if ((plugin_insert = dynamic_cast<PluginInsert *> (insert)) != 0) {
+ if ((plugin_insert = boost::dynamic_pointer_cast<PluginInsert> (insert)) != 0) {
- PluginUI *plugin_ui = new PluginUI (session->engine(), *plugin_insert, true);
+ PluginUI *plugin_ui = new PluginUI (session->engine(), plugin_insert, true);
if (place == PreFader) {
cleanup_pre_view();
- _pre_plugin_conn = plugin_insert->plugin().GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader));
+ _pre_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PreFader));
plugin_ui->start_updating (0);
_active_pre_view = plugin_ui;
pre_redir_hpane.pack2 (*_active_pre_view);
@@ -577,16 +568,16 @@ RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement
}
else {
cleanup_post_view();
- _post_plugin_conn = plugin_insert->plugin().GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader));
+ _post_plugin_conn = plugin_insert->plugin()->GoingAway.connect (bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), PostFader));
plugin_ui->start_updating (0);
_active_post_view = plugin_ui;
post_redir_hpane.pack2 (*_active_post_view);
post_redir_hpane.show_all();
}
- } else if ((port_insert = dynamic_cast<PortInsert *> (insert)) != 0) {
+ } else if ((port_insert = boost::dynamic_pointer_cast<PortInsert> (insert)) != 0) {
- PortInsertUI *portinsert_ui = new PortInsertUI (*session, *port_insert);
+ PortInsertUI *portinsert_ui = new PortInsertUI (*session, port_insert);
if (place == PreFader) {
cleanup_pre_view();
@@ -610,8 +601,7 @@ RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement
if (place == PreFader) {
_pre_redirect = redirect;
- }
- else {
+ } else {
_post_redirect = redirect;
}
@@ -620,23 +610,6 @@ RouteParams_UI::redirect_selected (ARDOUR::Redirect *redirect, ARDOUR::Placement
}
void
-RouteParams_UI::redirect_unselected (ARDOUR::Redirect *redirect)
-{
- // not called anymore
-
- if (redirect == _pre_redirect) {
- cleanup_pre_view();
- _pre_redirect = 0;
- }
- else if (redirect == _post_redirect) {
- cleanup_post_view();
- _post_redirect = 0;
- }
-}
-
-
-
-void
RouteParams_UI::plugin_going_away (Plugin *plugin, Placement place)
{
ENSURE_GUI_THREAD(bind (mem_fun(*this, &RouteParams_UI::plugin_going_away), plugin, place));
@@ -645,11 +618,11 @@ RouteParams_UI::plugin_going_away (Plugin *plugin, Placement place)
if (place == PreFader) {
cleanup_pre_view (false);
- _pre_redirect = 0;
+ _pre_redirect.reset ((Redirect*) 0);
}
else {
cleanup_post_view (false);
- _post_redirect = 0;
+ _post_redirect.reset ((Redirect*) 0);
}
}
@@ -661,13 +634,13 @@ RouteParams_UI::redirect_going_away (ARDOUR::Redirect *plugin)
printf ("redirect going away\n");
// delete the current view without calling finish
- if (plugin == _pre_redirect) {
+ if (plugin == _pre_redirect.get()) {
cleanup_pre_view (false);
- _pre_redirect = 0;
+ _pre_redirect.reset ((Redirect*) 0);
}
- else if (plugin == _post_redirect) {
+ else if (plugin == _post_redirect.get()) {
cleanup_post_view (false);
- _post_redirect = 0;
+ _post_redirect.reset ((Redirect*) 0);
}
}
diff --git a/gtk2_ardour/route_params_ui.h b/gtk2_ardour/route_params_ui.h
index 29f5b9112a..5f487d6e5c 100644
--- a/gtk2_ardour/route_params_ui.h
+++ b/gtk2_ardour/route_params_ui.h
@@ -121,14 +121,14 @@ class RouteParams_UI : public ArdourDialog
PluginSelector *_plugin_selector;
RouteRedirectSelection _rr_selection;
- ARDOUR::Route *_route;
+ boost::shared_ptr<ARDOUR::Route> _route;
sigc::connection _route_conn;
sigc::connection _route_ds_conn;
- ARDOUR::Redirect * _pre_redirect;
+ boost::shared_ptr<ARDOUR::Redirect> _pre_redirect;
sigc::connection _pre_plugin_conn;
- ARDOUR::Redirect * _post_redirect;
+ boost::shared_ptr<ARDOUR::Redirect> _post_redirect;
sigc::connection _post_plugin_conn;
@@ -151,7 +151,7 @@ class RouteParams_UI : public ArdourDialog
add(route);
}
Gtk::TreeModelColumn<Glib::ustring> text;
- Gtk::TreeModelColumn<ARDOUR::Route*> route;
+ Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Route> > route;
};
RouteDisplayModelColumns route_display_columns ;
@@ -159,10 +159,10 @@ class RouteParams_UI : public ArdourDialog
Glib::RefPtr<Gtk::ListStore> route_display_model;
- void add_route (ARDOUR::Route*);
+ void add_route (boost::shared_ptr<ARDOUR::Route>);
- void route_name_changed (void *src, ARDOUR::Route *route);
- void route_removed (ARDOUR::Route *route);
+ void route_name_changed (void *src, boost::shared_ptr<ARDOUR::Route> route);
+ void route_removed (boost::shared_ptr<ARDOUR::Route> route);
void route_selected();
@@ -180,8 +180,7 @@ class RouteParams_UI : public ArdourDialog
void setup_redirect_boxes();
void cleanup_redirect_boxes();
- void redirect_selected (ARDOUR::Redirect *, ARDOUR::Placement);
- void redirect_unselected (ARDOUR::Redirect *);
+ void redirect_selected (boost::shared_ptr<ARDOUR::Redirect>, ARDOUR::Placement);
void plugin_going_away (ARDOUR::Plugin *foo, ARDOUR::Placement);
void redirect_going_away (ARDOUR::Redirect *foo);
diff --git a/gtk2_ardour/route_redirect_selection.cc b/gtk2_ardour/route_redirect_selection.cc
index 6d315e0aae..76f202dd92 100644
--- a/gtk2_ardour/route_redirect_selection.cc
+++ b/gtk2_ardour/route_redirect_selection.cc
@@ -61,17 +61,6 @@ RouteRedirectSelection::clear ()
void
RouteRedirectSelection::clear_redirects ()
{
- for (RedirectSelection::iterator i = redirects.begin(); i != redirects.end(); ) {
- RedirectSelection::iterator tmp;
-
- tmp = i;
- ++tmp;
-
- delete *i;
-
- i = tmp;
- }
-
redirects.clear ();
RedirectsChanged ();
}
@@ -84,29 +73,32 @@ RouteRedirectSelection::clear_routes ()
}
void
-RouteRedirectSelection::add (Redirect* r)
+RouteRedirectSelection::add (boost::shared_ptr<Redirect> r)
{
if (find (redirects.begin(), redirects.end(), r) == redirects.end()) {
redirects.push_back (r);
-
- void (RouteRedirectSelection::*pmf)(Redirect*) = &RouteRedirectSelection::remove;
- r->GoingAway.connect (mem_fun(*this, pmf));
+
+ // XXX SHAREDPTR FIXME
+ // void (RouteRedirectSelection::*pmf)(Redirect*) = &RouteRedirectSelection::remove;
+ // r->GoingAway.connect (mem_fun(*this, pmf));
RedirectsChanged();
}
}
void
-RouteRedirectSelection::add (const vector<Redirect*>& rlist)
+RouteRedirectSelection::add (const vector<boost::shared_ptr<Redirect> >& rlist)
{
bool changed = false;
- for (vector<Redirect*>::const_iterator i = rlist.begin(); i != rlist.end(); ++i) {
+ for (vector<boost::shared_ptr<Redirect> >::const_iterator i = rlist.begin(); i != rlist.end(); ++i) {
if (find (redirects.begin(), redirects.end(), *i) == redirects.end()) {
redirects.push_back (*i);
- void (RouteRedirectSelection::*pmf)(Redirect*) = &RouteRedirectSelection::remove;
- (*i)->GoingAway.connect (mem_fun(*this, pmf));
+ // XXX SHAREDPTR FIXME
+
+ //void (RouteRedirectSelection::*pmf)(Redirect*) = &RouteRedirectSelection::remove;
+ // (*i)->GoingAway.connect (mem_fun(*this, pmf));
changed = true;
}
}
@@ -117,9 +109,9 @@ RouteRedirectSelection::add (const vector<Redirect*>& rlist)
}
void
-RouteRedirectSelection::remove (Redirect* r)
+RouteRedirectSelection::remove (boost::shared_ptr<Redirect> r)
{
- list<Redirect*>::iterator i;
+ list<boost::shared_ptr<Redirect> >::iterator i;
if ((i = find (redirects.begin(), redirects.end(), r)) != redirects.end()) {
redirects.erase (i);
RedirectsChanged ();
@@ -127,36 +119,37 @@ RouteRedirectSelection::remove (Redirect* r)
}
void
-RouteRedirectSelection::set (Redirect *r)
+RouteRedirectSelection::set (boost::shared_ptr<Redirect> r)
{
clear_redirects ();
add (r);
}
void
-RouteRedirectSelection::set (const vector<Redirect*>& rlist)
+RouteRedirectSelection::set (const vector<boost::shared_ptr<Redirect> >& rlist)
{
clear_redirects ();
add (rlist);
}
void
-RouteRedirectSelection::add (Route* r)
+RouteRedirectSelection::add (boost::shared_ptr<Route> r)
{
if (find (routes.begin(), routes.end(), r) == routes.end()) {
routes.push_back (r);
- void (RouteRedirectSelection::*pmf)(Route*) = &RouteRedirectSelection::remove;
- r->GoingAway.connect (bind (mem_fun(*this, pmf), r));
+ // XXX SHAREDPTR FIXME
+ // void (RouteRedirectSelection::*pmf)(Route*) = &RouteRedirectSelection::remove;
+ // r->GoingAway.connect (bind (mem_fun(*this, pmf), r));
RoutesChanged();
}
}
void
-RouteRedirectSelection::remove (Route* r)
+RouteRedirectSelection::remove (boost::shared_ptr<Route> r)
{
- list<Route*>::iterator i;
+ list<boost::shared_ptr<Route> >::iterator i;
if ((i = find (routes.begin(), routes.end(), r)) != routes.end()) {
routes.erase (i);
RoutesChanged ();
@@ -164,16 +157,16 @@ RouteRedirectSelection::remove (Route* r)
}
void
-RouteRedirectSelection::set (Route *r)
+RouteRedirectSelection::set (boost::shared_ptr<Route> r)
{
clear_routes ();
add (r);
}
bool
-RouteRedirectSelection::selected (Route* ms)
+RouteRedirectSelection::selected (boost::shared_ptr<Route> r)
{
- return find (routes.begin(), routes.end(), ms) != routes.end();
+ return find (routes.begin(), routes.end(), r) != routes.end();
}
bool
diff --git a/gtk2_ardour/route_redirect_selection.h b/gtk2_ardour/route_redirect_selection.h
index 9e2b866171..60d301e762 100644
--- a/gtk2_ardour/route_redirect_selection.h
+++ b/gtk2_ardour/route_redirect_selection.h
@@ -43,20 +43,20 @@ class RouteRedirectSelection : public sigc::trackable
void clear ();
bool empty();
- void set (ARDOUR::Redirect*);
- void set (const std::vector<ARDOUR::Redirect*>&);
- void add (ARDOUR::Redirect*);
- void add (const std::vector<ARDOUR::Redirect*>&);
- void remove (ARDOUR::Redirect*);
+ void set (boost::shared_ptr<ARDOUR::Redirect>);
+ void set (const std::vector<boost::shared_ptr<ARDOUR::Redirect> >&);
+ void add (boost::shared_ptr<ARDOUR::Redirect>);
+ void add (const std::vector<boost::shared_ptr<ARDOUR::Redirect> >&);
+ void remove (boost::shared_ptr<ARDOUR::Redirect>);
- void set (ARDOUR::Route*);
- void add (ARDOUR::Route*);
- void remove (ARDOUR::Route*);
+ void set (boost::shared_ptr<ARDOUR::Route>);
+ void add (boost::shared_ptr<ARDOUR::Route>);
+ void remove (boost::shared_ptr<ARDOUR::Route>);
void clear_redirects ();
void clear_routes ();
- bool selected (ARDOUR::Route*);
+ bool selected (boost::shared_ptr<ARDOUR::Route>);
};
bool operator==(const RouteRedirectSelection& a, const RouteRedirectSelection& b);
diff --git a/gtk2_ardour/route_selection.h b/gtk2_ardour/route_selection.h
index 50797deed3..8d5673a2ef 100644
--- a/gtk2_ardour/route_selection.h
+++ b/gtk2_ardour/route_selection.h
@@ -1,12 +1,14 @@
#ifndef __ardour_gtk_route_selection_h__
#define __ardour_gtk_route_selection_h__
+
+#include <boost/shared_ptr.hpp>
#include <list>
namespace ARDOUR {
class Route;
}
-struct RouteSelection : list<ARDOUR::Route*> {};
+struct RouteSelection : std::list<boost::shared_ptr<ARDOUR::Route> > {};
#endif /* __ardour_gtk_route_selection_h__ */
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index a02814839a..eb20eeac08 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -44,9 +44,9 @@ using namespace ARDOUR;
using namespace PBD;
-RouteUI::RouteUI (ARDOUR::Route& rt, ARDOUR::Session& sess, const char* m_name,
+RouteUI::RouteUI (boost::shared_ptr<ARDOUR::Route> rt, ARDOUR::Session& sess, const char* m_name,
const char* s_name, const char* r_name)
- : AxisView(sess),
+ : AxisView(sess),
_route(rt),
mute_button(0),
solo_button(0),
@@ -64,16 +64,16 @@ RouteUI::RouteUI (ARDOUR::Route& rt, ARDOUR::Session& sess, const char* m_name,
set_color (unique_random_color());
}
- _route.GoingAway.connect (mem_fun (*this, &RouteUI::route_removed));
- _route.active_changed.connect (mem_fun (*this, &RouteUI::route_active_changed));
+ _route->GoingAway.connect (mem_fun (*this, &RouteUI::route_removed));
+ _route->active_changed.connect (mem_fun (*this, &RouteUI::route_active_changed));
- mute_button = manage (new BindableToggleButton (_route.mute_control(), m_name ));
- solo_button = manage (new BindableToggleButton (_route.solo_control(), s_name ));
+ mute_button = manage (new BindableToggleButton (_route->mute_control(), m_name ));
+ solo_button = manage (new BindableToggleButton (_route->solo_control(), s_name ));
if (is_audio_track()) {
- AudioTrack* at = dynamic_cast<AudioTrack*>(&_route);
+ boost::shared_ptr<AudioTrack> at = boost::dynamic_pointer_cast<AudioTrack>(_route);
- get_diskstream()->record_enable_changed.connect (mem_fun (*this, &RouteUI::route_rec_enable_changed));
+ at->disk_stream().record_enable_changed.connect (mem_fun (*this, &RouteUI::route_rec_enable_changed));
_session.RecordStateChanged.connect (mem_fun (*this, &RouteUI::session_rec_enable_changed));
@@ -129,7 +129,7 @@ RouteUI::mute_press(GdkEventButton* ev)
_session.begin_reversible_command (_("mute change"));
_session.add_undo (_session.global_mute_memento(this));
- _session.set_all_mute (!_route.muted());
+ _session.set_all_mute (!_route->muted());
_session.add_redo_no_execute (_session.global_mute_memento(this));
_session.commit_reversible_command ();
@@ -140,14 +140,14 @@ RouteUI::mute_press(GdkEventButton* ev)
*/
if (ev->button == 1) {
- set_mix_group_mute (_route, !_route.muted());
+ set_mix_group_mute (_route, !_route->muted());
}
} else {
/* plain click applies change to this route */
- reversibly_apply_route_boolean ("mute change", &Route::set_mute, !_route.muted(), this);
+ reversibly_apply_route_boolean ("mute change", &Route::set_mute, !_route->muted(), this);
}
}
}
@@ -204,7 +204,7 @@ RouteUI::solo_press(GdkEventButton* ev)
_session.begin_reversible_command (_("solo change"));
_session.add_undo (_session.global_solo_memento(this));
- _session.set_all_solo (!_route.soloed());
+ _session.set_all_solo (!_route->soloed());
_session.add_redo_no_execute (_session.global_solo_memento(this));
_session.commit_reversible_command ();
@@ -215,7 +215,7 @@ RouteUI::solo_press(GdkEventButton* ev)
_session.begin_reversible_command (_("solo change"));
_session.add_undo (_session.global_solo_memento(this));
_session.set_all_solo (false);
- _route.set_solo (true, this);
+ _route->set_solo (true, this);
_session.add_redo_no_execute (_session.global_solo_memento(this));
_session.commit_reversible_command ();
@@ -223,7 +223,7 @@ RouteUI::solo_press(GdkEventButton* ev)
// shift-click: set this route to solo safe
- _route.set_solo_safe (!_route.solo_safe(), this);
+ _route->set_solo_safe (!_route->solo_safe(), this);
wait_for_release = false;
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
@@ -233,14 +233,14 @@ RouteUI::solo_press(GdkEventButton* ev)
*/
if (ev->button == 1) {
- set_mix_group_solo (_route, !_route.soloed());
+ set_mix_group_solo (_route, !_route->soloed());
}
} else {
/* click: solo this route */
- reversibly_apply_route_boolean ("solo change", &Route::set_solo, !_route.soloed(), this);
+ reversibly_apply_route_boolean ("solo change", &Route::set_solo, !_route->soloed(), this);
}
}
}
@@ -289,7 +289,7 @@ RouteUI::rec_enable_press(GdkEventButton* ev)
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::Control)) {
- set_mix_group_rec_enable (_route, !_route.record_enabled());
+ set_mix_group_rec_enable (_route, !_route->record_enabled());
} else {
@@ -317,7 +317,7 @@ RouteUI::update_solo_display ()
{
bool x;
- if (solo_button->get_active() != (x = _route.soloed())){
+ if (solo_button->get_active() != (x = _route->soloed())){
ignore_toggle = true;
solo_button->set_active(x);
ignore_toggle = false;
@@ -325,7 +325,7 @@ RouteUI::update_solo_display ()
/* show solo safe */
- if (_route.solo_safe()){
+ if (_route->solo_safe()){
solo_button->set_name(safe_solo_button_name());
} else {
solo_button->set_name(solo_button_name());
@@ -343,7 +343,7 @@ RouteUI::update_mute_display ()
{
bool x;
- if (mute_button->get_active() != (x = _route.muted())){
+ if (mute_button->get_active() != (x = _route->muted())){
ignore_toggle = true;
mute_button->set_active(x);
ignore_toggle = false;
@@ -365,7 +365,7 @@ RouteUI::session_rec_enable_changed ()
void
RouteUI::update_rec_display ()
{
- bool model = _route.record_enabled();
+ bool model = _route->record_enabled();
bool view = rec_enable_button->get_active();
/* first make sure the button's "depressed" visual
@@ -431,7 +431,7 @@ RouteUI::refresh_remote_control_menu ()
limit += 4; /* leave some breathing room */
rc_items.push_back (RadioMenuElem (rc_group, _("None")));
- if (_route.remote_control_id() == 0) {
+ if (_route->remote_control_id() == 0) {
rc_active = dynamic_cast<CheckMenuItem*> (&rc_items.back());
rc_active->set_active ();
}
@@ -440,7 +440,7 @@ RouteUI::refresh_remote_control_menu ()
snprintf (buf, sizeof (buf), "%u", i);
rc_items.push_back (RadioMenuElem (rc_group, buf));
rc_active = dynamic_cast<RadioMenuItem*>(&rc_items.back());
- if (_route.remote_control_id() == i) {
+ if (_route->remote_control_id() == i) {
rc_active = dynamic_cast<CheckMenuItem*> (&rc_items.back());
rc_active->set_active ();
}
@@ -458,7 +458,7 @@ RouteUI::set_remote_control_id (uint32_t id, CheckMenuItem* item)
*/
if (item->get_active()) {
- _route.set_remote_control_id (id);
+ _route->set_remote_control_id (id);
}
}
@@ -473,9 +473,9 @@ RouteUI::build_solo_menu (void)
CheckMenuItem* check;
check = new CheckMenuItem(_("Solo-safe"));
- check->set_active (_route.solo_safe());
+ check->set_active (_route->solo_safe());
check->signal_toggled().connect (bind (mem_fun (*this, &RouteUI::toggle_solo_safe), check));
- _route.solo_safe_changed.connect(bind (mem_fun (*this, &RouteUI::solo_safe_toggle), check));
+ _route->solo_safe_changed.connect(bind (mem_fun (*this, &RouteUI::solo_safe_toggle), check));
items.push_back (CheckMenuElem(*check));
check->show_all();
@@ -497,28 +497,28 @@ RouteUI::build_mute_menu(void)
check = new CheckMenuItem(_("Pre Fader"));
init_mute_menu(PRE_FADER, check);
check->signal_toggled().connect(bind (mem_fun (*this, &RouteUI::toggle_mute_menu), PRE_FADER, check));
- _route.pre_fader_changed.connect(bind (mem_fun (*this, &RouteUI::pre_fader_toggle), check));
+ _route->pre_fader_changed.connect(bind (mem_fun (*this, &RouteUI::pre_fader_toggle), check));
items.push_back (CheckMenuElem(*check));
check->show_all();
check = new CheckMenuItem(_("Post Fader"));
init_mute_menu(POST_FADER, check);
check->signal_toggled().connect(bind (mem_fun (*this, &RouteUI::toggle_mute_menu), POST_FADER, check));
- _route.post_fader_changed.connect(bind (mem_fun (*this, &RouteUI::post_fader_toggle), check));
+ _route->post_fader_changed.connect(bind (mem_fun (*this, &RouteUI::post_fader_toggle), check));
items.push_back (CheckMenuElem(*check));
check->show_all();
check = new CheckMenuItem(_("Control Outs"));
init_mute_menu(CONTROL_OUTS, check);
check->signal_toggled().connect(bind (mem_fun (*this, &RouteUI::toggle_mute_menu), CONTROL_OUTS, check));
- _route.control_outs_changed.connect(bind (mem_fun (*this, &RouteUI::control_outs_toggle), check));
+ _route->control_outs_changed.connect(bind (mem_fun (*this, &RouteUI::control_outs_toggle), check));
items.push_back (CheckMenuElem(*check));
check->show_all();
check = new CheckMenuItem(_("Main Outs"));
init_mute_menu(MAIN_OUTS, check);
check->signal_toggled().connect(bind (mem_fun (*this, &RouteUI::toggle_mute_menu), MAIN_OUTS, check));
- _route.main_outs_changed.connect(bind (mem_fun (*this, &RouteUI::main_outs_toggle), check));
+ _route->main_outs_changed.connect(bind (mem_fun (*this, &RouteUI::main_outs_toggle), check));
items.push_back (CheckMenuElem(*check));
check->show_all();
@@ -529,7 +529,7 @@ RouteUI::build_mute_menu(void)
void
RouteUI::init_mute_menu(mute_type type, CheckMenuItem* check)
{
- if (_route.get_mute_config (type)) {
+ if (_route->get_mute_config (type)) {
check->set_active (true);
}
}
@@ -537,28 +537,28 @@ RouteUI::init_mute_menu(mute_type type, CheckMenuItem* check)
void
RouteUI::toggle_mute_menu(mute_type type, Gtk::CheckMenuItem* check)
{
- _route.set_mute_config(type, check->get_active(), this);
+ _route->set_mute_config(type, check->get_active(), this);
}
void
RouteUI::toggle_solo_safe (Gtk::CheckMenuItem* check)
{
- _route.set_solo_safe (check->get_active(), this);
+ _route->set_solo_safe (check->get_active(), this);
}
void
-RouteUI::set_mix_group_solo(Route& route, bool yn)
+RouteUI::set_mix_group_solo(boost::shared_ptr<Route> route, bool yn)
{
RouteGroup* mix_group;
- if((mix_group = route.mix_group()) != 0){
+ if((mix_group = route->mix_group()) != 0){
_session.begin_reversible_command (_("mix group solo change"));
_session.add_undo (_session.global_solo_memento (this));
mix_group->apply(&Route::set_solo, yn, this);
_session.add_redo_no_execute (_session.global_solo_memento(this));
_session.commit_reversible_command ();
} else {
- reversibly_apply_route_boolean ("solo change", &Route::set_solo, !route.soloed(), this);
+ reversibly_apply_route_boolean ("solo change", &Route::set_solo, !route->soloed(), this);
}
}
@@ -566,8 +566,8 @@ void
RouteUI::reversibly_apply_route_boolean (string name, void (Route::*func)(bool, void *), bool yn, void *arg)
{
_session.begin_reversible_command (name);
- _session.add_undo (bind (mem_fun (_route, func), !yn, (void *) arg));
- _session.add_redo (bind (mem_fun (_route, func), yn, (void *) arg));
+ _session.add_undo (bind (mem_fun (*_route, func), !yn, (void *) arg));
+ _session.add_redo (bind (mem_fun (*_route, func), yn, (void *) arg));
_session.commit_reversible_command ();
}
@@ -581,34 +581,34 @@ RouteUI::reversibly_apply_audio_track_boolean (string name, void (AudioTrack::*f
}
void
-RouteUI::set_mix_group_mute(Route& route, bool yn)
+RouteUI::set_mix_group_mute(boost::shared_ptr<Route> route, bool yn)
{
RouteGroup* mix_group;
- if((mix_group = route.mix_group()) != 0){
+ if((mix_group = route->mix_group()) != 0){
_session.begin_reversible_command (_("mix group mute change"));
_session.add_undo (_session.global_mute_memento (this));
mix_group->apply(&Route::set_mute, yn, this);
_session.add_redo_no_execute (_session.global_mute_memento(this));
_session.commit_reversible_command ();
} else {
- reversibly_apply_route_boolean ("mute change", &Route::set_mute, !route.muted(), this);
+ reversibly_apply_route_boolean ("mute change", &Route::set_mute, !route->muted(), this);
}
}
void
-RouteUI::set_mix_group_rec_enable(Route& route, bool yn)
+RouteUI::set_mix_group_rec_enable(boost::shared_ptr<Route> route, bool yn)
{
RouteGroup* mix_group;
- if((mix_group = route.mix_group()) != 0){
+ if((mix_group = route->mix_group()) != 0){
_session.begin_reversible_command (_("mix group rec-enable change"));
_session.add_undo (_session.global_record_enable_memento (this));
mix_group->apply (&Route::set_record_enable, yn, this);
_session.add_redo_no_execute (_session.global_record_enable_memento(this));
_session.commit_reversible_command ();
} else {
- reversibly_apply_route_boolean ("rec-enable change", &Route::set_record_enable, !_route.record_enabled(), this);
+ reversibly_apply_route_boolean ("rec-enable change", &Route::set_record_enable, !_route->record_enabled(), this);
}
}
@@ -639,7 +639,7 @@ RouteUI::set_color (const Gdk::Color & c)
snprintf (buf, sizeof (buf), "%d:%d:%d", c.get_red(), c.get_green(), c.get_blue());
xml_node->add_property ("color", buf);
- _route.gui_changed ("color", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("color", (void *) 0); /* EMIT_SIGNAL */
}
@@ -647,9 +647,9 @@ void
RouteUI::ensure_xml_node ()
{
if (xml_node == 0) {
- if ((xml_node = _route.extra_xml ("GUI")) == 0) {
+ if ((xml_node = _route->extra_xml ("GUI")) == 0) {
xml_node = new XMLNode ("GUI");
- _route.add_extra_xml (*xml_node);
+ _route->add_extra_xml (*xml_node);
}
}
}
@@ -695,9 +695,9 @@ RouteUI::remove_this_route ()
string prompt;
if (is_audio_track()) {
- prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n\nYou may also lose the playlist used by this track.\n(cannot be undone)"), _route.name());
+ prompt = string_compose (_("Do you really want to remove track \"%1\" ?\n\nYou may also lose the playlist used by this track.\n(cannot be undone)"), _route->name());
} else {
- prompt = string_compose (_("Do you really want to remove bus \"%1\" ?\n(cannot be undone)"), _route.name());
+ prompt = string_compose (_("Do you really want to remove bus \"%1\" ?\n(cannot be undone)"), _route->name());
}
choices.push_back (_("No, do nothing."));
@@ -731,7 +731,7 @@ RouteUI::route_rename ()
ArdourPrompter name_prompter (true);
string result;
name_prompter.set_prompt (_("New Name: "));
- name_prompter.set_initial_text (_route.name());
+ name_prompter.set_initial_text (_route->name());
name_prompter.add_button (_("Rename"), Gtk::RESPONSE_ACCEPT);
name_prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
name_prompter.show_all ();
@@ -741,7 +741,7 @@ RouteUI::route_rename ()
case Gtk::RESPONSE_ACCEPT:
name_prompter.get_result (result);
if (result.length()) {
- _route.set_name (result, this);
+ _route->set_name (result, this);
}
break;
}
@@ -755,7 +755,7 @@ RouteUI::name_changed (void *src)
{
ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::name_changed), src));
- name_label.set_text (_route.name());
+ name_label.set_text (_route->name());
}
void
@@ -764,8 +764,8 @@ RouteUI::toggle_route_active ()
bool yn;
if (route_active_menu_item) {
- if (route_active_menu_item->get_active() != (yn = _route.active())) {
- _route.set_active (!yn);
+ if (route_active_menu_item->get_active() != (yn = _route->active())) {
+ _route->set_active (!yn);
}
}
}
@@ -774,7 +774,7 @@ void
RouteUI::route_active_changed ()
{
if (route_active_menu_item) {
- Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun (*route_active_menu_item, &CheckMenuItem::set_active), _route.active()));
+ Gtkmm2ext::UI::instance()->call_slot (bind (mem_fun (*route_active_menu_item, &CheckMenuItem::set_active), _route->active()));
}
}
@@ -787,12 +787,12 @@ RouteUI::toggle_polarity ()
ENSURE_GUI_THREAD(mem_fun (*this, &RouteUI::toggle_polarity));
- if ((x = polarity_menu_item->get_active()) != _route.phase_invert()) {
- _route.set_phase_invert (x, this);
+ if ((x = polarity_menu_item->get_active()) != _route->phase_invert()) {
+ _route->set_phase_invert (x, this);
if (x) {
name_label.set_text (X_("Ø ") + name_label.get_text());
} else {
- name_label.set_text (_route.name());
+ name_label.set_text (_route->name());
}
}
}
@@ -807,7 +807,7 @@ RouteUI::polarity_changed ()
void
RouteUI::solo_safe_toggle(void* src, Gtk::CheckMenuItem* check)
{
- bool yn = _route.solo_safe ();
+ bool yn = _route->solo_safe ();
if (check->get_active() != yn) {
check->set_active (yn);
@@ -818,7 +818,7 @@ RouteUI::pre_fader_toggle(void* src, Gtk::CheckMenuItem* check)
{
ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::pre_fader_toggle), src, check));
- bool yn = _route.get_mute_config(PRE_FADER);
+ bool yn = _route->get_mute_config(PRE_FADER);
if (check->get_active() != yn) {
check->set_active (yn);
}
@@ -829,7 +829,7 @@ RouteUI::post_fader_toggle(void* src, Gtk::CheckMenuItem* check)
{
ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::post_fader_toggle), src, check));
- bool yn = _route.get_mute_config(POST_FADER);
+ bool yn = _route->get_mute_config(POST_FADER);
if (check->get_active() != yn) {
check->set_active (yn);
}
@@ -840,7 +840,7 @@ RouteUI::control_outs_toggle(void* src, Gtk::CheckMenuItem* check)
{
ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::control_outs_toggle), src, check));
- bool yn = _route.get_mute_config(CONTROL_OUTS);
+ bool yn = _route->get_mute_config(CONTROL_OUTS);
if (check->get_active() != yn) {
check->set_active (yn);
}
@@ -851,7 +851,7 @@ RouteUI::main_outs_toggle(void* src, Gtk::CheckMenuItem* check)
{
ENSURE_GUI_THREAD(bind (mem_fun (*this, &RouteUI::main_outs_toggle), src, check));
- bool yn = _route.get_mute_config(MAIN_OUTS);
+ bool yn = _route->get_mute_config(MAIN_OUTS);
if (check->get_active() != yn) {
check->set_active (yn);
}
@@ -860,27 +860,27 @@ RouteUI::main_outs_toggle(void* src, Gtk::CheckMenuItem* check)
void
RouteUI::disconnect_input ()
{
- _route.disconnect_inputs (this);
+ _route->disconnect_inputs (this);
}
void
RouteUI::disconnect_output ()
{
- _route.disconnect_outputs (this);
+ _route->disconnect_outputs (this);
}
bool
RouteUI::is_audio_track () const
{
- return dynamic_cast<AudioTrack*>(&_route) != 0;
+ return dynamic_cast<AudioTrack*>(_route.get()) != 0;
}
AudioDiskstream*
RouteUI::get_diskstream () const
{
- AudioTrack *at;
+ boost::shared_ptr<AudioTrack> at;
- if ((at = dynamic_cast<AudioTrack*>(&_route)) != 0) {
+ if ((at = boost::dynamic_pointer_cast<AudioTrack>(_route)) != 0) {
return &at->disk_stream();
} else {
return 0;
@@ -890,12 +890,13 @@ RouteUI::get_diskstream () const
AudioTrack*
RouteUI::audio_track() const
{
- return dynamic_cast<AudioTrack*>(&_route);
+ return dynamic_cast<AudioTrack*>(_route.get());
}
+
string
RouteUI::name() const
{
- return _route.name();
+ return _route->name();
}
void
@@ -903,7 +904,7 @@ RouteUI::map_frozen ()
{
ENSURE_GUI_THREAD (mem_fun (*this, &RouteUI::map_frozen));
- AudioTrack* at = dynamic_cast<AudioTrack*>(&_route);
+ AudioTrack* at = dynamic_cast<AudioTrack*>(_route.get());
if (at) {
switch (at->freeze_state()) {
diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h
index df2e3aa319..48f7d47b97 100644
--- a/gtk2_ardour/route_ui.h
+++ b/gtk2_ardour/route_ui.h
@@ -44,18 +44,20 @@ class BindableToggleButton;
class RouteUI : public virtual AxisView
{
public:
- RouteUI(ARDOUR::Route&, ARDOUR::Session&, const char*, const char*, const char*);
+ RouteUI(boost::shared_ptr<ARDOUR::Route>, ARDOUR::Session&, const char*, const char*, const char*);
virtual ~RouteUI();
bool is_audio_track() const;
ARDOUR::AudioDiskstream* get_diskstream() const;
- ARDOUR::Route& route() const { return _route; }
+ boost::shared_ptr<ARDOUR::Route> route() const { return _route; }
ARDOUR::AudioTrack* audio_track() const;
string name() const;
-
- ARDOUR::Route& _route;
+
+ // protected: XXX sigh this should be here
+
+ boost::shared_ptr<ARDOUR::Route> _route;
void set_color (const Gdk::Color & c);
bool choose_color ();
@@ -106,9 +108,9 @@ class RouteUI : public virtual AxisView
void build_mute_menu(void);
void init_mute_menu(ARDOUR::mute_type, Gtk::CheckMenuItem*);
- void set_mix_group_solo(ARDOUR::Route&, bool);
- void set_mix_group_mute(ARDOUR::Route&, bool);
- void set_mix_group_rec_enable(ARDOUR::Route&, bool);
+ void set_mix_group_solo(boost::shared_ptr<ARDOUR::Route>, bool);
+ void set_mix_group_mute(boost::shared_ptr<ARDOUR::Route>, bool);
+ void set_mix_group_rec_enable(boost::shared_ptr<ARDOUR::Route>, bool);
int set_color_from_route ();
diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc
index 2e4ed8a117..6dae5b0bcd 100644
--- a/gtk2_ardour/selection.cc
+++ b/gtk2_ardour/selection.cc
@@ -151,7 +151,7 @@ Selection::clear_lines ()
}
void
-Selection::toggle (Redirect* r)
+Selection::toggle (boost::shared_ptr<Redirect> r)
{
RedirectSelection::iterator i;
@@ -243,7 +243,7 @@ Selection::toggle (jack_nframes_t start, jack_nframes_t end)
void
-Selection::add (Redirect* r)
+Selection::add (boost::shared_ptr<Redirect> r)
{
if (find (redirects.begin(), redirects.end(), r) == redirects.end()) {
redirects.push_back (r);
@@ -381,9 +381,9 @@ Selection::add (AutomationList* ac)
}
void
-Selection::remove (Redirect* r)
+Selection::remove (boost::shared_ptr<Redirect> r)
{
- list<Redirect*>::iterator i;
+ RedirectSelection::iterator i;
if ((i = find (redirects.begin(), redirects.end(), r)) != redirects.end()) {
redirects.erase (i);
RedirectsChanged ();
@@ -491,7 +491,7 @@ Selection::remove (AutomationList *ac)
}
void
-Selection::set (Redirect *r)
+Selection::set (boost::shared_ptr<Redirect> r)
{
clear_redirects ();
add (r);
diff --git a/gtk2_ardour/selection.h b/gtk2_ardour/selection.h
index ebeda1aea7..102e6e9410 100644
--- a/gtk2_ardour/selection.h
+++ b/gtk2_ardour/selection.h
@@ -22,6 +22,7 @@
#define __ardour_gtk_selection_h__
#include <vector>
+#include <boost/shared_ptr.hpp>
#include <sigc++/signal.h>
@@ -101,7 +102,7 @@ class Selection : public sigc::trackable
void set (ARDOUR::AutomationList*);
void set (ARDOUR::Playlist*);
void set (const list<ARDOUR::Playlist*>&);
- void set (ARDOUR::Redirect*);
+ void set (boost::shared_ptr<ARDOUR::Redirect>);
void set (AutomationSelectable*);
void toggle (TimeAxisView*);
@@ -112,7 +113,7 @@ class Selection : public sigc::trackable
void toggle (ARDOUR::AutomationList*);
void toggle (ARDOUR::Playlist*);
void toggle (const list<ARDOUR::Playlist*>&);
- void toggle (ARDOUR::Redirect*);
+ void toggle (boost::shared_ptr<ARDOUR::Redirect>);
void add (TimeAxisView*);
void add (const list<TimeAxisView*>&);
@@ -122,7 +123,7 @@ class Selection : public sigc::trackable
void add (ARDOUR::AutomationList*);
void add (ARDOUR::Playlist*);
void add (const list<ARDOUR::Playlist*>&);
- void add (ARDOUR::Redirect*);
+ void add (boost::shared_ptr<ARDOUR::Redirect>);
void remove (TimeAxisView*);
void remove (const list<TimeAxisView*>&);
@@ -132,7 +133,7 @@ class Selection : public sigc::trackable
void remove (ARDOUR::AutomationList*);
void remove (ARDOUR::Playlist*);
void remove (const list<ARDOUR::Playlist*>&);
- void remove (ARDOUR::Redirect*);
+ void remove (boost::shared_ptr<ARDOUR::Redirect>);
void replace (uint32_t time_index, jack_nframes_t start, jack_nframes_t end);
diff --git a/gtk2_ardour/send_ui.cc b/gtk2_ardour/send_ui.cc
index be95f753e7..9925ff51d4 100644
--- a/gtk2_ardour/send_ui.cc
+++ b/gtk2_ardour/send_ui.cc
@@ -30,7 +30,7 @@
using namespace ARDOUR;
using namespace PBD;
-SendUI::SendUI (Send& s, Session& se)
+SendUI::SendUI (boost::shared_ptr<Send> s, Session& se)
: _send (s),
_session (se),
gpm (s, se),
@@ -53,10 +53,10 @@ SendUI::SendUI (Send& s, Session& se)
show_all ();
- _send.set_metering (true);
+ _send->set_metering (true);
- _send.output_changed.connect (mem_fun (*this, &SendUI::ins_changed));
- _send.output_changed.connect (mem_fun (*this, &SendUI::outs_changed));
+ _send->output_changed.connect (mem_fun (*this, &SendUI::ins_changed));
+ _send->output_changed.connect (mem_fun (*this, &SendUI::outs_changed));
panners.set_width (Wide);
panners.setup_pan ();
@@ -70,7 +70,7 @@ SendUI::SendUI (Send& s, Session& se)
SendUI::~SendUI ()
{
- _send.set_metering (false);
+ _send->set_metering (false);
/* XXX not clear that we need to do this */
@@ -118,7 +118,7 @@ SendUI::fast_update ()
}
}
-SendUIWindow::SendUIWindow (Send& s, Session& ss)
+SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session& ss)
{
ui = new SendUI (s, ss);
@@ -131,7 +131,7 @@ SendUIWindow::SendUIWindow (Send& s, Session& ss)
add (vpacker);
set_name ("SendUIWindow");
- s.GoingAway.connect (mem_fun (*this, &SendUIWindow::send_going_away));
+ s->GoingAway.connect (mem_fun (*this, &SendUIWindow::send_going_away));
signal_delete_event().connect (bind (ptr_fun (just_hide_it), reinterpret_cast<Window *> (this)));
diff --git a/gtk2_ardour/send_ui.h b/gtk2_ardour/send_ui.h
index d1a49930ea..1d5a74e102 100644
--- a/gtk2_ardour/send_ui.h
+++ b/gtk2_ardour/send_ui.h
@@ -35,7 +35,7 @@ class IOSelector;
class SendUI : public Gtk::HBox
{
public:
- SendUI (ARDOUR::Send&, ARDOUR::Session&);
+ SendUI (boost::shared_ptr<ARDOUR::Send>, ARDOUR::Session&);
~SendUI();
void update ();
@@ -44,7 +44,7 @@ class SendUI : public Gtk::HBox
IOSelector* io;
private:
- ARDOUR::Send& _send;
+ boost::shared_ptr<ARDOUR::Send> _send;
ARDOUR::Session& _session;
GainMeter gpm;
PannerUI panners;
@@ -62,7 +62,7 @@ class SendUI : public Gtk::HBox
class SendUIWindow : public Gtk::Window
{
public:
- SendUIWindow(ARDOUR::Send&, ARDOUR::Session&);
+ SendUIWindow(boost::shared_ptr<ARDOUR::Send>, ARDOUR::Session&);
~SendUIWindow();
SendUI* ui;
diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc
index 5cca008dc0..4948525b15 100644
--- a/gtk2_ardour/sfdb_ui.cc
+++ b/gtk2_ardour/sfdb_ui.cc
@@ -404,6 +404,9 @@ SoundFileOmega::set_mode (Editing::ImportMode mode)
case Editing::ImportToTrack:
split_check.set_sensitive (false);
break;
+ case Editing::ImportAsTapeTrack:
+ split_check.set_sensitive (true);
+ break;
}
}
@@ -443,5 +446,8 @@ SoundFileOmega::mode_changed ()
case Editing::ImportToTrack:
split_check.set_sensitive (false);
break;
+ case Editing::ImportAsTapeTrack:
+ split_check.set_sensitive (true);
+ break;
}
}