![]() |
Ardour
9.0-pre0-1463-gd654d98661
|
#include <wave_view.h>
Classes | |
struct | LineTips |
Public Types | |
enum | Shape { Normal , Rectified } |
![]() | |
typedef std::vector< std::pair< double, Gtkmm2ext::Color > > | StopList |
Public Member Functions | |
std::string | debug_name () const |
WaveView (ArdourCanvas::Canvas *, std::shared_ptr< ARDOUR::AudioRegion >) | |
WaveView (Item *, std::shared_ptr< ARDOUR::AudioRegion >) | |
~WaveView () | |
void | prepare_for_render (ArdourCanvas::Rect const &window_area) const |
bool | needs_prepare_for_render () const |
void | render (ArdourCanvas::Rect const &area, Cairo::RefPtr< Cairo::Context >) const |
void | compute_bounding_box () const |
void | set_samples_per_pixel (double) |
void | set_height (ArdourCanvas::Distance) |
void | set_channel (int) |
void | set_region_start (ARDOUR::sampleoffset_t) |
void | set_start_shift (double pixels) |
void | set_fill_color (Gtkmm2ext::Color) |
void | set_outline_color (Gtkmm2ext::Color) |
void | region_resized () |
void | gain_changed () |
void | set_show_zero_line (bool) |
bool | show_zero_line () const |
void | set_zero_color (Gtkmm2ext::Color) |
void | set_clip_color (Gtkmm2ext::Color) |
void | set_logscaled (bool) |
void | set_gradient_depth (double) |
double | gradient_depth () const |
void | set_shape (Shape) |
void | set_always_get_image_in_thread (bool yn) |
void | set_amplitude_above_axis (double v) |
double | amplitude_above_axis () const |
![]() | |
Item (Canvas *) | |
Item (Item *) | |
Item (Item *, Duple const &p) | |
virtual | ~Item () |
void | redraw () const |
virtual void | add_items_at_point (Duple point, std::vector< Item const * > &items) const |
virtual bool | covers (Duple const &point) const |
void | grab () |
void | ungrab () |
void | unparent () |
void | reparent (Item *, bool already_added=false) |
Item * | parent () const |
uint32_t | depth () const |
const Item * | closest_ancestor_with (const Item &other) const |
bool | common_ancestor_within (uint32_t, const Item &other) const |
bool | is_ancestor_of (const Item &candidate) const |
bool | is_descendant_of (const Item &candidate) const |
void | set_position (Duple) |
void | set_x_position (Coord) |
void | set_y_position (Coord) |
void | move (Duple) |
Duple | position () const |
Duple | window_origin () const |
Duple | canvas_origin () const |
ScrollGroup * | scroll_parent () const |
virtual void | size_request (double &w, double &h) const |
void | set_size_request (double w, double h) |
void | set_size_request_to_display_given_text (const std::vector< std::string > &strings, gint hpadding, gint vpadding) |
void | size_allocate (Rect const &) |
virtual void | _size_allocate (Rect const &) |
virtual void | size_allocate_children (Rect const &r) |
Rect | allocation () const |
void | set_layout_sensitive (bool) |
bool | layout_sensitive () const |
Rect | bounding_box () const |
Coord | height () const |
Coord | width () const |
Duple | item_to_parent (Duple const &) const |
Rect | item_to_parent (Rect const &) const |
Duple | parent_to_item (Duple const &) const |
Rect | parent_to_item (Rect const &) const |
void | canvas_to_item (Coord &, Coord &) const |
void | item_to_canvas (Coord &, Coord &) const |
Duple | canvas_to_item (Duple const &) const |
Rect | item_to_canvas (Rect const &) const |
Duple | item_to_canvas (Duple const &) const |
Rect | canvas_to_item (Rect const &) const |
Duple | item_to_window (Duple const &, bool rounded=true) const |
Duple | window_to_item (Duple const &) const |
Rect | item_to_window (Rect const &, bool rounded=true) const |
Rect | window_to_item (Rect const &) const |
void | raise_to_top () |
void | raise (int) |
void | lower_to_bottom () |
virtual void | hide () |
virtual void | show () |
void | block_change_notifications () |
void | unblock_change_notifications () |
bool | self_visible () const |
bool | visible () const |
Canvas * | canvas () const |
void | set_ignore_events (bool) |
bool | ignore_events () const |
void | set_data (std::string const &, void *) |
void * | get_data (std::string const &) const |
virtual void | add (Item *) |
virtual void | add_front (Item *) |
virtual void | remove (Item *) |
void | clear (bool with_delete=false) |
std::list< Item * > const & | items () const |
void | raise_child_to_top (Item *) |
void | raise_child (Item *, int) |
void | lower_child_to_bottom (Item *) |
virtual void | child_changed (bool bbox_changed) |
PackOptions | pack_options () const |
void | set_pack_options (PackOptions) |
std::string | whoami () const |
const std::string & | tooltip () const |
void | set_tooltip (const std::string &) |
void | start_tooltip_timeout () |
void | stop_tooltip_timeout () |
virtual void | dump (std::ostream &) const |
std::string | whatami () const |
bool | resize_queued () const |
void | queue_resize () |
bool | scroll_translation () const |
void | disable_scroll_translation () |
virtual void | layout () |
Duple | position_offset () const |
![]() | |
Fill (Item &self) | |
Fill (const Fill &)=delete | |
Fill & | operator= (const Fill &)=delete |
virtual | ~Fill () |
virtual void | set_fill (bool) |
Gtkmm2ext::Color | fill_color () const |
bool | fill () const |
void | set_gradient (StopList const &stops, bool is_vertical) |
void | set_pattern (Cairo::RefPtr< Cairo::Pattern >) |
![]() | |
Outline (Item &self) | |
Outline (const Outline &)=delete | |
Outline & | operator= (const Outline &)=delete |
virtual | ~Outline () |
Gtkmm2ext::Color | outline_color () const |
Distance | outline_width () const |
virtual void | set_outline_width (Distance) |
bool | outline () const |
virtual void | set_outline (bool) |
Static Public Member Functions | |
static void | set_global_gradient_depth (double) |
static void | set_global_logscaled (bool) |
static void | set_global_shape (Shape) |
static void | set_global_show_waveform_clipping (bool) |
static void | clear_cache () |
static double | global_gradient_depth () |
static bool | global_logscaled () |
static Shape | global_shape () |
static void | set_clip_level (double dB) |
static void | start_drawing_thread () |
static void | stop_drawing_thread () |
static void | set_image_cache_size (uint64_t) |
Static Public Attributes | |
static PBD::Signal< void()> | ClipLevelChanged |
![]() | |
static int | default_items_per_cell |
Private Member Functions | |
ARDOUR::samplecnt_t | region_length () const |
ARDOUR::samplepos_t | region_end () const |
bool | rendered () const |
bool | draw_image_in_gui_thread () const |
void | init () |
void | handle_visual_property_change () |
void | handle_clip_level_change () |
ARDOUR::samplecnt_t | optimal_image_width_samples () const |
void | set_image (std::shared_ptr< WaveViewImage > img) const |
bool | get_item_and_draw_rect_in_window_coords (ArdourCanvas::Rect const &canvas_rect, ArdourCanvas::Rect &item_area, ArdourCanvas::Rect &draw_rect) const |
std::shared_ptr< WaveViewDrawRequest > | create_draw_request (WaveViewProperties const &) const |
void | queue_draw_request (std::shared_ptr< WaveViewDrawRequest > const &) const |
std::shared_ptr< WaveViewCacheGroup > | get_cache_group () const |
void | reset_cache_group () |
Static Private Member Functions | |
static ArdourCanvas::Coord | y_extent (double, Shape const, double const height) |
static void | compute_tips (ARDOUR::PeakData const &peak, LineTips &tips, double const effective_height) |
static void | draw_image (Cairo::RefPtr< Cairo::ImageSurface > &, ARDOUR::PeakData *, int n_peaks, std::shared_ptr< WaveViewDrawRequest >) |
static void | draw_absent_image (Cairo::RefPtr< Cairo::ImageSurface > &, ARDOUR::PeakData *, int) |
static void | process_draw_request (std::shared_ptr< WaveViewDrawRequest >) |
Private Attributes | |
std::shared_ptr< ARDOUR::AudioRegion > | _region |
const std::unique_ptr< WaveViewProperties > | _props |
std::shared_ptr< WaveViewImage > | _image |
std::shared_ptr< WaveViewCacheGroup > | _cache_group |
bool | _shape_independent |
bool | _logscaled_independent |
bool | _gradient_depth_independent |
bool | _draw_image_in_gui_thread |
bool | _always_draw_image_in_gui_thread |
std::shared_ptr< WaveViewDrawRequest > | current_request |
PBD::ScopedConnectionList | invalidation_connection |
Static Private Attributes | |
static double | _global_gradient_depth |
static bool | _global_logscaled |
static Shape | _global_shape |
static bool | _global_show_waveform_clipping |
static double | _global_clip_level |
static PBD::Signal< void()> | VisualPropertiesChanged |
Friends | |
class | WaveViewThreadClient |
class | WaveViewThreads |
Additional Inherited Members | |
![]() | |
sigc::signal1< bool, GdkEvent *, EventAccumulator< bool > > | Event |
bool | _resize_queued |
double | _requested_width |
double | _requested_height |
![]() | |
void | begin_change () |
void | end_change () |
void | begin_visual_change () |
void | end_visual_change () |
void | set_bbox_clean () const |
void | set_bbox_dirty () const |
bool | bbox_dirty () const |
void | invalidate_lut () const |
void | clear_items (bool with_delete) |
void | ensure_lut () const |
void | add_child_bounding_boxes (bool include_hidden=false) const |
void | render_children (Rect const &area, Cairo::RefPtr< Cairo::Context > context) const |
void | prepare_for_render_children (Rect const &area) const |
Duple | scroll_offset () const |
![]() | |
void | setup_fill_context (Cairo::RefPtr< Cairo::Context >) const |
void | setup_gradient_context (Cairo::RefPtr< Cairo::Context >, Rect const &, Duple const &) const |
![]() | |
void | setup_outline_context (Cairo::RefPtr< Cairo::Context >) const |
![]() | |
Canvas * | _canvas |
Item * | _parent |
ScrollGroup * | _scroll_parent |
Duple | _position |
bool | _visible |
Rect | _pre_change_bounding_box |
Rect | _bounding_box |
PackOptions | _pack_options |
Rect | _allocation |
bool | _layout_sensitive |
std::map< std::string, void * > | _data |
LookupTable * | _lut |
std::list< Item * > | _items |
![]() | |
Item & | _self |
Gtkmm2ext::Color | _fill_color |
bool | _fill |
bool | _transparent |
StopList | _stops |
bool | _vertical_gradient |
Cairo::RefPtr< Cairo::Pattern > | _pattern |
![]() | |
Item & | _self |
Gtkmm2ext::Color | _outline_color |
Distance | _outline_width |
bool | _outline |
Definition at line 49 of file wave_view.h.
Enumerator | |
---|---|
Normal | |
Rectified |
Definition at line 52 of file wave_view.h.
ArdourWaveView::WaveView::WaveView | ( | ArdourCanvas::Canvas * | , |
std::shared_ptr< ARDOUR::AudioRegion > | |||
) |
ArdourWaveView::WaveView::WaveView | ( | Item * | , |
std::shared_ptr< ARDOUR::AudioRegion > | |||
) |
ArdourWaveView::WaveView::~WaveView | ( | ) |
double ArdourWaveView::WaveView::amplitude_above_axis | ( | ) | const |
|
static |
|
virtual |
Update _bounding_box and _bounding_box_dirty
Implements ArdourCanvas::Item.
|
staticprivate |
|
private |
std::string ArdourWaveView::WaveView::debug_name | ( | ) | const |
|
staticprivate |
|
staticprivate |
|
private |
void ArdourWaveView::WaveView::gain_changed | ( | ) |
|
private |
|
private |
|
inlinestatic |
Definition at line 130 of file wave_view.h.
|
inlinestatic |
Definition at line 132 of file wave_view.h.
|
inlinestatic |
Definition at line 134 of file wave_view.h.
double ArdourWaveView::WaveView::gradient_depth | ( | ) | const |
|
private |
|
private |
|
private |
|
inlinevirtual |
Reimplemented from ArdourCanvas::Item.
Definition at line 79 of file wave_view.h.
|
private |
|
virtual |
Item has changed will be rendered in next render pass so give item a chance to perhaps schedule work in another thread etc.
area | Area to draw, in window coordinates |
Reimplemented from ArdourCanvas::Item.
|
staticprivate |
|
private |
|
private |
|
private |
Under almost conditions, this is going to return _region->length(), but if region_start has been reset, then we need to use this modified computation.
void ArdourWaveView::WaveView::region_resized | ( | ) |
|
virtual |
Render this item to a Cairo context.
area | Area to draw, in window coordinates |
Items must convert their own coordinates into window coordinates because Cairo is limited to a fixed point coordinate space that does not extend as far as the Ardour timeline. All rendering must be done using coordinates that do not exceed the (rough) limits of the canvas' window, to avoid odd errors within Cairo as it converts doubles into its fixed point format and then tesselates the results.
Implements ArdourCanvas::Item.
|
inlineprivate |
_image stays non-null after the first time it is set
Definition at line 179 of file wave_view.h.
|
private |
Notify the Cache that we are dropping our reference to the CacheGroup so it can also do so if it is the only reference holder of the cache group.
void ArdourWaveView::WaveView::set_always_get_image_in_thread | ( | bool | yn | ) |
void ArdourWaveView::WaveView::set_amplitude_above_axis | ( | double | v | ) |
void ArdourWaveView::WaveView::set_channel | ( | int | ) |
void ArdourWaveView::WaveView::set_clip_color | ( | Gtkmm2ext::Color | ) |
|
static |
|
virtual |
Reimplemented from ArdourCanvas::Fill.
|
static |
|
static |
|
static |
|
static |
void ArdourWaveView::WaveView::set_gradient_depth | ( | double | ) |
void ArdourWaveView::WaveView::set_height | ( | ArdourCanvas::Distance | ) |
|
private |
|
static |
void ArdourWaveView::WaveView::set_logscaled | ( | bool | ) |
|
virtual |
Reimplemented from ArdourCanvas::Outline.
void ArdourWaveView::WaveView::set_region_start | ( | ARDOUR::sampleoffset_t | ) |
void ArdourWaveView::WaveView::set_samples_per_pixel | ( | double | ) |
void ArdourWaveView::WaveView::set_shape | ( | Shape | ) |
void ArdourWaveView::WaveView::set_show_zero_line | ( | bool | ) |
void ArdourWaveView::WaveView::set_start_shift | ( | double | pixels | ) |
Change the first position drawn by pixels
. pixels
must be positive. This is used by AudioRegionViews in Ardour to avoid drawing the first pixel of a waveform, and exists in case there are uses for WaveView where we do not want this behaviour.
void ArdourWaveView::WaveView::set_zero_color | ( | Gtkmm2ext::Color | ) |
bool ArdourWaveView::WaveView::show_zero_line | ( | ) | const |
|
static |
|
static |
|
staticprivate |
|
friend |
Definition at line 149 of file wave_view.h.
|
friend |
Definition at line 150 of file wave_view.h.
|
private |
If true, calls to render() will render a missing wave image in the GUI thread. Set true for waveviews we expect to keep updating (e.g. while recording)
Definition at line 192 of file wave_view.h.
|
mutableprivate |
Definition at line 158 of file wave_view.h.
|
mutableprivate |
If true, calls to render() will render a missing wave image in the GUI thread. Generally set to false, but true after a call to set_height().
Definition at line 186 of file wave_view.h.
|
staticprivate |
Definition at line 204 of file wave_view.h.
|
staticprivate |
Definition at line 200 of file wave_view.h.
|
staticprivate |
Definition at line 201 of file wave_view.h.
|
staticprivate |
Definition at line 202 of file wave_view.h.
|
staticprivate |
Definition at line 203 of file wave_view.h.
|
private |
Definition at line 162 of file wave_view.h.
|
mutableprivate |
Definition at line 156 of file wave_view.h.
|
private |
Definition at line 161 of file wave_view.h.
|
private |
Definition at line 154 of file wave_view.h.
|
private |
Definition at line 152 of file wave_view.h.
|
private |
Definition at line 160 of file wave_view.h.
|
static |
Definition at line 141 of file wave_view.h.
|
mutableprivate |
Definition at line 196 of file wave_view.h.
|
private |
Definition at line 198 of file wave_view.h.
|
staticprivate |
Definition at line 206 of file wave_view.h.