rename join regions op as combine regions; save and restore nested playlists, sources...
[ardour.git] / gtk2_ardour / midi_list_editor.h
index ac931dcca6b881854635ce258cd566aaec490a1b..67b2f9192365059bfa862a20ef128e86aca5b29d 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
    Copyright (C) 2009 Paul Davis
 
        This program is free software; you can redistribute it and/or modify
 
 #include "evoral/types.hpp"
 
+#include "ardour/session_handle.h"
+
 #include "ardour_dialog.h"
 
 namespace ARDOUR {
        class MidiRegion;
        class MidiModel;
+       class Session;
 };
 
 class MidiListEditor : public ArdourDialog
 {
   public:
-       MidiListEditor(boost::shared_ptr<ARDOUR::MidiRegion>);
+       typedef Evoral::Note<Evoral::MusicalTime> NoteType;
+
+       MidiListEditor(ARDOUR::Session*, boost::shared_ptr<ARDOUR::MidiRegion>);
        ~MidiListEditor();
 
   private:
        struct MidiListModelColumns : public Gtk::TreeModel::ColumnRecord {
-               MidiListModelColumns() { 
+               MidiListModelColumns() {
                        add (channel);
                        add (note);
                        add (note_name);
@@ -49,25 +54,36 @@ class MidiListEditor : public ArdourDialog
                        add (start);
                        add (length);
                        add (end);
+                       add (_note);
                };
                Gtk::TreeModelColumn<uint8_t> channel;
                Gtk::TreeModelColumn<uint8_t> note;
                Gtk::TreeModelColumn<std::string> note_name;
                Gtk::TreeModelColumn<uint8_t> velocity;
-               Gtk::TreeModelColumn<Evoral::MusicalTime> start;
-               Gtk::TreeModelColumn<Evoral::MusicalTime> length;
-               Gtk::TreeModelColumn<Evoral::MusicalTime> end;
+               Gtk::TreeModelColumn<std::string> start;
+               Gtk::TreeModelColumn<std::string> length;
+               Gtk::TreeModelColumn<std::string> end;
+               Gtk::TreeModelColumn<boost::shared_ptr<NoteType> > _note;
        };
-       
+
        MidiListModelColumns         columns;
        Glib::RefPtr<Gtk::ListStore> model;
        Gtk::TreeView                view;
        Gtk::ScrolledWindow          scroller;
+       std::string               _current_edit;
 
        boost::shared_ptr<ARDOUR::MidiRegion> region;
 
-       void edited (const Glib::ustring&, const Glib::ustring&);
+       void edited (const std::string&, const std::string&);
+       void editing_started (Gtk::CellEditable*, const std::string& path, int);
+       void editing_canceled ();
+
        void redisplay_model ();
+
+       bool key_press (GdkEventKey* ev);
+       bool key_release (GdkEventKey* ev);
+       
+       void delete_selected_note ();
 };
 
 #endif /* __ardour_gtk2_midi_list_editor_h_ */