NO-OP: clang-format
This commit is contained in:
parent
ad24d397f5
commit
184bd500f7
|
@ -23,8 +23,8 @@
|
||||||
|
|
||||||
#include <gtkmm/cellrenderercombo.h>
|
#include <gtkmm/cellrenderercombo.h>
|
||||||
|
|
||||||
#include "evoral/midi_util.h"
|
|
||||||
#include "evoral/Note.h"
|
#include "evoral/Note.h"
|
||||||
|
#include "evoral/midi_util.h"
|
||||||
|
|
||||||
#include "ardour/midi_model.h"
|
#include "ardour/midi_model.h"
|
||||||
#include "ardour/midi_region.h"
|
#include "ardour/midi_region.h"
|
||||||
|
@ -32,9 +32,9 @@
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
#include "ardour/tempo.h"
|
#include "ardour/tempo.h"
|
||||||
|
|
||||||
|
#include "gtkmm2ext/actions.h"
|
||||||
#include "gtkmm2ext/gui_thread.h"
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
#include "gtkmm2ext/keyboard.h"
|
#include "gtkmm2ext/keyboard.h"
|
||||||
#include "gtkmm2ext/actions.h"
|
|
||||||
|
|
||||||
#include "midi_list_editor.h"
|
#include "midi_list_editor.h"
|
||||||
#include "note_player.h"
|
#include "note_player.h"
|
||||||
|
@ -109,8 +109,8 @@ MidiListEditor::MidiListEditor (Session* s, std::shared_ptr<MidiRegion> r, std::
|
||||||
view.append_column (_("Vel"), columns.velocity);
|
view.append_column (_("Vel"), columns.velocity);
|
||||||
|
|
||||||
/* use a combo renderer for length, so that we can offer a selection
|
/* use a combo renderer for length, so that we can offer a selection
|
||||||
of pre-defined note lengths. we still allow edited values with
|
* of pre-defined note lengths. we still allow edited values with
|
||||||
arbitrary length (in ticks).
|
* arbitrary length (in ticks).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Gtk::TreeViewColumn* lenCol = Gtk::manage (new Gtk::TreeViewColumn (_("Length")));
|
Gtk::TreeViewColumn* lenCol = Gtk::manage (new Gtk::TreeViewColumn (_("Length")));
|
||||||
|
@ -188,11 +188,12 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
|
||||||
int celly;
|
int celly;
|
||||||
int idelta = 0;
|
int idelta = 0;
|
||||||
Temporal::Beats beat_delta;
|
Temporal::Beats beat_delta;
|
||||||
MidiModel::NoteDiffCommand::Property prop (MidiModel::NoteDiffCommand::NoteNumber);
|
|
||||||
bool apply = false;
|
bool apply = false;
|
||||||
bool was_selected = false;
|
bool was_selected = false;
|
||||||
char const* opname;
|
char const* opname;
|
||||||
|
|
||||||
|
MidiModel::NoteDiffCommand::Property prop (MidiModel::NoteDiffCommand::NoteNumber);
|
||||||
|
|
||||||
if (!view.get_path_at_pos (ev->x, ev->y, path, col, cellx, celly)) {
|
if (!view.get_path_at_pos (ev->x, ev->y, path, col, cellx, celly)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -272,15 +273,12 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (apply) {
|
if (apply) {
|
||||||
|
|
||||||
std::shared_ptr<MidiModel> m (region->midi_source (0)->model ());
|
std::shared_ptr<MidiModel> m (region->midi_source (0)->model ());
|
||||||
MidiModel::NoteDiffCommand* cmd = m->new_note_diff_command (opname);
|
MidiModel::NoteDiffCommand* cmd = m->new_note_diff_command (opname);
|
||||||
vector<TreeModel::Path> previous_selection;
|
vector<TreeModel::Path> previous_selection;
|
||||||
|
|
||||||
if (was_selected) {
|
if (was_selected) {
|
||||||
|
|
||||||
/* use selection */
|
/* use selection */
|
||||||
|
|
||||||
TreeView::Selection::ListHandle_Path rows = view.get_selection ()->get_selected_rows ();
|
TreeView::Selection::ListHandle_Path rows = view.get_selection ()->get_selected_rows ();
|
||||||
|
@ -288,11 +286,9 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
|
||||||
std::shared_ptr<NoteType> note;
|
std::shared_ptr<NoteType> note;
|
||||||
|
|
||||||
for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin (); i != rows.end (); ++i) {
|
for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin (); i != rows.end (); ++i) {
|
||||||
|
|
||||||
previous_selection.push_back (*i);
|
previous_selection.push_back (*i);
|
||||||
|
|
||||||
if ((iter = model->get_iter (*i))) {
|
if ((iter = model->get_iter (*i))) {
|
||||||
|
|
||||||
note = (*iter)[columns._note];
|
note = (*iter)[columns._note];
|
||||||
|
|
||||||
switch (prop) {
|
switch (prop) {
|
||||||
|
@ -331,7 +327,6 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/* just this row */
|
/* just this row */
|
||||||
|
|
||||||
TreeModel::iterator iter;
|
TreeModel::iterator iter;
|
||||||
|
@ -455,7 +450,6 @@ MidiListEditor::key_press (GdkEventKey* ev)
|
||||||
case GDK_Escape:
|
case GDK_Escape:
|
||||||
stop_editing (true);
|
stop_editing (true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -620,7 +614,7 @@ MidiListEditor::edited (const std::string& path, const std::string& text)
|
||||||
case 0: // start
|
case 0: // start
|
||||||
break;
|
break;
|
||||||
case 1: // channel
|
case 1: // channel
|
||||||
// correct ival for zero-based counting after scan
|
/* correct ival for zero-based counting after scan */
|
||||||
if (sscanf (text.c_str (), "%d", &ival) == 1 && --ival != note->channel ()) {
|
if (sscanf (text.c_str (), "%d", &ival) == 1 && --ival != note->channel ()) {
|
||||||
idelta = ival - note->channel ();
|
idelta = ival - note->channel ();
|
||||||
prop = MidiModel::NoteDiffCommand::Channel;
|
prop = MidiModel::NoteDiffCommand::Channel;
|
||||||
|
@ -655,13 +649,11 @@ MidiListEditor::edited (const std::string& path, const std::string& text)
|
||||||
break;
|
break;
|
||||||
case 5: // length
|
case 5: // length
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
stringstream ss (text);
|
stringstream ss (text);
|
||||||
ss >> bval;
|
ss >> bval;
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
|
||||||
/* assume its text from the combo. look for the map
|
/* assume its text from the combo. look for the map
|
||||||
* entry for the actual note ticks
|
* entry for the actual note ticks
|
||||||
*/
|
*/
|
||||||
|
@ -670,7 +662,6 @@ MidiListEditor::edited (const std::string& path, const std::string& text)
|
||||||
std::map<int, string>::iterator x = note_length_map.find (len_ticks);
|
std::map<int, string>::iterator x = note_length_map.find (len_ticks);
|
||||||
|
|
||||||
if (x == note_length_map.end ()) {
|
if (x == note_length_map.end ()) {
|
||||||
|
|
||||||
/* tick length not in map - was
|
/* tick length not in map - was
|
||||||
* displaying numeric value ... use new value
|
* displaying numeric value ... use new value
|
||||||
* from note length map, and convert to beats.
|
* from note length map, and convert to beats.
|
||||||
|
@ -687,11 +678,9 @@ MidiListEditor::edited (const std::string& path, const std::string& text)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
bval = Temporal::Beats ();
|
bval = Temporal::Beats ();
|
||||||
|
|
||||||
if (text != x->second) {
|
if (text != x->second) {
|
||||||
|
|
||||||
/* get ticks for the newly selected
|
/* get ticks for the newly selected
|
||||||
* note length
|
* note length
|
||||||
*/
|
*/
|
||||||
|
@ -723,7 +712,6 @@ MidiListEditor::edited (const std::string& path, const std::string& text)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (apply) {
|
if (apply) {
|
||||||
|
|
||||||
std::shared_ptr<MidiModel> m (region->midi_source (0)->model ());
|
std::shared_ptr<MidiModel> m (region->midi_source (0)->model ());
|
||||||
MidiModel::NoteDiffCommand* cmd = m->new_note_diff_command (opname);
|
MidiModel::NoteDiffCommand* cmd = m->new_note_diff_command (opname);
|
||||||
|
|
||||||
|
@ -731,7 +719,6 @@ MidiListEditor::edited (const std::string& path, const std::string& text)
|
||||||
|
|
||||||
for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin (); i != rows.end (); ++i) {
|
for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin (); i != rows.end (); ++i) {
|
||||||
if ((iter = model->get_iter (*i))) {
|
if ((iter = model->get_iter (*i))) {
|
||||||
|
|
||||||
note = (*iter)[columns._note];
|
note = (*iter)[columns._note];
|
||||||
|
|
||||||
switch (prop) {
|
switch (prop) {
|
||||||
|
@ -777,7 +764,6 @@ MidiListEditor::redisplay_model ()
|
||||||
model->clear ();
|
model->clear ();
|
||||||
|
|
||||||
if (_session) {
|
if (_session) {
|
||||||
|
|
||||||
std::shared_ptr<MidiModel> m (region->midi_source (0)->model ());
|
std::shared_ptr<MidiModel> m (region->midi_source (0)->model ());
|
||||||
TreeModel::Row row;
|
TreeModel::Row row;
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
#ifndef __ardour_gtk2_midi_list_editor_h_
|
#ifndef __ardour_gtk2_midi_list_editor_h_
|
||||||
#define __ardour_gtk2_midi_list_editor_h_
|
#define __ardour_gtk2_midi_list_editor_h_
|
||||||
|
|
||||||
#include <gtkmm/treeview.h>
|
|
||||||
#include <gtkmm/table.h>
|
|
||||||
#include <gtkmm/box.h>
|
#include <gtkmm/box.h>
|
||||||
#include <gtkmm/liststore.h>
|
#include <gtkmm/liststore.h>
|
||||||
#include <gtkmm/scrolledwindow.h>
|
#include <gtkmm/scrolledwindow.h>
|
||||||
|
#include <gtkmm/table.h>
|
||||||
|
#include <gtkmm/treeview.h>
|
||||||
|
|
||||||
#include "ardour/session_handle.h"
|
#include "ardour/session_handle.h"
|
||||||
|
|
||||||
|
@ -51,9 +51,9 @@ public:
|
||||||
~MidiListEditor ();
|
~MidiListEditor ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct MidiListModelColumns : public Gtk::TreeModel::ColumnRecord
|
struct MidiListModelColumns : public Gtk::TreeModel::ColumnRecord {
|
||||||
|
MidiListModelColumns ()
|
||||||
{
|
{
|
||||||
MidiListModelColumns() {
|
|
||||||
add (channel);
|
add (channel);
|
||||||
add (note);
|
add (note);
|
||||||
add (note_name);
|
add (note_name);
|
||||||
|
@ -71,9 +71,9 @@ private:
|
||||||
Gtk::TreeModelColumn<std::shared_ptr<NoteType>> _note;
|
Gtk::TreeModelColumn<std::shared_ptr<NoteType>> _note;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct NoteLengthColumns : public Gtk::TreeModel::ColumnRecord
|
struct NoteLengthColumns : public Gtk::TreeModel::ColumnRecord {
|
||||||
|
NoteLengthColumns ()
|
||||||
{
|
{
|
||||||
NoteLengthColumns() {
|
|
||||||
add (ticks);
|
add (ticks);
|
||||||
add (name);
|
add (name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user