}
if (!_route->is_hidden()) {
- set_gui_property ("visible", "yes");
+ if (gui_property ("visible").empty()) {
+ set_gui_property ("visible", true);
+ }
+ } else {
+ set_gui_property ("visible", false);
}
mute_changed (0);
rec_enable_button->set_sensitive (_session->writable());
}
-
+
controls_hbox.pack_start(gm.get_level_meter(), false, false);
_route->meter_change.connect (*this, invalidator (*this), bind (&RouteTimeAxisView::meter_changed, this), gui_context());
_route->input()->changed.connect (*this, invalidator (*this), ui_bind (&RouteTimeAxisView::io_changed, this, _1, _2), gui_context());
gm.get_gain_slider().signal_scroll_event().connect(sigc::mem_fun(*this, &RouteTimeAxisView::controls_ebox_scroll), false);
gm.get_gain_slider().set_name ("TrackGainFader");
+ gm.get_level_meter().signal_scroll_event().connect (sigc::mem_fun (*this, &RouteTimeAxisView::controls_ebox_scroll), false);
+
show_name_entry ();
hide_name_label ();
}
}
void
-RouteTimeAxisView::set_color (Gdk::Color const & c)
+RouteTimeAxisView::route_color_changed ()
{
- RouteUI::set_color (c);
-
if (_view) {
- _view->apply_color (_color, StreamView::RegionColor);
+ _view->apply_color (color(), StreamView::RegionColor);
}
}
void
RouteTimeAxisView::name_entry_changed ()
{
- string x;
-
- x = name_entry.get_text ();
+ string x = name_entry.get_text ();
if (x == _route->name()) {
return;
}
- strip_whitespace_edges(x);
+ strip_whitespace_edges (x);
if (x.length() == 0) {
name_entry.set_text (_route->name());
return;
}
- if (!_session->route_name_unique (x)) {
- ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
- name_entry.set_text (_route->name());
- } else if (_session->route_name_internal (x)) {
+ if (_session->route_name_internal (x)) {
ARDOUR_UI::instance()->popup_error (string_compose (_("You cannot create a track with that name as it is reserved for %1"),
- PROGRAM_NAME));
- name_entry.set_text (_route->name());
- } else {
+ PROGRAM_NAME));
+ name_entry.grab_focus ();
+ } else if (RouteUI::verify_new_route_name (x)) {
_route->set_name (x);
+ } else {
+ name_entry.grab_focus ();
}
}
playlist_action_menu->set_name ("ArdourContextMenu");
playlist_items.clear();
- vector<boost::shared_ptr<Playlist> > playlists, playlists_tr;
- boost::shared_ptr<Track> tr = track();
RadioMenuItem::Group playlist_group;
+ boost::shared_ptr<Track> tr = track ();
- _session->playlists->get (playlists);
-
- /* find the playlists for this diskstream */
- for (vector<boost::shared_ptr<Playlist> >::iterator i = playlists.begin(); i != playlists.end(); ++i) {
- if (((*i)->get_orig_diskstream_id() == tr->diskstream_id()) || (tr->playlist()->id() == (*i)->id())) {
- playlists_tr.push_back(*i);
- }
- }
+ vector<boost::shared_ptr<Playlist> > playlists_tr = _session->playlists->playlists_for_track (tr);
/* sort the playlists */
PlaylistSorter cmp;
return;
}
- boost::shared_ptr<AudioPlaylist> apl = boost::dynamic_pointer_cast<AudioPlaylist> (pl);
+ if (track()->playlist() == pl) {
+ // exit when use_playlist is called by the creation of the playlist menu
+ // or the playlist choice is unchanged
+ return;
+ }
- if (apl) {
- if (track()->playlist() == apl) {
- // exit when use_playlist is called by the creation of the playlist menu
- // or the playlist choice is unchanged
+ track()->use_playlist (pl);
+
+ RouteGroup* rg = route_group();
+
+ if (rg && rg->is_active() && rg->enabled_property (ARDOUR::Properties::edit.property_id)) {
+ std::string group_string = "." + rg->name() + ".";
+
+ std::string take_name = pl->name();
+ std::string::size_type idx = take_name.find(group_string);
+
+ if (idx == std::string::npos)
return;
- }
- track()->use_playlist (apl);
-
- RouteGroup* rg = route_group();
-
- if (rg && rg->is_active() && rg->enabled_property (ARDOUR::Properties::edit.property_id)) {
- std::string group_string = "." + rg->name() + ".";
-
- std::string take_name = apl->name();
- std::string::size_type idx = take_name.find(group_string);
-
- if (idx == std::string::npos)
- return;
-
- take_name = take_name.substr(idx + group_string.length()); // find the bit containing the take number / name
-
- boost::shared_ptr<RouteList> rl (rg->route_list());
-
- for (RouteList::const_iterator i = rl->begin(); i != rl->end(); ++i) {
- if ( (*i) == this->route()) {
- continue;
- }
-
- std::string playlist_name = (*i)->name()+group_string+take_name;
-
- boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track>(*i);
- if (!track) {
- continue;
- }
-
- boost::shared_ptr<Playlist> ipl = session()->playlists->by_name(playlist_name);
- if (!ipl) {
- // No playlist for this track for this take yet, make it
- track->use_new_playlist();
- track->playlist()->set_name(playlist_name);
- } else {
- track->use_playlist(ipl);
- }
+
+ take_name = take_name.substr(idx + group_string.length()); // find the bit containing the take number / name
+
+ boost::shared_ptr<RouteList> rl (rg->route_list());
+
+ for (RouteList::const_iterator i = rl->begin(); i != rl->end(); ++i) {
+ if ( (*i) == this->route()) {
+ continue;
+ }
+
+ std::string playlist_name = (*i)->name()+group_string+take_name;
+
+ boost::shared_ptr<Track> track = boost::dynamic_pointer_cast<Track>(*i);
+ if (!track) {
+ continue;
+ }
+
+ boost::shared_ptr<Playlist> ipl = session()->playlists->by_name(playlist_name);
+ if (!ipl) {
+ // No playlist for this track for this take yet, make it
+ track->use_new_playlist();
+ track->playlist()->set_name(playlist_name);
+ } else {
+ track->use_playlist(ipl);
}
}
}
}
void
-RouteTimeAxisView::processor_automation_track_hidden (RouteTimeAxisView::ProcessorAutomationNode* pan, boost::shared_ptr<Processor> i)
+RouteTimeAxisView::processor_automation_track_hidden (RouteTimeAxisView::ProcessorAutomationNode* pan, boost::shared_ptr<Processor>)
{
if (!_hidden) {
pan->menu_item->set_active (false);
}
void
-RouteTimeAxisView::add_underlay (StreamView* v, bool update_xml)
+RouteTimeAxisView::add_underlay (StreamView* v, bool /*update_xml*/)
{
if (!v) {
return;
{
return string_compose ("rtav %1", _route->id().to_s());
}
+