<menuitem action='track-height-smaller'/>
<menuitem action='track-height-small'/>
</menu>
- <menu action='WaveformMenu'>
- <menuitem action='toggle-waveform-visible'/>
- <menuitem action='linear-waveforms'/>
- <menuitem action='logarithmic-waveforms'/>
- </menu>
<menuitem action='toggle-track-active'/>
<menuitem action='remove-track'/>
</menu>
<menuitem action='show-editor-mixer'/>
<menuitem action='show-editor-list'/>
<menuitem action='ToggleMeasureVisibility'/>
- <menuitem action='toggle-waveform-visible'/>
<menuitem action='ToggleWaveformsWhileRecording'/>
</menu>
<menu name='JACK' action='JACK'>
void
AudioRegionView::set_waveform_scale (WaveformScale scale)
{
- bool yn = (scale == LogWaveform);
+ bool yn = (scale == Logarithmic);
if (yn != (bool) (_flags & WaveformLogScaled)) {
for (vector<WaveView *>::iterator wave = waves.begin(); wave != waves.end() ; ++wave) {
void set_envelope_visible (bool);
void set_waveform_visible (bool yn);
- void set_waveform_shape (Editing::WaveformShape);
- void set_waveform_scale (Editing::WaveformScale);
+ void set_waveform_shape (ARDOUR::WaveformShape);
+ void set_waveform_scale (ARDOUR::WaveformScale);
bool waveform_rectified() const { return _flags & WaveformRectified; }
bool waveform_logscaled() const { return _flags & WaveformLogScaled; }
: StreamView (tv)
{
crossfades_visible = true;
- _waveform_scale = LinearWaveform;
- _waveform_shape = Traditional;
color_handler ();
_amplitude_above_axis = 1.0;
use_rec_regions = tv.editor().show_waveforms_recording ();
+
+ Config->ParameterChanged.connect (sigc::mem_fun (*this, &AudioStreamView::parameter_changed));
}
AudioStreamView::~AudioStreamView ()
region_view->set_sensitive (false);
}
- /* if this was the first one, then lets query the waveform scale and shape.
- otherwise, we set it to the current value */
-
- if (region_views.size() == 1) {
-
- if (region_view->waveform_logscaled()) {
- _waveform_scale = LogWaveform;
- } else {
- _waveform_scale = LinearWaveform;
- }
-
- if (region_view->waveform_rectified()) {
- _waveform_shape = Rectified;
- } else {
- _waveform_shape = Traditional;
- }
- }
- else {
- region_view->set_waveform_scale(_waveform_scale);
- region_view->set_waveform_shape(_waveform_shape);
- }
-
- /* follow global waveform setting */
- region_view->set_waveform_visible(_trackview.editor().show_waveforms());
+ region_view->set_waveform_scale (Config->get_waveform_scale ());
+ region_view->set_waveform_shape (Config->get_waveform_shape ());
+ region_view->set_waveform_visible (Config->get_show_waveforms ());
return region_view;
}
if (arv)
arv->set_waveform_shape (shape);
}
- _waveform_shape = shape;
}
void
{
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*i);
- if (arv)
+ if (arv) {
arv->set_waveform_scale (scale);
+ }
}
- _waveform_scale = scale;
}
void
}
}
}
+
+void
+AudioStreamView::parameter_changed (string const & p)
+{
+ if (p == "show-waveforms") {
+ set_show_waveforms (Config->get_show_waveforms ());
+ } else if (p == "waveform-scale") {
+ set_waveform_scale (Config->get_waveform_scale ());
+ } else if (p == "waveform-shape") {
+ set_waveform_shape (Config->get_waveform_shape ());
+ }
+}
AudioStreamView (AudioTimeAxisView&);
~AudioStreamView ();
- void set_waveform_shape (Editing::WaveformShape);
- Editing::WaveformShape get_waveform_shape () const { return _waveform_shape; }
- void set_waveform_scale (Editing::WaveformScale);
- Editing::WaveformScale get_waveform_scale () const { return _waveform_scale; }
-
int set_samples_per_unit (gdouble spp);
int set_amplitude_above_axis (gdouble app);
void color_handler ();
void update_contents_height ();
+
+ void parameter_changed (std::string const &);
+ void set_waveform_shape (ARDOUR::WaveformShape);
+ void set_waveform_scale (ARDOUR::WaveformScale);
double _amplitude_above_axis;
CrossfadeViewList crossfade_views;
bool crossfades_visible;
-
std::list<sigc::connection> rec_data_ready_connections;
nframes_t last_rec_data_frame;
std::map<boost::shared_ptr<ARDOUR::Source>, bool> rec_data_ready_map;
bool outline_region;
-
- Editing::WaveformShape _waveform_shape;
- Editing::WaveformScale _waveform_scale;
};
#endif /* __ardour_audio_streamview_h__ */
assert(!is_track() || is_audio_track());
subplugin_menu.set_name ("ArdourContextMenu");
- waveform_item = 0;
_view = new AudioStreamView (*this);
/* first idle will do what we need */
} else {
first_idle ();
- }
+ }
} else {
post_construct ();
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);
- MenuList& waveform_items = waveform_menu->items();
- waveform_menu->set_name ("ArdourContextMenu");
-
- waveform_items.push_back (CheckMenuElem (_("Show waveforms"), mem_fun(*this, &AudioTimeAxisView::toggle_waveforms)));
- waveform_item = static_cast<CheckMenuItem *> (&waveform_items.back());
- ignore_toggle = true;
- 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());
-
- 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));
-
}
Gtk::Menu*
return mode_menu;
}
-void
-AudioTimeAxisView::toggle_waveforms ()
-{
- AudioStreamView* asv = audio_view();
- assert(asv);
-
- if (asv && waveform_item && !ignore_toggle) {
- asv->set_show_waveforms (waveform_item->get_active());
- }
-}
-
-void
-AudioTimeAxisView::set_show_waveforms (bool yn)
-{
- AudioStreamView* asv = audio_view();
- assert(asv);
-
- if (waveform_item) {
- waveform_item->set_active (yn);
- } else {
- asv->set_show_waveforms (yn);
- }
-}
-
void
AudioTimeAxisView::set_show_waveforms_recording (bool yn)
{
}
}
-void
-AudioTimeAxisView::set_waveform_shape (WaveformShape shape)
-{
- AudioStreamView* asv = audio_view();
-
- 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::create_automation_child (const Evoral::Parameter& param, bool show)
{
controls_ebox.set_name (controls_base_unselected_name);
}
}
-
AudioStreamView* audio_view();
- void set_show_waveforms (bool yn);
void set_show_waveforms_recording (bool yn);
void show_all_xfades ();
void hide_all_xfades ();
XMLNode* get_child_xml_node (const std::string & childname);
- void set_waveform_shape (Editing::WaveformShape);
- void set_waveform_scale (Editing::WaveformScale);
-
private:
friend class AudioStreamView;
friend class AudioRegionView;
void append_extra_display_menu_items ();
Gtk::Menu* build_mode_menu();
- void toggle_show_waveforms ();
- void toggle_waveforms ();
-
void show_all_automation ();
void show_existing_automation ();
void hide_all_automation ();
void ensure_pan_views (bool show = true);
void update_control_names ();
-
- Gtk::CheckMenuItem* waveform_item;
- Gtk::RadioMenuItem* traditional_item;
- Gtk::RadioMenuItem* rectified_item;
- Gtk::RadioMenuItem* linearscale_item;
- Gtk::RadioMenuItem* logscale_item;
};
#endif /* __ardour_audio_time_axis_h__ */
#undef EDITPOINT
#define EDITPOINT(a) /*empty*/
-// WAVEFORMSCALE
-#undef WAVEFORMSCALE
-#define WAVEFORMSCALE(a) a,
-enum WaveformScale {
- #include "editing_syms.h"
-};
-
-#undef WAVEFORMSCALE
-#define WAVEFORMSCALE(a) /*empty*/
-
-
-// WAVEFORMSHAPE
-#undef WAVEFORMSHAPE
-#define WAVEFORMSHAPE(a) a,
-enum WaveformShape {
- #include "editing_syms.h"
-};
-
-#undef WAVEFORMSHAPE
-#define WAVEFORMSHAPE(a) /*empty*/
-
-
// INSERTTIMEOPT
#undef INSERTTIMEOPT
#define INSERTTIMEOPT(a) a,
IMPORTDISPOSITION(ImportSerializeFiles=2)
IMPORTDISPOSITION(ImportDistinctChannels=3)
-
EDITPOINT(EditAtPlayhead)
EDITPOINT(EditAtSelectedMarker)
EDITPOINT(EditAtMouse)
-WAVEFORMSCALE(LinearWaveform)
-WAVEFORMSCALE(LogWaveform)
-
-WAVEFORMSHAPE(Traditional)
-WAVEFORMSHAPE(Rectified)
-
-
INSERTTIMEOPT(LeaveIntersected)
INSERTTIMEOPT(MoveIntersected)
INSERTTIMEOPT(SplitIntersected)
current_interthread_info = 0;
_show_measures = true;
- _show_waveforms = true;
_show_waveforms_recording = true;
show_gain_after_trim = false;
route_redisplay_does_not_sync_order_keys = false;
set_mouse_mode (MouseObject, true);
}
- if ((prop = node.property ("show-waveforms"))) {
- bool yn = (prop->value() == "yes");
- _show_waveforms = !yn;
- RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-visible"));
- if (act) {
- RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
- /* do it twice to force the change */
- tact->set_active (!yn);
- tact->set_active (yn);
- }
- }
-
if ((prop = node.property ("show-waveforms-recording"))) {
bool yn = (prop->value() == "yes");
_show_waveforms_recording = !yn;
snprintf (buf, sizeof (buf), "%" PRIi64, playhead_cursor->current_frame);
node->add_property ("playhead", buf);
- node->add_property ("show-waveforms", _show_waveforms ? "yes" : "no");
node->add_property ("show-waveforms-recording", _show_waveforms_recording ? "yes" : "no");
node->add_property ("show-measures", _show_measures ? "yes" : "no");
node->add_property ("follow-playhead", _follow_playhead ? "yes" : "no");
/* option editor-access */
- void set_show_waveforms (bool yn);
- bool show_waveforms() const { return _show_waveforms; }
-
- void set_waveform_scale (Editing::WaveformScale);
-
void set_show_waveforms_recording (bool yn);
bool show_waveforms_recording() const { return _show_waveforms_recording; }
bool follow_playhead() const { return _follow_playhead; }
bool dragging_playhead () const { return _dragging_playhead; }
- void toggle_waveform_visibility ();
void toggle_zero_line_visibility ();
void toggle_waveforms_while_recording ();
void toggle_measure_visibility ();
/* display control */
bool _show_measures;
- /// true to show waveforms, otherwise false
- bool _show_waveforms;
/// true if the editor should follow the playhead, otherwise false
bool _follow_playhead;
/// true if waveforms should be shown while recording audio tracks, otherwise false
void remove_tracks ();
void toggle_tracks_active ();
- void waveform_scale_chosen (Editing::WaveformScale);
bool _have_idled;
int resize_idle_id;
#include "time_axis_view.h"
#include "utils.h"
#include "i18n.h"
+#include "audio_time_axis.h"
using namespace Gtk;
using namespace Glib;
ActionManager::register_action (editor_actions, X_("Tools"), _("Tools"));
ActionManager::register_action (editor_actions, X_("TrimMenu"), _("Trim"));
ActionManager::register_action (editor_actions, X_("View"), _("View"));
- ActionManager::register_action (editor_actions, X_("WaveformMenu"), _("Waveforms"));
ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("Zoom Focus"));
ActionManager::register_action (editor_actions, X_("ZoomMenu"), _("Zoom"));
ActionManager::register_action (editor_actions, X_("importFromSession"), _("Import From Session"), mem_fun(*this, &Editor::session_import_dialog));
- act = ActionManager::register_toggle_action (editor_actions, X_("toggle-waveform-visible"), _("Show Waveforms"), mem_fun (*this, &Editor::toggle_waveform_visibility));
- ActionManager::track_selection_sensitive_actions.push_back (act);
-
ActionManager::register_toggle_action (editor_actions, X_("ToggleWaveformsWhileRecording"), _("Show Waveforms While Recording"), mem_fun (*this, &Editor::toggle_waveforms_while_recording));
ActionManager::register_toggle_action (editor_actions, X_("ToggleMeasureVisibility"), _("Show Measures"), mem_fun (*this, &Editor::toggle_measure_visibility));
-
- RadioAction::Group waveform_scale_group;
- act = ActionManager::register_radio_action (editor_actions, waveform_scale_group, X_("linear-waveforms"), _("Linear"), bind (mem_fun (*this, &Editor::waveform_scale_chosen), Editing::LinearWaveform));
- ActionManager::track_selection_sensitive_actions.push_back (act);
- act = ActionManager::register_radio_action (editor_actions, waveform_scale_group, X_("logarithmic-waveforms"), _("Logarithmic"), bind (mem_fun (*this, &Editor::waveform_scale_chosen), Editing::LogWaveform));
- ActionManager::track_selection_sensitive_actions.push_back (act);
-
/* if there is a logo in the editor canvas, its always visible at startup */
act = ActionManager::register_toggle_action (editor_actions, X_("ToggleLogoVisibility"), _("Show Logo"), mem_fun (*this, &Editor::toggle_logo_visibility));
}
}
-void
-Editor::toggle_waveform_visibility ()
-{
- Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-waveform-visible"));
- if (act) {
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
- set_show_waveforms (tact->get_active());
- }
-}
-
void
Editor::toggle_waveforms_while_recording ()
{
}
}
-void
-Editor::waveform_scale_chosen (Editing::WaveformScale ws)
-{
- RefPtr<Action> act;
-
- /* this is driven by a toggle on a radio group, and so is invoked twice,
- once for the item that became inactive and once for the one that became
- active.
- */
-
- switch (ws) {
- case LinearWaveform:
- act = ActionManager::get_action (X_("Editor"), X_("linear-waveforms"));
- break;
- case LogWaveform:
- act = ActionManager::get_action (X_("Editor"), X_("logarithmic-waveforms"));
- break;
- }
-
- if (act) {
- RefPtr<RadioAction> ract = RefPtr<RadioAction>::cast_dynamic(act);
- if (ract && ract->get_active()) {
- set_waveform_scale (ws);
- }
- }
-}
-
RefPtr<RadioAction>
Editor::snap_type_action (SnapType type)
{
using namespace ARDOUR;
using namespace PBD;
-void
-Editor::set_show_waveforms (bool yn)
-{
- AudioTimeAxisView* atv;
-
- if (_show_waveforms != yn) {
- _show_waveforms = yn;
- for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
- if ((atv = dynamic_cast<AudioTimeAxisView*>(*i)) != 0) {
- atv->set_show_waveforms (yn);
- }
- }
- }
-}
-
void
Editor::set_show_waveforms_recording (bool yn)
{
}
}
-void
-Editor::set_waveform_scale (WaveformScale ws)
-{
- TrackSelection& ts (selection->tracks);
-
- if (ts.empty()) {
- return;
- }
-
- for (TrackSelection::iterator x = ts.begin(); x != ts.end(); ++x) {
- AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (*x);
- if (atv) {
- atv->set_waveform_scale (ws);
- }
- }
-}
-
void
Editor::do_insert_time ()
{
Width width;
ImportMode import_mode;
EditPoint edit_point;
- WaveformScale waveform_scale;
- WaveformShape waveform_shape;
#define REGISTER(e) enum_writer.register_distinct (typeid(e).name(), i, s); i.clear(); s.clear()
#define REGISTER_BITS(e) enum_writer.register_bits (typeid(e).name(), i, s); i.clear(); s.clear()
REGISTER_ENUM (EditAtMouse);
REGISTER_ENUM (EditAtSelectedMarker);
REGISTER (edit_point);
-
- REGISTER_ENUM (LinearWaveform);
- REGISTER_ENUM (LogWaveform);
- REGISTER (waveform_scale);
-
- REGISTER_ENUM (Traditional);
- REGISTER_ENUM (Rectified);
- REGISTER (waveform_shape);
}
*/
virtual void consider_auditioning (boost::shared_ptr<ARDOUR::Region> r) = 0;
- /** Set whether waveforms should be shown for audio tracks.
- * @param yn true to show waveforms, otherwise false.
- */
- virtual void set_show_waveforms (bool yn) = 0;
-
- /** @return true if waveforms are being shown, otherwise false */
- virtual bool show_waveforms () const = 0;
-
/** Set whether waveforms should be shown while recording audio tracks.
* @param yn true to show waveforms, otherwise false.
*/
mem_fun (*_rc_config, &RCConfiguration::set_rubberbanding_snaps_to_grid)
));
+ add_option (_("Editor"),
+ new BoolOption (
+ "show-waveforms",
+ _("Show waveforms in regions"),
+ mem_fun (*_rc_config, &RCConfiguration::get_show_waveforms),
+ mem_fun (*_rc_config, &RCConfiguration::set_show_waveforms)
+ ));
+
+ ComboOption<WaveformScale>* wfs = new ComboOption<WaveformScale> (
+ "waveform-scale",
+ _("Waveform scale"),
+ mem_fun (*_rc_config, &RCConfiguration::get_waveform_scale),
+ mem_fun (*_rc_config, &RCConfiguration::set_waveform_scale)
+ );
+
+ wfs->add (Linear, _("linear"));
+ wfs->add (Logarithmic, _("logarithmic"));
+
+ add_option (_("Editor"), wfs);
+
+ ComboOption<WaveformShape>* wfsh = new ComboOption<WaveformShape> (
+ "waveform-shape",
+ _("Waveform shape"),
+ mem_fun (*_rc_config, &RCConfiguration::get_waveform_shape),
+ mem_fun (*_rc_config, &RCConfiguration::set_waveform_shape)
+ );
+
+ wfsh->add (Traditional, _("traditional"));
+ wfsh->add (Rectified, _("rectified"));
+
+ add_option (_("Editor"), wfsh);
+
/* AUDIO */
add_option (_("Audio"), new OptionEditorHeading (_("Solo")));
CONFIG_VARIABLE (bool, rubberbanding_snaps_to_grid, "rubberbanding-snaps-to-grid", false)
CONFIG_VARIABLE (long, font_scale, "font-scale", 102400)
CONFIG_VARIABLE (std::string, default_session_parent_dir, "default-session-parent-dir", "~")
+CONFIG_VARIABLE (bool, show_waveforms, "show-waveforms", true)
+CONFIG_VARIABLE (WaveformScale, waveform_scale, "waveform-scale", Linear)
+CONFIG_VARIABLE (WaveformShape, waveform_shape, "waveform-shape", Traditional)
/* denormal management */
class Bundle;
typedef std::vector<boost::shared_ptr<Bundle> > BundleList;
+ enum WaveformScale {
+ Linear,
+ Logarithmic
+ };
+
+ enum WaveformShape {
+ Traditional,
+ Rectified
+ };
+
} // namespace ARDOUR
std::istream& operator>>(std::istream& o, ARDOUR::SampleFormat& sf);
std::istream& operator>>(std::istream& o, ARDOUR::ShuttleUnits& sf);
std::istream& operator>>(std::istream& o, ARDOUR::SmpteFormat& sf);
std::istream& operator>>(std::istream& o, ARDOUR::DenormalModel& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::WaveformScale& sf);
+std::istream& operator>>(std::istream& o, ARDOUR::WaveformShape& sf);
using ARDOUR::nframes_t;
std::istream& operator>>(std::istream& o, ShuttleUnits& var) { return int_to_type<ShuttleUnits> (o, var); }
std::istream& operator>>(std::istream& o, SmpteFormat& var) { return int_to_type<SmpteFormat> (o, var); }
std::istream& operator>>(std::istream& o, DenormalModel& var) { return int_to_type<DenormalModel> (o, var); }
+std::istream& operator>>(std::istream& o, WaveformScale& var) { return int_to_type<WaveformScale> (o, var); }
+std::istream& operator>>(std::istream& o, WaveformShape& var) { return int_to_type<WaveformShape> (o, var); }