Ardour  8.12
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 #ifndef __ardour_quantize_h__
21 #define __ardour_quantize_h__
22 
24 #include "ardour/types.h"
25 #include "ardour/midi_operator.h"
26 
27 namespace ARDOUR {
28 
30 public:
31  Quantize (bool snap_start, bool snap_end,
32  Temporal::Beats start_grid, Temporal::Beats end_grid,
33  float strength, float swing, Temporal::Beats const & threshold);
35 
36  PBD::Command* operator() (std::shared_ptr<ARDOUR::MidiModel>,
39  std::string name() const { return std::string ("quantize"); }
40  bool empty() const { return !_snap_start && !_snap_end; }
41 
42  Temporal::Beats start_grid() const { return _start_grid; }
43  Temporal::Beats end_grid() const { return _end_grid; }
45  void set_end_grid (Temporal::Beats const &);
46 
47 private:
49  bool _snap_end;
52  float _strength;
53  float _swing;
55 };
56 
57 } /* namespace */
58 
59 #endif /* __ardour_quantize_h__ */
Temporal::Beats _start_grid
Definition: quantize.h:50
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:52
Temporal::Beats _threshold
Definition: quantize.h:54
void set_end_grid(Temporal::Beats const &)
Temporal::Beats end_grid() const
Definition: quantize.h:43
Temporal::Beats start_grid() const
Definition: quantize.h:42
bool _snap_start
Definition: quantize.h:48
bool empty() const
Definition: quantize.h:40
Temporal::Beats _end_grid
Definition: quantize.h:51
std::string name() const
Definition: quantize.h:39
void set_start_grid(Temporal::Beats const &)
std::multiset< NotePtr, EarlierNoteComparator > Notes
Definition: Sequence.h:157
#define LIBARDOUR_API