2009-10-14 12:10:01 -04:00
|
|
|
/*
|
2011-10-19 17:53:09 -04:00
|
|
|
Copyright (C) 2009 Paul Davis
|
2009-08-26 23:09:30 -04:00
|
|
|
|
|
|
|
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
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
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 <gtkmm/treeview.h>
|
|
|
|
#include <gtkmm/liststore.h>
|
|
|
|
#include <gtkmm/scrolledwindow.h>
|
|
|
|
|
|
|
|
#include "evoral/types.hpp"
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
#include "ardour/session_handle.h"
|
|
|
|
|
2011-11-18 19:56:35 -05:00
|
|
|
#include "ardour_window.h"
|
2009-08-26 23:09:30 -04:00
|
|
|
|
2011-10-19 17:53:09 -04:00
|
|
|
namespace Evoral {
|
|
|
|
template<typename Time> class Note;
|
|
|
|
};
|
|
|
|
|
2009-08-26 23:09:30 -04:00
|
|
|
namespace ARDOUR {
|
|
|
|
class MidiRegion;
|
|
|
|
class MidiModel;
|
2009-09-03 08:39:50 -04:00
|
|
|
class Session;
|
2009-08-26 23:09:30 -04:00
|
|
|
};
|
|
|
|
|
2011-11-18 19:56:35 -05:00
|
|
|
class MidiListEditor : public ArdourWindow
|
2009-08-26 23:09:30 -04:00
|
|
|
{
|
|
|
|
public:
|
2009-09-03 08:39:50 -04:00
|
|
|
typedef Evoral::Note<Evoral::MusicalTime> NoteType;
|
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
MidiListEditor(ARDOUR::Session*, boost::shared_ptr<ARDOUR::MidiRegion>);
|
2009-08-26 23:09:30 -04:00
|
|
|
~MidiListEditor();
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct MidiListModelColumns : public Gtk::TreeModel::ColumnRecord {
|
2009-10-14 12:10:01 -04:00
|
|
|
MidiListModelColumns() {
|
2009-08-26 23:09:30 -04:00
|
|
|
add (channel);
|
|
|
|
add (note);
|
|
|
|
add (note_name);
|
|
|
|
add (velocity);
|
|
|
|
add (start);
|
|
|
|
add (length);
|
|
|
|
add (end);
|
2010-01-04 22:52:30 -05:00
|
|
|
add (_note);
|
2009-08-26 23:09:30 -04:00
|
|
|
};
|
|
|
|
Gtk::TreeModelColumn<uint8_t> channel;
|
|
|
|
Gtk::TreeModelColumn<uint8_t> note;
|
|
|
|
Gtk::TreeModelColumn<std::string> note_name;
|
|
|
|
Gtk::TreeModelColumn<uint8_t> velocity;
|
2009-09-03 08:39:50 -04:00
|
|
|
Gtk::TreeModelColumn<std::string> start;
|
|
|
|
Gtk::TreeModelColumn<std::string> length;
|
|
|
|
Gtk::TreeModelColumn<std::string> end;
|
|
|
|
Gtk::TreeModelColumn<boost::shared_ptr<NoteType> > _note;
|
2009-08-26 23:09:30 -04:00
|
|
|
};
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-08-26 23:09:30 -04:00
|
|
|
MidiListModelColumns columns;
|
|
|
|
Glib::RefPtr<Gtk::ListStore> model;
|
|
|
|
Gtk::TreeView view;
|
|
|
|
Gtk::ScrolledWindow scroller;
|
2010-09-14 12:51:02 -04:00
|
|
|
std::string _current_edit;
|
2009-08-26 23:09:30 -04:00
|
|
|
|
|
|
|
boost::shared_ptr<ARDOUR::MidiRegion> region;
|
|
|
|
|
2010-09-14 12:51:02 -04:00
|
|
|
void edited (const std::string&, const std::string&);
|
|
|
|
void editing_started (Gtk::CellEditable*, const std::string& path, int);
|
2010-01-05 09:56:42 -05:00
|
|
|
void editing_canceled ();
|
|
|
|
|
2009-08-26 23:09:30 -04:00
|
|
|
void redisplay_model ();
|
2010-01-04 22:52:30 -05:00
|
|
|
|
|
|
|
bool key_press (GdkEventKey* ev);
|
|
|
|
bool key_release (GdkEventKey* ev);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2010-01-04 22:52:30 -05:00
|
|
|
void delete_selected_note ();
|
2009-08-26 23:09:30 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_gtk2_midi_list_editor_h_ */
|