2007-08-17 17:25:20 +00:00
|
|
|
/*
|
2019-08-02 23:26:43 +02:00
|
|
|
* Copyright (C) 2007-2014 David Robillard <d@drobilla.net>
|
|
|
|
|
* Copyright (C) 2009-2010 Carl Hetherington <carl@carlh.net>
|
|
|
|
|
* Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
*/
|
2007-08-17 17:25:20 +00:00
|
|
|
|
2024-09-25 18:38:59 -06:00
|
|
|
#pragma once
|
2007-08-17 17:25:20 +00:00
|
|
|
|
2009-02-25 18:26:51 +00:00
|
|
|
#include "ardour/types.h"
|
2007-08-17 17:25:20 +00:00
|
|
|
|
|
|
|
|
#include "region_view.h"
|
|
|
|
|
#include "automation_time_axis.h"
|
2024-09-20 20:00:46 -06:00
|
|
|
#include "editor_automation_line.h"
|
2007-08-17 17:25:20 +00:00
|
|
|
#include "enums.h"
|
2023-09-30 11:09:01 -06:00
|
|
|
#include "line_merger.h"
|
2007-08-17 17:25:20 +00:00
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
|
class AutomationList;
|
2008-09-19 06:30:49 +00:00
|
|
|
class Parameter;
|
2007-08-17 17:25:20 +00:00
|
|
|
};
|
|
|
|
|
|
2008-02-10 18:16:25 +00:00
|
|
|
class TimeAxisView;
|
2007-08-17 17:25:20 +00:00
|
|
|
|
2023-09-30 11:09:01 -06:00
|
|
|
class AutomationRegionView : public RegionView, public LineMerger
|
2007-08-17 17:25:20 +00:00
|
|
|
{
|
|
|
|
|
public:
|
2014-06-22 11:41:05 -04:00
|
|
|
AutomationRegionView(ArdourCanvas::Container*,
|
2009-07-09 17:58:13 +00:00
|
|
|
AutomationTimeAxisView&,
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<ARDOUR::Region>,
|
2008-09-29 22:47:40 +00:00
|
|
|
const Evoral::Parameter& parameter,
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<ARDOUR::AutomationList>,
|
2013-04-12 11:31:50 -04:00
|
|
|
double initial_samples_per_pixel,
|
2014-06-09 23:28:32 -04:00
|
|
|
uint32_t basic_color);
|
2007-08-17 17:25:20 +00:00
|
|
|
|
2011-07-10 15:28:36 +00:00
|
|
|
~AutomationRegionView();
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2014-06-09 23:28:32 -04:00
|
|
|
void init (bool wfd);
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2023-06-28 13:40:49 -06:00
|
|
|
void set_selected (bool yn);
|
|
|
|
|
|
2020-09-26 09:14:59 -06:00
|
|
|
bool paste (Temporal::timepos_t const & pos,
|
2014-11-16 17:04:27 -05:00
|
|
|
unsigned paste_count,
|
|
|
|
|
float times,
|
2023-02-16 16:33:28 -07:00
|
|
|
std::shared_ptr<const ARDOUR::AutomationList> slist);
|
2014-11-16 17:04:27 -05:00
|
|
|
|
2009-07-09 17:58:13 +00:00
|
|
|
inline AutomationTimeAxisView* automation_view() const
|
|
|
|
|
{ return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2024-09-20 20:00:46 -06:00
|
|
|
std::shared_ptr<EditorAutomationLine> line() { return _line; }
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2007-08-17 17:25:20 +00:00
|
|
|
// We are a ghost. Meta ghosts? Crazy talk.
|
2014-01-10 10:55:43 -05:00
|
|
|
virtual GhostRegion* add_ghost(TimeAxisView&) { return 0; }
|
2009-10-14 16:10:01 +00:00
|
|
|
|
2014-12-16 20:37:16 -05:00
|
|
|
uint32_t get_fill_color() const;
|
|
|
|
|
|
2008-09-19 06:30:49 +00:00
|
|
|
void set_height (double);
|
2007-09-06 02:30:39 +00:00
|
|
|
void reset_width_dependent_items(double pixel_width);
|
2007-08-17 17:25:20 +00:00
|
|
|
|
2022-10-25 11:10:32 -06:00
|
|
|
void tempo_map_changed ();
|
|
|
|
|
|
2023-09-30 11:09:01 -06:00
|
|
|
MergeableLine* make_merger ();
|
|
|
|
|
|
|
|
|
|
void add_automation_event (GdkEvent* event);
|
|
|
|
|
Temporal::timepos_t drawn_time_filter (Temporal::timepos_t const &);
|
|
|
|
|
|
2007-08-17 17:25:20 +00:00
|
|
|
protected:
|
2023-02-16 16:33:28 -07:00
|
|
|
void create_line(std::shared_ptr<ARDOUR::AutomationList> list);
|
2020-09-26 09:14:59 -06:00
|
|
|
bool set_position(Temporal::timepos_t const & pos, void* src, double* ignored);
|
2010-02-19 18:09:08 +00:00
|
|
|
void region_resized (const PBD::PropertyChange&);
|
2014-11-15 02:58:39 -05:00
|
|
|
bool canvas_group_event(GdkEvent* ev);
|
2023-09-30 11:09:01 -06:00
|
|
|
void add_automation_event (Temporal::timepos_t const & when, double y, bool with_guard_points);
|
2014-12-16 20:37:16 -05:00
|
|
|
void mouse_mode_changed ();
|
2014-12-08 23:00:00 -05:00
|
|
|
void entered();
|
2007-08-17 17:25:20 +00:00
|
|
|
void exited();
|
2024-01-08 22:35:37 -07:00
|
|
|
void redisplay (bool) {}
|
2007-08-17 17:25:20 +00:00
|
|
|
|
|
|
|
|
private:
|
2019-04-08 19:53:33 +02:00
|
|
|
Evoral::Parameter _parameter;
|
2024-09-20 20:00:46 -06:00
|
|
|
std::shared_ptr<EditorAutomationLine> _line;
|
2019-04-08 19:53:33 +02:00
|
|
|
PBD::ScopedConnection _mouse_mode_connection;
|
2007-08-17 17:25:20 +00:00
|
|
|
};
|
|
|
|
|
|