along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <cstdlib>
#include <ardour/location.h>
#include <ardour/panner.h>
#include <ardour/playlist.h>
+#include <ardour/profile.h>
#include <ardour/session.h>
#include <ardour/session_playlist.h>
#include <ardour/utils.h>
using namespace Gtk;
using namespace Editing;
-
AudioTimeAxisView::AudioTimeAxisView (PublicEditor& ed, Session& sess, boost::shared_ptr<Route> rt, Canvas& canvas)
: AxisView(sess)
, RouteTimeAxisView(ed, sess, rt, canvas)
_route->panner().Changed.connect (mem_fun(*this, &AudioTimeAxisView::update_pans));
- if (is_audio_track()) {
+ update_control_names ();
- controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
- controls_base_selected_name = "AudioTrackControlsBaseSelected";
- controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
+ if (is_audio_track()) {
/* ask for notifications of any new RegionViews */
_view->RegionViewAdded.connect (mem_fun(*this, &AudioTimeAxisView::region_view_added));
- _view->attach ();
- } else { /* bus */
+ if (!editor.have_idled()) {
+ /* first idle will do what we need */
+ } else {
+ first_idle ();
+ }
- controls_ebox.set_name ("AudioBusControlsBaseUnselected");
- controls_base_selected_name = "AudioBusControlsBaseSelected";
- controls_base_unselected_name = "AudioBusControlsBaseUnselected";
+ } else {
+ post_construct ();
}
}
{
}
+void
+AudioTimeAxisView::first_idle ()
+{
+ _view->attach ();
+ post_construct ();
+}
+
AudioStreamView*
AudioTimeAxisView::audio_view()
{
TimeAxisView::hide ();
}
-void
+int
AudioTimeAxisView::set_state (const XMLNode& node)
{
const XMLProperty *prop;
-
- TimeAxisView::set_state (node);
-
- if ((prop = node.property ("shown_editor")) != 0) {
- if (prop->value() == "no") {
- _marked_for_display = false;
+ int ret;
+
+ if ((ret = TimeAxisView::set_state (node)) != 0) {
+ return ret;
+ }
+
+ /* if the TimeAxisView had marked this not for display,
+ then do not allow this to override it.
+ */
+
+ if ((prop = node.property ("marked_for_display")) == 0) {
+ if ((prop = node.property ("shown_editor")) != 0) {
+ if (prop->value() == "no") {
+ _marked_for_display = false;
+ } else {
+ _marked_for_display = true;
+ }
} else {
_marked_for_display = true;
}
- } else {
- _marked_for_display = true;
}
XMLNodeList nlist = node.children();
continue;
}
}
+
+ return 0;
}
void
MenuList& items = display_menu->items();
// crossfade stuff
- items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
- items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
+ if (!Profile->get_sae()) {
+ items.push_back (MenuElem (_("Hide all crossfades"), mem_fun(*this, &AudioTimeAxisView::hide_all_xfades)));
+ items.push_back (MenuElem (_("Show all crossfades"), mem_fun(*this, &AudioTimeAxisView::show_all_xfades)));
+ }
// waveform menu
Menu *waveform_menu = manage(new Menu);
waveform_item->set_active (editor.show_waveforms());
ignore_toggle = false;
+ waveform_items.push_back (SeparatorElem());
+
RadioMenuItem::Group group;
-
+
waveform_items.push_back (RadioMenuElem (group, _("Traditional"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Traditional)));
traditional_item = static_cast<RadioMenuItem *> (&waveform_items.back());
- waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
- rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
+ if (!Profile->get_sae()) {
+ waveform_items.push_back (RadioMenuElem (group, _("Rectified"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_shape), Rectified)));
+ rectified_item = static_cast<RadioMenuItem *> (&waveform_items.back());
+ } else {
+ rectified_item = 0;
+ }
+
+ waveform_items.push_back (SeparatorElem());
+
+ RadioMenuItem::Group group2;
+
+ waveform_items.push_back (RadioMenuElem (group2, _("Linear"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_scale), LinearWaveform)));
+ linearscale_item = static_cast<RadioMenuItem *> (&waveform_items.back());
+
+ waveform_items.push_back (RadioMenuElem (group2, _("Logarithmic"), bind (mem_fun(*this, &AudioTimeAxisView::set_waveform_scale), LogWaveform)));
+ logscale_item = static_cast<RadioMenuItem *> (&waveform_items.back());
+
+ // setting initial item state
+ AudioStreamView* asv = audio_view();
+ if (asv) {
+ ignore_toggle = true;
+ if (asv->get_waveform_shape() == Rectified && rectified_item) {
+ rectified_item->set_active(true);
+ } else {
+ traditional_item->set_active(true);
+ }
+
+ if (asv->get_waveform_scale() == LogWaveform)
+ logscale_item->set_active(true);
+ else linearscale_item->set_active(true);
+ ignore_toggle = false;
+ }
items.push_back (MenuElem (_("Waveform"), *waveform_menu));
}
{
AudioStreamView* asv = audio_view();
- if (asv) {
+ if (asv && !ignore_toggle) {
asv->set_waveform_shape (shape);
}
map_frozen ();
}
+void
+AudioTimeAxisView::set_waveform_scale (WaveformScale scale)
+{
+ AudioStreamView* asv = audio_view();
+
+ if (asv && !ignore_toggle) {
+ asv->set_waveform_scale (scale);
+ }
+
+ map_frozen ();
+}
+
void
AudioTimeAxisView::add_gain_automation_child ()
{
*gain_track->canvas_display,
_route->gain_automation_curve());
- line->set_line_color (color_map[cAutomationLine]);
+ line->set_line_color (ARDOUR_UI::config()->canvasvar_AutomationLine.get());
gain_track->add_line (*line);
(*p)->automation());
if (p == _route->panner().begin()) {
- /* first line is a nice orange */
- line->set_line_color (color_map[cLeftPanAutomationLine]);
+ line->set_line_color (ARDOUR_UI::config()->canvasvar_AutomationLine.get());
} else {
- /* second line is a nice blue */
- line->set_line_color (color_map[cRightPanAutomationLine]);
+ line->set_line_color (ARDOUR_UI::config()->canvasvar_AutomationLine.get());
}
pan_track->add_line (*line);
void
AudioTimeAxisView::toggle_gain_track ()
{
-
bool showit = gain_automation_item->get_active();
if (showit != gain_track->marked_for_display()) {
/* now trigger a redisplay */
if (!no_redraw) {
- _route->gui_changed (X_("track_height"), (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed (X_("visible_tracks"), (void *) 0); /* EMIT_SIGNAL */
}
}
}
gain_automation_item->set_active (false);
}
- _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
}
void
/* now trigger a redisplay */
if (!no_redraw) {
- _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
}
}
}
pan_automation_item->set_active (false);
}
- _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
}
void
no_redraw = false;
- _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
}
void
no_redraw = false;
- _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
}
void
RouteTimeAxisView::hide_all_automation();
no_redraw = false;
- _route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
+ _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
}
void
AudioTimeAxisView::route_active_changed ()
{
RouteTimeAxisView::route_active_changed ();
+ update_control_names ();
+}
+
+/**
+ * Set up the names of the controls so that they are coloured
+ * correctly depending on whether this route is inactive or
+ * selected.
+ */
+
+void
+AudioTimeAxisView::update_control_names ()
+{
if (is_audio_track()) {
if (_route->active()) {
- controls_ebox.set_name ("AudioTrackControlsBaseUnselected");
controls_base_selected_name = "AudioTrackControlsBaseSelected";
controls_base_unselected_name = "AudioTrackControlsBaseUnselected";
} else {
- controls_ebox.set_name ("AudioTrackControlsBaseInactiveUnselected");
controls_base_selected_name = "AudioTrackControlsBaseInactiveSelected";
controls_base_unselected_name = "AudioTrackControlsBaseInactiveUnselected";
}
} else {
if (_route->active()) {
- controls_ebox.set_name ("BusControlsBaseUnselected");
controls_base_selected_name = "BusControlsBaseSelected";
controls_base_unselected_name = "BusControlsBaseUnselected";
} else {
- controls_ebox.set_name ("BusControlsBaseInactiveUnselected");
controls_base_selected_name = "BusControlsBaseInactiveSelected";
controls_base_unselected_name = "BusControlsBaseInactiveUnselected";
}
}
+
+ if (get_selected()) {
+ controls_ebox.set_name (controls_base_selected_name);
+ } else {
+ controls_ebox.set_name (controls_base_unselected_name);
+ }
}
XMLNode*