NO-OP: clang-format

This commit is contained in:
Robin Gareus 2023-09-24 14:25:14 +02:00
parent ad24d397f5
commit 184bd500f7
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 449 additions and 463 deletions

View File

@ -23,8 +23,8 @@
#include <gtkmm/cellrenderercombo.h>
#include "evoral/midi_util.h"
#include "evoral/Note.h"
#include "evoral/midi_util.h"
#include "ardour/midi_model.h"
#include "ardour/midi_region.h"
@ -32,9 +32,9 @@
#include "ardour/session.h"
#include "ardour/tempo.h"
#include "gtkmm2ext/actions.h"
#include "gtkmm2ext/gui_thread.h"
#include "gtkmm2ext/keyboard.h"
#include "gtkmm2ext/actions.h"
#include "midi_list_editor.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);
/* use a combo renderer for length, so that we can offer a selection
of pre-defined note lengths. we still allow edited values with
arbitrary length (in ticks).
* of pre-defined note lengths. we still allow edited values with
* arbitrary length (in ticks).
*/
Gtk::TreeViewColumn* lenCol = Gtk::manage (new Gtk::TreeViewColumn (_("Length")));
@ -188,11 +188,12 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
int celly;
int idelta = 0;
Temporal::Beats beat_delta;
MidiModel::NoteDiffCommand::Property prop (MidiModel::NoteDiffCommand::NoteNumber);
bool apply = false;
bool was_selected = false;
char const* opname;
MidiModel::NoteDiffCommand::Property prop (MidiModel::NoteDiffCommand::NoteNumber);
if (!view.get_path_at_pos (ev->x, ev->y, path, col, cellx, celly)) {
return false;
}
@ -272,15 +273,12 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
break;
}
if (apply) {
std::shared_ptr<MidiModel> m (region->midi_source (0)->model ());
MidiModel::NoteDiffCommand* cmd = m->new_note_diff_command (opname);
vector<TreeModel::Path> previous_selection;
if (was_selected) {
/* use selection */
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;
for (TreeView::Selection::ListHandle_Path::iterator i = rows.begin (); i != rows.end (); ++i) {
previous_selection.push_back (*i);
if ((iter = model->get_iter (*i))) {
note = (*iter)[columns._note];
switch (prop) {
@ -331,7 +327,6 @@ MidiListEditor::scroll_event (GdkEventScroll* ev)
}
} else {
/* just this row */
TreeModel::iterator iter;
@ -455,7 +450,6 @@ MidiListEditor::key_press (GdkEventKey* ev)
case GDK_Escape:
stop_editing (true);
break;
}
return ret;
@ -620,7 +614,7 @@ MidiListEditor::edited (const std::string& path, const std::string& text)
case 0: // start
break;
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 ()) {
idelta = ival - note->channel ();
prop = MidiModel::NoteDiffCommand::Channel;
@ -655,13 +649,11 @@ MidiListEditor::edited (const std::string& path, const std::string& text)
break;
case 5: // length
try {
stringstream ss (text);
ss >> bval;
} catch (...) {
/* assume its text from the combo. look for the map
* 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);
if (x == note_length_map.end ()) {
/* tick length not in map - was
* displaying numeric value ... use new value
* from note length map, and convert to beats.
@ -687,11 +678,9 @@ MidiListEditor::edited (const std::string& path, const std::string& text)
}
} else {
bval = Temporal::Beats ();
if (text != x->second) {
/* get ticks for the newly selected
* note length
*/
@ -723,7 +712,6 @@ MidiListEditor::edited (const std::string& path, const std::string& text)
}
if (apply) {
std::shared_ptr<MidiModel> m (region->midi_source (0)->model ());
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) {
if ((iter = model->get_iter (*i))) {
note = (*iter)[columns._note];
switch (prop) {
@ -777,7 +764,6 @@ MidiListEditor::redisplay_model ()
model->clear ();
if (_session) {
std::shared_ptr<MidiModel> m (region->midi_source (0)->model ());
TreeModel::Row row;
stringstream ss;

View File

@ -20,11 +20,11 @@
#ifndef __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/liststore.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/table.h>
#include <gtkmm/treeview.h>
#include "ardour/session_handle.h"
@ -51,9 +51,9 @@ public:
~MidiListEditor ();
private:
struct MidiListModelColumns : public Gtk::TreeModel::ColumnRecord
struct MidiListModelColumns : public Gtk::TreeModel::ColumnRecord {
MidiListModelColumns ()
{
MidiListModelColumns() {
add (channel);
add (note);
add (note_name);
@ -71,9 +71,9 @@ private:
Gtk::TreeModelColumn<std::shared_ptr<NoteType>> _note;
};
struct NoteLengthColumns : public Gtk::TreeModel::ColumnRecord
struct NoteLengthColumns : public Gtk::TreeModel::ColumnRecord {
NoteLengthColumns ()
{
NoteLengthColumns() {
add (ticks);
add (name);
}