#include "evoral/Parameter.hpp"
#include "ardour_ui.h"
+#include "ardour_button.h"
#include "debug.h"
#include "global_signals.h"
#include "route_time_axis.h"
using namespace Gtk;
using namespace Editing;
using namespace std;
+using std::list;
Glib::RefPtr<Gdk::Pixbuf> RouteTimeAxisView::slider;
, TimeAxisView(sess,ed,(TimeAxisView*) 0, canvas)
, _view (0)
, parent_canvas (canvas)
+ , no_redraw (false)
, button_table (3, 3)
, route_group_button (_("g"))
, playlist_button (_("p"))
ignore_toggle = false;
- route_group_button.set_name ("TrackGroupButton");
- playlist_button.set_name ("TrackPlaylistButton");
- automation_button.set_name ("TrackAutomationButton");
-
- route_group_button.unset_flags (Gtk::CAN_FOCUS);
- playlist_button.unset_flags (Gtk::CAN_FOCUS);
- automation_button.unset_flags (Gtk::CAN_FOCUS);
+ route_group_button.set_name ("route button");
+ playlist_button.set_name ("route button");
+ automation_button.set_name ("route button");
route_group_button.signal_button_release_event().connect (sigc::mem_fun(*this, &RouteTimeAxisView::route_group_click), false);
- playlist_button.signal_clicked().connect (sigc::mem_fun(*this, &RouteTimeAxisView::playlist_click));
- automation_button.signal_clicked().connect (sigc::mem_fun(*this, &RouteTimeAxisView::automation_click));
+ playlist_button.signal_clicked.connect (sigc::mem_fun(*this, &RouteTimeAxisView::playlist_click));
+ automation_button.signal_clicked.connect (sigc::mem_fun(*this, &RouteTimeAxisView::automation_click));
if (is_track()) {
/* use icon */
-
- rec_enable_button->remove ();
-
+
switch (track()->mode()) {
case ARDOUR::Normal:
case ARDOUR::NonLayered:
- rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_normal_red"))))));
+ rec_enable_button->set_image (::get_icon (X_("record_normal_red")));
break;
case ARDOUR::Destructive:
- rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_tape_red"))))));
+ rec_enable_button->set_image (::get_icon (X_("record_tape_red")));
break;
}
- rec_enable_button->show_all ();
controls_table.attach (*rec_enable_button, 5, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
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 ();
}
++overlaid;
break;
case Stacked:
+ case Expanded:
++stacked;
break;
}
switch (mode) {
case ARDOUR::NonLayered:
case ARDOUR::Normal:
- rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_normal_red"))))));
+ rec_enable_button->set_image (::get_icon (X_("record_normal_red")));
+ rec_enable_button->set_text (string());
break;
case ARDOUR::Destructive:
- rec_enable_button->add (*(manage (new Image (::get_icon (X_("record_tape_red"))))));
+ rec_enable_button->set_image (::get_icon (X_("record_tape_red")));
+ rec_enable_button->set_text (string());
break;
}
}
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());
+ PROGRAM_NAME));
+ name_entry.grab_focus ();
+ } else if (RouteUI::verify_new_route_name (x)) {
+ _route->set_name (x);
} else {
-
- if (RouteUI::verify_new_route_name (x)) {
- _route->set_name (x);
- } else {
- name_entry.grab_focus ();
- }
+ 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;
}
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;
void
RouteTimeAxisView::set_button_names ()
{
- rec_enable_button_label.set_text (_("r"));
-
if (_route && _route->solo_safe()) {
- solo_button_label.set_text (X_("!"));
+ solo_button->remove ();
+ if (solo_safe_pixbuf == 0) {
+ solo_safe_pixbuf = ::get_icon("solo-safe-icon");
+ }
+ solo_button->set_image (solo_safe_pixbuf);
+ solo_button->set_text (string());
} else {
+ solo_button->set_image (Glib::RefPtr<Gdk::Pixbuf>());
if (Config->get_solo_control_is_listen_control()) {
switch (Config->get_listen_position()) {
case AfterFaderListen:
- solo_button_label.set_text (_("A"));
+ solo_button->set_text (_("A"));
break;
case PreFaderListen:
- solo_button_label.set_text (_("P"));
+ solo_button->set_text (_("P"));
break;
}
} else {
- solo_button_label.set_text (_("s"));
+ solo_button->set_text (_("s"));
}
}
- mute_button_label.set_text (_("m"));
+ mute_button->set_text (_("m"));
}
Gtk::CheckMenuItem*
{
return string_compose ("rtav %1", _route->id().to_s());
}
+
+
+void
+RouteTimeAxisView::remove_child (boost::shared_ptr<TimeAxisView> c)
+{
+ TimeAxisView::remove_child (c);
+
+ boost::shared_ptr<AutomationTimeAxisView> a = boost::dynamic_pointer_cast<AutomationTimeAxisView> (c);
+ if (a) {
+ for (AutomationTracks::iterator i = _automation_tracks.begin(); i != _automation_tracks.end(); ++i) {
+ if (i->second == a) {
+ _automation_tracks.erase (i);
+ return;
+ }
+ }
+ }
+}