fixes for various bugs including dangling ref to route in session, opening sessions from the NSD, closing a session leaving dangling pointers etc etc
git-svn-id: svn://localhost/ardour2/trunk@938 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
0b6139304b
commit
02115563fe
|
@ -294,8 +294,6 @@ ActionManager::toggle_config_state (const char* group, const char* action, bool
|
|||
if (tact) {
|
||||
bool x = (Config->*get)();
|
||||
|
||||
cerr << "\ttoggle config, action = " << tact->get_active() << " config = " << x << endl;
|
||||
|
||||
if (x != tact->get_active()) {
|
||||
(Config->*set) (!x);
|
||||
}
|
||||
|
@ -326,13 +324,11 @@ ActionManager::map_some_state (const char* group, const char* action, bool (Conf
|
|||
|
||||
bool x = (Config->*get)();
|
||||
|
||||
cerr << "\tmap state, action = " << tact->get_active() << " config = " << x << endl;
|
||||
|
||||
if (tact->get_active() != x) {
|
||||
tact->set_active (x);
|
||||
}
|
||||
} else {
|
||||
cerr << "not a toggle\n";
|
||||
cerr << group << ':' << action << " is not a toggle\n";
|
||||
}
|
||||
} else {
|
||||
cerr << group << ':' << action << " not an action\n";
|
||||
|
|
|
@ -1629,6 +1629,7 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
|
|||
do {
|
||||
response = new_session_dialog->run ();
|
||||
//nsd_window ->set_cursor(Gdk::Cursor(Gdk::WATCH));
|
||||
|
||||
if(response == Gtk::RESPONSE_CANCEL || response == Gtk::RESPONSE_DELETE_EVENT) {
|
||||
quit();
|
||||
return;
|
||||
|
@ -1645,7 +1646,6 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
|
|||
|
||||
if (session_name.empty()) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
cerr << "session name is empty\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1660,6 +1660,8 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
|
|||
|
||||
} else if (response == Gtk::RESPONSE_OK) {
|
||||
|
||||
session_name = new_session_dialog->session_name();
|
||||
|
||||
if (new_session_dialog->get_current_page() == 1) {
|
||||
|
||||
/* XXX this is a bit of a hack..
|
||||
|
@ -1670,7 +1672,6 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
|
|||
|
||||
if (session_name.empty()) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
cerr << "session name is empty 2\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1687,11 +1688,8 @@ ARDOUR_UI::new_session (bool startup, std::string predetermined_path)
|
|||
|
||||
_session_is_new = true;
|
||||
|
||||
session_name = new_session_dialog->session_name();
|
||||
|
||||
if (session_name.empty()) {
|
||||
response = Gtk::RESPONSE_NONE;
|
||||
cerr << "session name is empty 3\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -747,8 +747,6 @@ ARDOUR_UI::set_meter_falloff (MeterFalloff val)
|
|||
void
|
||||
ARDOUR_UI::parameter_changed (const char* parameter_name)
|
||||
{
|
||||
cerr << "Parameter changed : " << parameter_name << endl;
|
||||
|
||||
#define PARAM_IS(x) (!strcmp (parameter_name, (x)))
|
||||
|
||||
if (PARAM_IS ("slave-source")) {
|
||||
|
|
|
@ -816,7 +816,7 @@ Editor::parameter_changed (const char* parameter_name)
|
|||
} else if (PARAM_IS ("crossfades-visible")) {
|
||||
ActionManager::map_some_state ("Editor", "toggle-xfades-visible", &Configuration::get_crossfades_visible);
|
||||
} else if (PARAM_IS ("auto-xfade")) {
|
||||
ActionManager::map_some_state ("Editor", "toggle-auto-xfade", &Configuration::get_auto_xfade);
|
||||
ActionManager::map_some_state ("Editor", "toggle-auto-xfades", &Configuration::get_auto_xfade);
|
||||
} else if (PARAM_IS ("edit-mode")) {
|
||||
edit_mode_selector.set_active_text (edit_mode_to_string (Config->get_edit_mode()));
|
||||
}
|
||||
|
|
|
@ -235,6 +235,7 @@ Editor::redisplay_regions ()
|
|||
for (list<boost::shared_ptr<AudioRegion> >::iterator r = tmp_audio_region_list.begin(); r != tmp_audio_region_list.end(); ++r) {
|
||||
add_audio_region_to_region_display (*r);
|
||||
}
|
||||
tmp_audio_region_list.clear();
|
||||
|
||||
region_list_display.set_model (region_list_model);
|
||||
}
|
||||
|
|
|
@ -1419,7 +1419,7 @@ class Session : public sigc::trackable, public PBD::StatefulDestructible
|
|||
bool currently_soloing;
|
||||
|
||||
void route_mute_changed (void *src);
|
||||
void route_solo_changed (void *src, boost::shared_ptr<Route>);
|
||||
void route_solo_changed (void *src, boost::weak_ptr<Route>);
|
||||
void catch_up_on_solo ();
|
||||
void update_route_solo_state ();
|
||||
void modify_solo_mute (bool, bool);
|
||||
|
|
|
@ -1967,8 +1967,6 @@ AudioDiskstream::reset_write_sources (bool mark_write_complete, bool force)
|
|||
ChannelList::iterator chan;
|
||||
uint32_t n;
|
||||
|
||||
cerr << _name << " RWS\n";
|
||||
|
||||
if (!recordable()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -101,7 +101,6 @@ AudioFileSource::AudioFileSource (Session& s, const XMLNode& node)
|
|||
AudioFileSource::~AudioFileSource ()
|
||||
{
|
||||
if (removable()) {
|
||||
cerr << "Removing file " << _path << " because its removable\n";
|
||||
unlink (_path.c_str());
|
||||
unlink (peakpath.c_str());
|
||||
}
|
||||
|
|
|
@ -1825,7 +1825,10 @@ Session::add_routes (RouteList& new_routes, bool save)
|
|||
}
|
||||
|
||||
for (RouteList::iterator x = new_routes.begin(); x != new_routes.end(); ++x) {
|
||||
(*x)->solo_changed.connect (sigc::bind (mem_fun (*this, &Session::route_solo_changed), (*x)));
|
||||
|
||||
boost::weak_ptr<Route> wpr (*x);
|
||||
|
||||
(*x)->solo_changed.connect (sigc::bind (mem_fun (*this, &Session::route_solo_changed), wpr));
|
||||
(*x)->mute_changed.connect (mem_fun (*this, &Session::route_mute_changed));
|
||||
(*x)->output_changed.connect (mem_fun (*this, &Session::set_worst_io_latencies_x));
|
||||
(*x)->redirects_changed.connect (mem_fun (*this, &Session::update_latency_compensation_proxy));
|
||||
|
@ -1883,11 +1886,11 @@ Session::remove_route (shared_ptr<Route> route)
|
|||
*/
|
||||
|
||||
if (route == _master_out) {
|
||||
_master_out = shared_ptr<Route> ((Route*) 0);
|
||||
_master_out = shared_ptr<Route> ();
|
||||
}
|
||||
|
||||
if (route == _control_out) {
|
||||
_control_out = shared_ptr<Route> ((Route*) 0);
|
||||
_control_out = shared_ptr<Route> ();
|
||||
|
||||
/* cancel control outs for all routes */
|
||||
|
||||
|
@ -1925,13 +1928,21 @@ Session::remove_route (shared_ptr<Route> route)
|
|||
update_latency_compensation (false, false);
|
||||
set_dirty();
|
||||
|
||||
/* XXX should we disconnect from the Route's signals ? */
|
||||
/* get rid of it from the dead wood collection in the route list manager */
|
||||
|
||||
save_state (_current_snapshot_name);
|
||||
/* XXX i think this is unsafe as it currently stands, but i am not sure. (pd, october 2nd, 2006) */
|
||||
|
||||
routes.flush ();
|
||||
|
||||
/* try to cause everyone to drop their references */
|
||||
|
||||
route->drop_references ();
|
||||
|
||||
/* save the new state of the world */
|
||||
|
||||
if (save_state (_current_snapshot_name)) {
|
||||
save_history (_current_snapshot_name);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1941,7 +1952,7 @@ Session::route_mute_changed (void* src)
|
|||
}
|
||||
|
||||
void
|
||||
Session::route_solo_changed (void* src, shared_ptr<Route> route)
|
||||
Session::route_solo_changed (void* src, boost::weak_ptr<Route> wpr)
|
||||
{
|
||||
if (solo_update_disabled) {
|
||||
// We know already
|
||||
|
@ -1949,8 +1960,15 @@ Session::route_solo_changed (void* src, shared_ptr<Route> route)
|
|||
}
|
||||
|
||||
bool is_track;
|
||||
|
||||
is_track = (dynamic_cast<AudioTrack*>(route.get()) != 0);
|
||||
boost::shared_ptr<Route> route = wpr.lock ();
|
||||
|
||||
if (!route) {
|
||||
/* should not happen */
|
||||
error << string_compose (_("programming error: %1"), X_("invalid route weak ptr passed to route_solo_changed")) << endmsg;
|
||||
return;
|
||||
}
|
||||
|
||||
is_track = (boost::dynamic_pointer_cast<AudioTrack>(route) != 0);
|
||||
|
||||
shared_ptr<RouteList> r = routes.reader ();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user