1 #ifndef __pbd__step_editor_h__
2 #define __pbd__step_editor_h__
7 #include <sigc++/trackable.h>
9 #include "pbd/signals.h"
10 #include "evoral/types.hpp"
18 class MidiTimeAxisView
;
22 class StepEditor
: public PBD::ScopedConnectionList
, public sigc::trackable
25 StepEditor (PublicEditor
&, boost::shared_ptr
<ARDOUR::MidiTrack
>, MidiTimeAxisView
&);
26 virtual ~StepEditor ();
28 void check_step_edit ();
29 void step_edit_rest (Evoral::MusicalTime beats
);
30 void step_edit_beat_sync ();
31 void step_edit_bar_sync ();
32 int step_add_bank_change (uint8_t channel
, uint8_t bank
);
33 int step_add_program_change (uint8_t channel
, uint8_t program
);
34 int step_add_note (uint8_t channel
, uint8_t pitch
, uint8_t velocity
,
35 Evoral::MusicalTime beat_duration
);
36 void step_edit_sustain (Evoral::MusicalTime beats
);
37 bool step_edit_within_triplet () const;
38 void step_edit_toggle_triplet ();
39 bool step_edit_within_chord () const;
40 void step_edit_toggle_chord ();
41 void reset_step_edit_beat_pos ();
42 void resync_step_edit_to_edit_point ();
43 void move_step_edit_beat_pos (Evoral::MusicalTime beats
);
44 void set_step_edit_cursor_width (Evoral::MusicalTime beats
);
46 std::string
name() const;
48 void start_step_editing ();
49 void stop_step_editing ();
52 ARDOUR::framepos_t step_edit_insert_position
;
53 Evoral::MusicalTime step_edit_beat_pos
;
54 boost::shared_ptr
<ARDOUR::MidiRegion
> step_edit_region
;
55 MidiRegionView
* step_edit_region_view
;
56 uint8_t _step_edit_triplet_countdown
;
57 bool _step_edit_within_chord
;
58 Evoral::MusicalTime _step_edit_chord_duration
;
59 PBD::ScopedConnection step_edit_region_connection
;
60 PublicEditor
& _editor
;
61 boost::shared_ptr
<ARDOUR::MidiTrack
> _track
;
62 StepEntry
* step_editor
;
63 MidiTimeAxisView
& _mtv
;
64 int8_t last_added_pitch
;
65 Evoral::MusicalTime last_added_end
;
67 void region_removed (boost::weak_ptr
<ARDOUR::Region
>);
68 void playlist_changed ();
69 bool step_editor_hidden (GdkEventAny
*);
70 void step_editor_hide ();
71 void resync_step_edit_position ();
72 void prepare_step_edit_region ();
75 #endif /* __pbd__step_editor_h__ */