Ardour  9.0-pre0-582-g084a23a80d
midi_list_editor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2015 David Robillard <d@drobilla.net>
3  * Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __ardour_gtk2_midi_list_editor_h_
21 #define __ardour_gtk2_midi_list_editor_h_
22 
23 #include <gtkmm/box.h>
24 #include <gtkmm/liststore.h>
25 #include <gtkmm/scrolledwindow.h>
26 #include <gtkmm/table.h>
27 #include <gtkmm/treeview.h>
28 
29 #include "temporal/beats.h"
30 
31 #include "ardour/session_handle.h"
32 
33 #include "ardour_window.h"
34 
35 namespace Evoral {
36  template <typename Time> class Note;
37 };
38 
39 namespace ARDOUR {
40  class MidiRegion;
41  class MidiModel;
42  class MidiTrack;
43  class Session;
44 };
45 
47 {
48 public:
50 
51  MidiListEditor (ARDOUR::Session*, std::shared_ptr<ARDOUR::MidiRegion>,
52  std::shared_ptr<ARDOUR::MidiTrack>);
54 
55 private:
58  {
59  add (channel);
60  add (note);
61  add (note_name);
62  add (velocity);
63  add (start);
64  add (length);
65  add (_note);
66  };
74  };
75 
78  {
79  add (ticks);
80  add (name);
81  }
84  };
85 
87  Glib::RefPtr<Gtk::ListStore> model;
89  Glib::RefPtr<Gtk::ListStore> note_length_model;
99 
100  std::shared_ptr<ARDOUR::MidiRegion> region;
101  std::shared_ptr<ARDOUR::MidiTrack> track;
102 
105 
106  void edited (const std::string&, const std::string&);
107  void editing_started (Gtk::CellEditable*, const std::string& path, int);
109  void stop_editing (bool cancelled = false);
110 
112 
113  bool key_press (GdkEventKey* ev);
116 
119 };
120 
121 #endif /* __ardour_gtk2_midi_list_editor_h_ */
void add(TreeModelColumnBase &column)
void path(Glib::ustring &path, Glib::ustring &path_reversed)
Compute a widget's path of the form "GtkWindow.MyLabel".
void stop_editing(bool cancelled=false)
Gtk::TreeModel::Path edit_path
bool scroll_event(GdkEventScroll *)
std::shared_ptr< ARDOUR::MidiTrack > track
void editing_started(Gtk::CellEditable *, const std::string &path, int)
PBD::ScopedConnectionList content_connections
void selection_changed()
Gtk::Table buttons
std::shared_ptr< ARDOUR::MidiRegion > region
MidiListEditor(ARDOUR::Session *, std::shared_ptr< ARDOUR::MidiRegion >, std::shared_ptr< ARDOUR::MidiTrack >)
Gtk::TreeView view
void editing_canceled()
MidiListModelColumns columns
bool key_release(GdkEventKey *ev)
Glib::RefPtr< Gtk::ListStore > model
bool key_press(GdkEventKey *ev)
Glib::RefPtr< Gtk::ListStore > note_length_model
Gtk::ScrolledWindow scroller
Gtk::CellEditable * editing_editable
Evoral::Note< Temporal::Beats > NoteType
NoteLengthColumns note_length_columns
void delete_selected_note()
Gtk::CellRendererText * editing_renderer
void redisplay_model()
Gtk::ToggleButton sound_notes_button
void edited(const std::string &, const std::string &)
Definition: editor.h:86
Gtk::TreeModelColumn< uint8_t > channel
Gtk::TreeModelColumn< std::string > start
Gtk::TreeModelColumn< std::string > length
Gtk::TreeModelColumn< uint8_t > velocity
Gtk::TreeModelColumn< std::string > note_name
Gtk::TreeModelColumn< std::shared_ptr< NoteType > > _note
Gtk::TreeModelColumn< uint8_t > note
Gtk::TreeModelColumn< int > ticks
Gtk::TreeModelColumn< std::string > name