2007-08-17 13:25:20 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04: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 13:25:20 -04:00
|
|
|
|
2024-09-25 20:38:59 -04:00
|
|
|
#pragma once
|
2007-08-17 13:25:20 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/types.h"
|
2007-08-17 13:25:20 -04:00
|
|
|
|
|
|
|
#include "region_view.h"
|
|
|
|
#include "automation_time_axis.h"
|
2024-09-20 22:00:46 -04:00
|
|
|
#include "editor_automation_line.h"
|
2007-08-17 13:25:20 -04:00
|
|
|
#include "enums.h"
|
2023-09-30 13:09:01 -04:00
|
|
|
#include "line_merger.h"
|
2007-08-17 13:25:20 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class AutomationList;
|
2008-09-19 02:30:49 -04:00
|
|
|
class Parameter;
|
2007-08-17 13:25:20 -04:00
|
|
|
};
|
|
|
|
|
2008-02-10 13:16:25 -05:00
|
|
|
class TimeAxisView;
|
2007-08-17 13:25:20 -04:00
|
|
|
|
2023-09-30 13:09:01 -04:00
|
|
|
class AutomationRegionView : public RegionView, public LineMerger
|
2007-08-17 13:25:20 -04:00
|
|
|
{
|
|
|
|
public:
|
2014-06-22 11:41:05 -04:00
|
|
|
AutomationRegionView(ArdourCanvas::Container*,
|
2009-07-09 13:58:13 -04:00
|
|
|
AutomationTimeAxisView&,
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<ARDOUR::Region>,
|
2008-09-29 18:47:40 -04:00
|
|
|
const Evoral::Parameter& parameter,
|
2023-02-16 18:33:28 -05: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 13:25:20 -04:00
|
|
|
|
2011-07-10 11:28:36 -04:00
|
|
|
~AutomationRegionView();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2014-06-09 23:28:32 -04:00
|
|
|
void init (bool wfd);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2023-06-28 15:40:49 -04:00
|
|
|
void set_selected (bool yn);
|
|
|
|
|
2020-09-26 11:14:59 -04:00
|
|
|
bool paste (Temporal::timepos_t const & pos,
|
2014-11-16 17:04:27 -05:00
|
|
|
unsigned paste_count,
|
|
|
|
float times,
|
2023-02-16 18:33:28 -05:00
|
|
|
std::shared_ptr<const ARDOUR::AutomationList> slist);
|
2014-11-16 17:04:27 -05:00
|
|
|
|
2009-07-09 13:58:13 -04:00
|
|
|
inline AutomationTimeAxisView* automation_view() const
|
|
|
|
{ return dynamic_cast<AutomationTimeAxisView*>(&trackview); }
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2024-09-20 22:00:46 -04:00
|
|
|
std::shared_ptr<EditorAutomationLine> line() { return _line; }
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2007-08-17 13:25:20 -04: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 12:10:01 -04:00
|
|
|
|
2014-12-16 20:37:16 -05:00
|
|
|
uint32_t get_fill_color() const;
|
|
|
|
|
2008-09-19 02:30:49 -04:00
|
|
|
void set_height (double);
|
2007-09-05 22:30:39 -04:00
|
|
|
void reset_width_dependent_items(double pixel_width);
|
2007-08-17 13:25:20 -04:00
|
|
|
|
2022-10-25 13:10:32 -04:00
|
|
|
void tempo_map_changed ();
|
|
|
|
|
2023-09-30 13:09:01 -04:00
|
|
|
MergeableLine* make_merger ();
|
|
|
|
|
|
|
|
void add_automation_event (GdkEvent* event);
|
|
|
|
Temporal::timepos_t drawn_time_filter (Temporal::timepos_t const &);
|
|
|
|
|
2007-08-17 13:25:20 -04:00
|
|
|
protected:
|
2023-02-16 18:33:28 -05:00
|
|
|
void create_line(std::shared_ptr<ARDOUR::AutomationList> list);
|
2020-09-26 11:14:59 -04:00
|
|
|
bool set_position(Temporal::timepos_t const & pos, void* src, double* ignored);
|
2010-02-19 13:09:08 -05:00
|
|
|
void region_resized (const PBD::PropertyChange&);
|
2014-11-15 02:58:39 -05:00
|
|
|
bool canvas_group_event(GdkEvent* ev);
|
2023-09-30 13:09:01 -04: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 13:25:20 -04:00
|
|
|
void exited();
|
2024-01-09 00:35:37 -05:00
|
|
|
void redisplay (bool) {}
|
2007-08-17 13:25:20 -04:00
|
|
|
|
|
|
|
private:
|
2019-04-08 13:53:33 -04:00
|
|
|
Evoral::Parameter _parameter;
|
2024-09-20 22:00:46 -04:00
|
|
|
std::shared_ptr<EditorAutomationLine> _line;
|
2019-04-08 13:53:33 -04:00
|
|
|
PBD::ScopedConnection _mouse_mode_connection;
|
2007-08-17 13:25:20 -04:00
|
|
|
};
|
|
|
|
|