2021-12-05 11:56:42 -05:00
|
|
|
/*
|
|
|
|
* Author Ben Loftis <ben@harrisonconsoles.com>
|
|
|
|
* Copyright (C) 2021 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.
|
|
|
|
*/
|
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
#ifndef _gtk_ardour_trigger_master_h_
|
2022-01-02 15:51:54 -05:00
|
|
|
#define _gtk_ardour_trigger_master_h_
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2021-12-27 18:35:24 -05:00
|
|
|
#include <gtkmm/colorselection.h>
|
|
|
|
|
2021-12-05 11:56:42 -05:00
|
|
|
#include "pbd/properties.h"
|
|
|
|
|
|
|
|
#include "ardour/triggerbox.h"
|
|
|
|
|
|
|
|
#include "canvas/canvas.h"
|
|
|
|
#include "canvas/rectangle.h"
|
2021-12-17 09:30:14 -05:00
|
|
|
#include "canvas/table.h"
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
namespace Gtk
|
|
|
|
{
|
|
|
|
class FileChooserDialog;
|
|
|
|
class Menu;
|
2021-12-05 11:56:42 -05:00
|
|
|
}
|
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
namespace Temporal
|
|
|
|
{
|
2021-12-05 11:56:42 -05:00
|
|
|
struct BBT_Offset;
|
|
|
|
}
|
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
namespace ArdourCanvas
|
|
|
|
{
|
2021-12-05 11:56:42 -05:00
|
|
|
class Text;
|
|
|
|
class Polygon;
|
2021-12-17 09:30:14 -05:00
|
|
|
}
|
|
|
|
|
2021-12-15 08:07:54 -05:00
|
|
|
class Loopster : public ArdourCanvas::Rectangle
|
|
|
|
{
|
2021-12-17 09:30:14 -05:00
|
|
|
public:
|
2021-12-15 08:07:54 -05:00
|
|
|
Loopster (ArdourCanvas::Item* canvas);
|
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
void render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Context> context) const;
|
2021-12-15 08:07:54 -05:00
|
|
|
void set_fraction (float);
|
2021-12-17 09:30:14 -05:00
|
|
|
|
|
|
|
private:
|
2021-12-15 08:07:54 -05:00
|
|
|
float _fraction;
|
|
|
|
};
|
|
|
|
|
2021-12-07 16:47:42 -05:00
|
|
|
class TriggerMaster : public ArdourCanvas::Rectangle
|
2021-12-05 11:56:42 -05:00
|
|
|
{
|
2021-12-17 09:30:14 -05:00
|
|
|
public:
|
2021-12-16 10:13:37 -05:00
|
|
|
TriggerMaster (ArdourCanvas::Item* canvas);
|
2021-12-07 16:47:42 -05:00
|
|
|
~TriggerMaster ();
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2021-12-30 13:20:17 -05:00
|
|
|
void set_triggerbox (boost::shared_ptr<ARDOUR::TriggerBox>);
|
2021-12-16 10:13:37 -05:00
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
void render (ArdourCanvas::Rect const&, Cairo::RefPtr<Cairo::Context>) const;
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
void _size_allocate (ArdourCanvas::Rect const&);
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2022-02-09 11:39:19 -05:00
|
|
|
std::string play_text;
|
|
|
|
std::string loop_text;
|
2021-12-05 11:56:42 -05:00
|
|
|
|
|
|
|
void maybe_update ();
|
|
|
|
bool event_handler (GdkEvent*);
|
|
|
|
void selection_change ();
|
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
private:
|
2021-12-15 08:07:54 -05:00
|
|
|
void context_menu ();
|
2021-12-23 23:18:56 -05:00
|
|
|
|
|
|
|
void clear_all_triggers();
|
2021-12-27 18:35:24 -05:00
|
|
|
void set_all_colors();
|
2022-01-19 17:50:47 -05:00
|
|
|
void set_all_follow_action (ARDOUR::FollowAction const &);
|
2021-12-15 08:07:54 -05:00
|
|
|
void set_all_launch_style (ARDOUR::Trigger::LaunchStyle);
|
2021-12-17 09:30:14 -05:00
|
|
|
void set_all_quantization (Temporal::BBT_Offset const&);
|
|
|
|
|
|
|
|
void prop_change (PBD::PropertyChange const& change);
|
|
|
|
void owner_prop_change (PBD::PropertyChange const&);
|
|
|
|
void ui_parameter_changed (std::string const& p);
|
|
|
|
void set_default_colors ();
|
|
|
|
void shape_stop_button ();
|
2021-12-15 08:07:54 -05:00
|
|
|
|
2021-12-05 11:56:42 -05:00
|
|
|
boost::shared_ptr<ARDOUR::TriggerBox> _triggerbox;
|
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
Loopster* _loopster;
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2021-12-27 18:35:24 -05:00
|
|
|
Gtk::ColorSelectionDialog _color_dialog;
|
2021-12-17 09:30:14 -05:00
|
|
|
Gtk::Menu* _context_menu;
|
2021-12-17 13:41:32 -05:00
|
|
|
bool _ignore_menu_action;
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
double _poly_size;
|
|
|
|
double _poly_margin;
|
2021-12-15 08:07:54 -05:00
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
PBD::ScopedConnection _trigger_prop_connection;
|
|
|
|
PBD::ScopedConnection _owner_prop_connection;
|
|
|
|
sigc::connection _update_connection;
|
2021-12-05 11:56:42 -05:00
|
|
|
};
|
|
|
|
|
2022-01-04 17:00:39 -05:00
|
|
|
typedef std::list<boost::shared_ptr<ARDOUR::TriggerBox> > TriggerBoxList;
|
|
|
|
|
2021-12-12 12:32:38 -05:00
|
|
|
class CueMaster : public ArdourCanvas::Rectangle, public ARDOUR::SessionHandlePtr
|
2021-12-05 11:56:42 -05:00
|
|
|
{
|
2021-12-17 09:30:14 -05:00
|
|
|
public:
|
2021-12-07 16:47:42 -05:00
|
|
|
CueMaster (ArdourCanvas::Item* canvas);
|
|
|
|
~CueMaster ();
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
void render (ArdourCanvas::Rect const& area, Cairo::RefPtr<Cairo::Context> context) const;
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
void _size_allocate (ArdourCanvas::Rect const& alloc);
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2021-12-07 16:47:42 -05:00
|
|
|
ArdourCanvas::Polygon* stop_shape;
|
2021-12-05 11:56:42 -05:00
|
|
|
|
|
|
|
void maybe_update ();
|
|
|
|
bool event_handler (GdkEvent*);
|
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
private:
|
2022-01-04 17:00:39 -05:00
|
|
|
void context_menu ();
|
|
|
|
|
|
|
|
void get_boxen (TriggerBoxList &boxlist);
|
|
|
|
void clear_all_triggers();
|
2022-01-19 17:50:47 -05:00
|
|
|
void set_all_follow_action (ARDOUR::FollowAction const &);
|
2022-01-04 17:00:39 -05:00
|
|
|
void set_all_launch_style (ARDOUR::Trigger::LaunchStyle);
|
|
|
|
void set_all_quantization (Temporal::BBT_Offset const&);
|
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
void ui_parameter_changed (std::string const& p);
|
|
|
|
void set_default_colors ();
|
2021-12-07 16:47:42 -05:00
|
|
|
void shape_stop_button ();
|
2021-12-05 11:56:42 -05:00
|
|
|
|
2022-01-04 17:00:39 -05:00
|
|
|
Gtk::Menu* _context_menu;
|
|
|
|
|
2021-12-17 09:30:14 -05:00
|
|
|
double _poly_size;
|
|
|
|
double _poly_margin;
|
2021-12-05 11:56:42 -05:00
|
|
|
};
|
2021-12-17 09:30:14 -05:00
|
|
|
|
|
|
|
#endif
|