Ardour  9.0-pre0-582-g084a23a80d
quantize.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 David Robillard <d@drobilla.net>
3  * Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
23 #include "ardour/types.h"
24 #include "ardour/midi_operator.h"
25 
26 namespace ARDOUR {
27 
29 public:
30  Quantize (bool snap_start, bool snap_end,
31  Temporal::Beats start_grid, Temporal::Beats end_grid,
32  float strength, float swing, Temporal::Beats const & threshold);
34 
35  PBD::Command* operator() (std::shared_ptr<ARDOUR::MidiModel>,
38  std::string name() const { return std::string ("quantize"); }
39  bool empty() const { return !_snap_start && !_snap_end; }
40 
41  Temporal::Beats start_grid() const { return _start_grid; }
42  Temporal::Beats end_grid() const { return _end_grid; }
44  void set_end_grid (Temporal::Beats const &);
45 
46 private:
48  bool _snap_end;
51  float _strength;
52  float _swing;
54 };
55 
56 } /* namespace */
57 
Temporal::Beats _start_grid
Definition: quantize.h:49
Quantize(bool snap_start, bool snap_end, Temporal::Beats start_grid, Temporal::Beats end_grid, float strength, float swing, Temporal::Beats const &threshold)
float _strength
Definition: quantize.h:51
Temporal::Beats _threshold
Definition: quantize.h:53
void set_end_grid(Temporal::Beats const &)
Temporal::Beats end_grid() const
Definition: quantize.h:42
Temporal::Beats start_grid() const
Definition: quantize.h:41
bool _snap_start
Definition: quantize.h:47
bool empty() const
Definition: quantize.h:39
Temporal::Beats _end_grid
Definition: quantize.h:50
std::string name() const
Definition: quantize.h:38
void set_start_grid(Temporal::Beats const &)
std::multiset< NotePtr, EarlierNoteComparator > Notes
Definition: Sequence.h:157
#define LIBARDOUR_API