X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmidi_list_editor.h;h=283a0da8bc26b12af97dfbaf0861c5b814e04739;hb=9f3bcf968d2f98f505ecf60e93ba950677a4e7f2;hp=b437566cbbacd39757d7ea01276a8ea3ebcbfa2a;hpb=51aec9a331a4fc2f023921c4754000d144b4484d;p=ardour.git diff --git a/gtk2_ardour/midi_list_editor.h b/gtk2_ardour/midi_list_editor.h index b437566cbb..283a0da8bc 100644 --- a/gtk2_ardour/midi_list_editor.h +++ b/gtk2_ardour/midi_list_editor.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2009 Paul Davis + Copyright (C) 2009 Paul Davis 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 @@ -14,34 +14,40 @@ 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., 675 Mass Ave, Cambridge, MA 02139, USA. - */ #ifndef __ardour_gtk2_midi_list_editor_h_ #define __ardour_gtk2_midi_list_editor_h_ #include +#include +#include #include #include -#include "evoral/types.hpp" - #include "ardour/session_handle.h" -#include "ardour_dialog.h" +#include "ardour_window.h" + +namespace Evoral { + template class Note; + class Beats; +}; namespace ARDOUR { class MidiRegion; class MidiModel; + class MidiTrack; class Session; }; -class MidiListEditor : public ArdourDialog +class MidiListEditor : public ArdourWindow { public: - typedef Evoral::Note NoteType; + typedef Evoral::Note NoteType; - MidiListEditor(ARDOUR::Session*, boost::shared_ptr); + MidiListEditor(ARDOUR::Session*, boost::shared_ptr, + boost::shared_ptr); ~MidiListEditor(); private: @@ -53,33 +59,59 @@ class MidiListEditor : public ArdourDialog add (velocity); add (start); add (length); - add (end); add (_note); }; - Gtk::TreeModelColumn channel; - Gtk::TreeModelColumn note; + Gtk::TreeModelColumn channel; + Gtk::TreeModelColumn note; Gtk::TreeModelColumn note_name; - Gtk::TreeModelColumn velocity; + Gtk::TreeModelColumn velocity; Gtk::TreeModelColumn start; Gtk::TreeModelColumn length; - Gtk::TreeModelColumn end; Gtk::TreeModelColumn > _note; }; + struct NoteLengthColumns : public Gtk::TreeModel::ColumnRecord { + NoteLengthColumns() { + add (ticks); + add (name); + } + Gtk::TreeModelColumn ticks; + Gtk::TreeModelColumn name; + }; + MidiListModelColumns columns; Glib::RefPtr model; + NoteLengthColumns note_length_columns; + Glib::RefPtr note_length_model; Gtk::TreeView view; Gtk::ScrolledWindow scroller; + Gtk::TreeModel::Path edit_path; + int edit_column; + Gtk::CellRendererText* editing_renderer; + Gtk::CellEditable* editing_editable; + Gtk::Table buttons; + Gtk::VBox vbox; + Gtk::ToggleButton sound_notes_button; boost::shared_ptr region; + boost::shared_ptr track; + + /** connection used to connect to model's ContentChanged signal */ + PBD::ScopedConnection content_connection; + + void edited (const std::string&, const std::string&); + void editing_started (Gtk::CellEditable*, const std::string& path, int); + void editing_canceled (); + void stop_editing (bool cancelled = false); - void edited (const Glib::ustring&, const Glib::ustring&); void redisplay_model (); bool key_press (GdkEventKey* ev); bool key_release (GdkEventKey* ev); - + bool scroll_event (GdkEventScroll*); + void delete_selected_note (); + void selection_changed (); }; #endif /* __ardour_gtk2_midi_list_editor_h_ */