Ardour  9.0-pre0-582-g084a23a80d
io_plugin_window.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef _gtkardour_ioplugin_window_h_
20 #define _gtkardour_ioplugin_window_h_
21 
22 #include <gtkmm/alignment.h>
23 #include <gtkmm/box.h>
24 #include <gtkmm/frame.h>
25 #include <gtkmm/menu.h>
26 
27 #include "pbd/signals.h"
28 
29 #include "ardour_window.h"
30 #include "plugin_interest.h"
31 #include "io_button.h"
32 #include "window_manager.h"
33 
34 namespace ARDOUR
35 {
36  class IO;
37  class IOPlug;
38  class Port;
39 }
40 
41 class IOSelectorWindow;
42 class PluginWindowProxy;
43 
45 {
46 public:
48 
50 
51 protected:
52  void on_show ();
53  void on_hide ();
54 
55 private:
57  {
58  public:
59  PluginBox (bool is_pre);
60  void clear ();
62 
63  private:
67  void drag_data_received (Glib::RefPtr<Gdk::DragContext> const&, int, int, Gtk::SelectionData const&, guint, guint);
68 
72  bool _is_pre;
73  };
74 
75  class IOButton : public IOButtonBase
76  {
77  public:
78  IOButton (std::shared_ptr<ARDOUR::IO>, bool pre);
80 
81  private:
82  void update ();
86  void port_pretty_name_changed (std::string);
87  void port_connected_or_disconnected (std::weak_ptr<ARDOUR::Port>, std::weak_ptr<ARDOUR::Port>);
88  void maybe_add_bundle_to_menu (std::shared_ptr<ARDOUR::Bundle>);
89  void disconnect ();
90  void bundle_chosen (std::shared_ptr<ARDOUR::Bundle>);
92 
93  std::shared_ptr<ARDOUR::IO> _io;
94  bool _pre;
97  };
98 
99  class IOPlugUI : public Gtk::Alignment
100  {
101  public:
102  IOPlugUI (std::shared_ptr<ARDOUR::IOPlug>);
103 
104  private:
107  void self_delete (); /* implicit */
108  void self_remove (); /* explicit */
109  void edit_plugin (bool);
110 
117  std::shared_ptr<ARDOUR::IOPlug> _iop;
119  };
120 
121  /* IOPluginWindow members */
122  void refill ();
123 
126 };
127 
128 #endif
void port_pretty_name_changed(std::string)
IOButton(std::shared_ptr< ARDOUR::IO >, bool pre)
void bundle_chosen(std::shared_ptr< ARDOUR::Bundle >)
void button_resized(Gtk::Allocation &)
void maybe_add_bundle_to_menu(std::shared_ptr< ARDOUR::Bundle >)
bool button_press(GdkEventButton *)
IOSelectorWindow * _io_selector
bool button_release(GdkEventButton *)
void port_connected_or_disconnected(std::weak_ptr< ARDOUR::Port >, std::weak_ptr< ARDOUR::Port >)
std::shared_ptr< ARDOUR::IO > _io
IOPlugUI(std::shared_ptr< ARDOUR::IOPlug >)
bool button_press_event(GdkEventButton *)
std::shared_ptr< ARDOUR::IOPlug > _iop
PluginWindowProxy * _window_proxy
PBD::ScopedConnection _going_away_connection
ArdourWidgets::ArdourButton _btn_ioplug
void button_resized(Gtk::Allocation &)
bool use_plugins(SelectedPlugins const &)
bool button_press_event(GdkEventButton *)
void add_child(Gtk::Widget &)
void drag_data_received(Glib::RefPtr< Gdk::DragContext > const &, int, int, Gtk::SelectionData const &, guint, guint)
void load_plugin(ARDOUR::PluginPresetPtr const &)
void on_show()
This is a default handler for the signal signal_show().
void set_session(ARDOUR::Session *)
void on_hide()
This is a default handler for the signal signal_hide().
std::shared_ptr< PluginPreset > PluginPresetPtr
Definition: plugin.h:479
std::vector< ARDOUR::PluginPtr > SelectedPlugins