ardour
step_editor.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 Paul Davis
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18 
19 #ifndef __gtk2_ardour_step_editor_h__
20 #define __gtk2_ardour_step_editor_h__
21 
22 #include <string>
23 
24 #include <gdk/gdk.h>
25 #include <sigc++/trackable.h>
26 
27 #include "pbd/signals.h"
28 #include "evoral/types.hpp"
29 
30 namespace ARDOUR {
31 class MidiTrack;
32 class MidiRegion;
33 }
34 
35 class MidiRegionView;
36 class MidiTimeAxisView;
37 class PublicEditor;
38 class StepEntry;
39 
40 class StepEditor : public PBD::ScopedConnectionList, public sigc::trackable
41 {
42 public:
44  virtual ~StepEditor ();
45 
46  void check_step_edit ();
47  void step_edit_rest (Evoral::Beats beats);
48  void step_edit_beat_sync ();
49  void step_edit_bar_sync ();
50  int step_add_bank_change (uint8_t channel, uint8_t bank);
51  int step_add_program_change (uint8_t channel, uint8_t program);
52  int step_add_note (uint8_t channel, uint8_t pitch, uint8_t velocity,
53  Evoral::Beats beat_duration);
54  void step_edit_sustain (Evoral::Beats beats);
55  bool step_edit_within_triplet () const;
57  bool step_edit_within_chord () const;
58  void step_edit_toggle_chord ();
63 
64  std::string name() const;
65 
66  void start_step_editing ();
67  void stop_step_editing ();
68 
69 private:
84 
86  void playlist_changed ();
87  bool step_editor_hidden (GdkEventAny*);
88  void step_editor_hide ();
91 };
92 
93 #endif /* __gtk2_ardour_step_editor_h__ */
void step_edit_bar_sync()
Definition: step_editor.cc:392
void stop_step_editing()
Definition: step_editor.cc:163
PBD::ScopedConnection step_edit_region_connection
Definition: step_editor.h:77
boost::shared_ptr< ARDOUR::MidiTrack > _track
Definition: step_editor.h:79
bool step_edit_within_triplet() const
Definition: step_editor.cc:332
bool _step_edit_within_chord
Definition: step_editor.h:75
void move_step_edit_beat_pos(Evoral::Beats beats)
Definition: step_editor.cc:227
Evoral::Beats _step_edit_chord_duration
Definition: step_editor.h:76
Evoral::Beats last_added_end
Definition: step_editor.h:83
Evoral::Beats step_edit_beat_pos
Definition: step_editor.h:71
Representation of the interface of the Editor class.
int step_add_program_change(uint8_t channel, uint8_t program)
Definition: step_editor.cc:213
void reset_step_edit_beat_pos()
Definition: step_editor.cc:130
void playlist_changed()
Definition: step_editor.cc:407
int step_add_note(uint8_t channel, uint8_t pitch, uint8_t velocity, Evoral::Beats beat_duration)
Definition: step_editor.cc:243
std::string name() const
Definition: step_editor.cc:433
bool step_edit_within_chord() const
Definition: step_editor.cc:338
MidiTimeAxisView & _mtv
Definition: step_editor.h:81
virtual ~StepEditor()
Definition: step_editor.cc:53
int step_add_bank_change(uint8_t channel, uint8_t bank)
Definition: step_editor.cc:207
void step_editor_hide()
Definition: step_editor.cc:156
void step_edit_sustain(Evoral::Beats beats)
Definition: step_editor.cc:219
void step_edit_toggle_chord()
Definition: step_editor.cc:355
Definition: amp.h:29
void resync_step_edit_position()
Definition: step_editor.cc:89
ARDOUR::framepos_t step_edit_insert_position
Definition: step_editor.h:70
int64_t framepos_t
Definition: types.h:66
void step_edit_toggle_triplet()
Definition: step_editor.cc:344
void prepare_step_edit_region()
Definition: step_editor.cc:104
void step_edit_beat_sync()
Definition: step_editor.cc:385
uint8_t _step_edit_triplet_countdown
Definition: step_editor.h:74
MidiRegionView * step_edit_region_view
Definition: step_editor.h:73
StepEntry * step_editor
Definition: step_editor.h:80
PublicEditor & _editor
Definition: step_editor.h:78
void resync_step_edit_to_edit_point()
Definition: step_editor.cc:95
int8_t last_added_pitch
Definition: step_editor.h:82
StepEditor(PublicEditor &, boost::shared_ptr< ARDOUR::MidiTrack >, MidiTimeAxisView &)
Definition: step_editor.cc:35
void step_edit_rest(Evoral::Beats beats)
Definition: step_editor.cc:368
void start_step_editing()
Definition: step_editor.cc:59
boost::shared_ptr< ARDOUR::MidiRegion > step_edit_region
Definition: step_editor.h:72
void region_removed(boost::weak_ptr< ARDOUR::Region >)
Definition: step_editor.cc:416
void check_step_edit()
Definition: step_editor.cc:177
void set_step_edit_cursor_width(Evoral::Beats beats)
Definition: step_editor.cc:324
bool step_editor_hidden(GdkEventAny *)
Definition: step_editor.cc:149