Ardour  9.0-pre0-582-g084a23a80d
step_editor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010-2018 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2011-2015 David Robillard <d@drobilla.net>
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 __gtk2_ardour_step_editor_h__
21 #define __gtk2_ardour_step_editor_h__
22 
23 #include <string>
24 
25 #include <gdk/gdk.h>
26 #include <sigc++/trackable.h>
27 
28 #include "pbd/signals.h"
29 
30 #include "temporal/beats.h"
31 #include "temporal/timeline.h"
32 
33 namespace ARDOUR {
34 class MidiTrack;
35 class MidiRegion;
36 class Region;
37 }
38 
39 class MidiRegionView;
40 class MidiTimeAxisView;
41 class PublicEditor;
42 class StepEntry;
43 
55 class StepEditor : public PBD::ScopedConnectionList, public sigc::trackable
56 {
57 public:
58  StepEditor (PublicEditor&, std::shared_ptr<ARDOUR::MidiTrack>, MidiTimeAxisView&);
59  virtual ~StepEditor ();
60 
61  void step_entry_done ();
62 
63  void check_step_edit ();
67  int step_add_bank_change (uint8_t channel, uint8_t bank);
68  int step_add_program_change (uint8_t channel, uint8_t program);
69  int step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity,
70  Temporal::Beats beat_duration);
72  bool step_edit_within_triplet () const;
74  bool step_edit_within_chord () const;
80 
81  std::string name () const;
82 
85 
86 private:
89  std::shared_ptr<ARDOUR::MidiRegion> step_edit_region;
96  std::shared_ptr<ARDOUR::MidiTrack> _track;
100 
101  sigc::connection delete_connection;
102  sigc::connection hide_connection;
103 
104  void region_removed (std::weak_ptr<ARDOUR::Region>);
109 };
110 
111 #endif /* __gtk2_ardour_step_editor_h__ */
Representation of the interface of the Editor class.
bool step_edit_within_triplet() const
std::shared_ptr< ARDOUR::MidiTrack > _track
Definition: step_editor.h:96
bool step_entry_hidden(GdkEventAny *)
void reset_step_edit_beat_pos()
int step_add_bank_change(uint8_t channel, uint8_t bank)
void check_step_edit()
void step_entry_done()
void step_edit_toggle_triplet()
void step_edit_bar_sync()
int step_add_note(uint8_t channel, uint8_t pitch, uint8_t velocity, Temporal::Beats beat_duration)
void set_step_edit_cursor_width(Temporal::Beats beats)
void step_edit_rest(Temporal::Beats beats)
void step_edit_beat_sync()
void region_removed(std::weak_ptr< ARDOUR::Region >)
void resync_step_edit_position()
Temporal::timepos_t step_edit_insert_position
Definition: step_editor.h:87
MidiTimeAxisView & _mtv
Definition: step_editor.h:97
void step_edit_sustain(Temporal::Beats beats)
virtual ~StepEditor()
void resync_step_edit_to_edit_point()
void step_edit_toggle_chord()
PublicEditor & _editor
Definition: step_editor.h:95
bool _step_edit_within_chord
Definition: step_editor.h:92
std::string name() const
int8_t last_added_pitch
Definition: step_editor.h:98
MidiRegionView * step_edit_region_view
Definition: step_editor.h:90
std::shared_ptr< ARDOUR::MidiRegion > step_edit_region
Definition: step_editor.h:89
void playlist_changed()
void start_step_editing()
Temporal::Beats _step_edit_chord_duration
Definition: step_editor.h:93
PBD::ScopedConnection step_edit_region_connection
Definition: step_editor.h:94
void prepare_step_edit_region()
int step_add_program_change(uint8_t channel, uint8_t program)
void move_step_edit_beat_pos(Temporal::Beats beats)
Temporal::Beats last_added_end
Definition: step_editor.h:99
sigc::connection hide_connection
Definition: step_editor.h:102
StepEditor(PublicEditor &, std::shared_ptr< ARDOUR::MidiTrack >, MidiTimeAxisView &)
uint8_t _step_edit_triplet_countdown
Definition: step_editor.h:91
Temporal::Beats step_edit_beat_pos
Definition: step_editor.h:88
void stop_step_editing()
sigc::connection delete_connection
Definition: step_editor.h:101
bool step_edit_within_chord() const