ardour
patch_change.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2000-2010 Paul Davis
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
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 
18 */
19 
20 #ifndef __PATCH_CHANGE_H__
21 #define __PATCH_CHANGE_H__
22 
23 #include "canvas/flag.h"
24 
25 class MidiRegionView;
26 
27 namespace MIDI {
28  namespace Name {
29  struct PatchPrimaryKey;
30  }
31 }
32 
34 {
35 public:
37  ArdourCanvas::Container* parent,
38  const std::string& text,
39  double height,
40  double x,
41  double y,
44 
45  ~PatchChange();
46 
48 
49  void on_patch_menu_selected(const MIDI::Name::PatchPrimaryKey& key);
50 
51 
52  void move (ArdourCanvas::Duple);
53  void set_height (ArdourCanvas::Distance);
54  void hide ();
55  void show ();
56 
58  ArdourCanvas::Item* canvas_item() const { return _flag; }
59  ArdourCanvas::Item& item() const { return *_flag; }
60 
61 private:
62  bool event_handler (GdkEvent *);
63 
67  Gtk::Menu _popup;
69  ArdourCanvas::Flag* _flag;
70 };
71 
72 #endif /* __PATCH_CHANGE_H__ */
ARDOUR::InstrumentInfo & _info
Definition: patch_change.h:65
void on_patch_menu_selected(const MIDI::Name::PatchPrimaryKey &key)
ArdourCanvas::Flag * _flag
Definition: patch_change.h:69
void move(ArdourCanvas::Duple)
ArdourCanvas::Item * canvas_item() const
Definition: patch_change.h:58
MidiRegionView & _region
Definition: patch_change.h:64
ARDOUR::MidiModel::PatchChangePtr patch() const
Definition: patch_change.h:57
PatchChange(MidiRegionView &region, ArdourCanvas::Container *parent, const std::string &text, double height, double x, double y, ARDOUR::InstrumentInfo &info, ARDOUR::MidiModel::PatchChangePtr patch)
void set_height(ArdourCanvas::Distance)
LIBPBD_API Transmitter info
bool _popup_initialized
Definition: patch_change.h:68
ARDOUR::MidiModel::PatchChangePtr _patch
Definition: patch_change.h:66
ArdourCanvas::Item & item() const
Definition: patch_change.h:59
Gtk::Menu _popup
Definition: patch_change.h:67
void initialize_popup_menus()
Definition: patch_change.cc:79
Definition: ardour.h:41
bool event_handler(GdkEvent *)