X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fmidi_list_editor.h;h=764dc5696a5cb812fc263a1fd1618118cfa12075;hb=3dcb7bf3d3f4eca512c799b5f63fd412e5e3e233;hp=1e25d104f96d8a004fec96ceb05f85c3da3ba088;hpb=ed626628b54e67dd9621c08d82a42afaed00c7ac;p=ardour.git diff --git a/gtk2_ardour/midi_list_editor.h b/gtk2_ardour/midi_list_editor.h index 1e25d104f9..764dc5696a 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,38 +14,45 @@ 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; +public: + typedef Evoral::Note NoteType; - MidiListEditor(ARDOUR::Session*, boost::shared_ptr); + MidiListEditor(ARDOUR::Session*, boost::shared_ptr, + boost::shared_ptr); ~MidiListEditor(); - private: - struct MidiListModelColumns : public Gtk::TreeModel::ColumnRecord { +private: + struct MidiListModelColumns : public Gtk::TreeModel::ColumnRecord + { MidiListModelColumns() { add (channel); add (note); @@ -53,37 +60,60 @@ 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; - std::string _current_edit; + 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 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_ */