#include "streamview.h"
#include "audio_region_view.h"
#include "audio_time_axis.h"
+#include "enums_convert.h"
#include "public_editor.h"
#include "audio_region_editor.h"
#include "audio_streamview.h"
for (uint32_t n = 0; n < waves.size(); ++n) {
waves[n]->gain_changed ();
}
+ region_renamed ();
}
void
str = string ("!") + str;
}
+
+ boost::shared_ptr<AudioRegion> ar (audio_region());
+ if (ar->scale_amplitude() != 1.0) {
+ char tmp[32];
+ snprintf (tmp, 32, " (%.1fdB)", accurate_coefficient_to_dB (ar->scale_amplitude()));
+ str += tmp;
+ }
+
set_item_name (str, this);
set_name_text (str);
}
pending_peak_data->hide ();
/* Restore stacked coverage */
- std::string str = trackview.gui_property ("layer-display");
- if (!str.empty()) {
- LayerDisplay layer_display;
- update_coverage_frames (LayerDisplay (string_2_enum (str, layer_display)));
- }
+ LayerDisplay layer_display;
+ if (trackview.get_gui_property ("layer-display", layer_display)) {
+ update_coverage_frames (layer_display);
+ }
}
/* channel wave created, don't hook into peaks ready anymore */
/* don't create points that can't be seen */
update_envelope_visibility ();
-
framepos_t rpos = region ()->position ();
- framepos_t fx = trackview.editor().pixel_to_sample (mx) + rpos;
- trackview.editor ().snap_to_with_modifier (fx, ev);
- fx -= rpos;
+ MusicFrame snap_pos (trackview.editor().pixel_to_sample (mx) + rpos, 0);
+ trackview.editor ().snap_to_with_modifier (snap_pos, ev);
+ framepos_t fx = snap_pos.frame - rpos;
if (fx > _region->length()) {
return;
void
AudioRegionView::update_coverage_frames (LayerDisplay d)
{
- if (d != Stacked) {
- /* don't do coverage frames unless we're in stacked mode */
- return;
- }
-
RegionView::update_coverage_frames (d);
- if (fade_in_handle) { fade_in_handle->raise_to_top (); }
- if (fade_out_handle) { fade_out_handle->raise_to_top (); }
- if (fade_in_trim_handle) { fade_in_trim_handle->raise_to_top (); }
- if (fade_out_trim_handle) { fade_out_trim_handle->raise_to_top (); }
+ if (d == Stacked) {
+ if (fade_in_handle) { fade_in_handle->raise_to_top (); }
+ if (fade_out_handle) { fade_out_handle->raise_to_top (); }
+ if (fade_in_trim_handle) { fade_in_trim_handle->raise_to_top (); }
+ if (fade_out_trim_handle) { fade_out_trim_handle->raise_to_top (); }
+ }
}
void