mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-05 22:34:56 +01:00
Compare commits
5 commits
7635707ac2
...
7a5591121b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a5591121b | ||
|
|
fd0e9e840e | ||
|
|
38368f4dd9 | ||
|
|
54958f1e94 | ||
|
|
36d6200631 |
11 changed files with 76 additions and 49 deletions
|
|
@ -385,10 +385,11 @@
|
|||
<separator/>
|
||||
<menuitem action='loop-region'/>
|
||||
<menuitem action='rename-region'/>
|
||||
<menuitem action='show-region-properties'/>
|
||||
<menuitem action='loudness-analyze-region'/>
|
||||
<menuitem action='spectral-analyze-region'/>
|
||||
<menu action='RegionMenuEdit'>
|
||||
<menuitem action='edit-region-dedicated-window'/>
|
||||
<separator/>
|
||||
#ifndef MIXBUS
|
||||
<menuitem action='combine-regions'/>
|
||||
<menuitem action='uncombine-regions'/>
|
||||
|
|
@ -925,8 +926,7 @@
|
|||
<separator/>
|
||||
<menuitem action='loop-region'/>
|
||||
<menuitem action='rename-region'/>
|
||||
<menuitem action='show-region-properties'/>
|
||||
<menuitem action='edit-region-pianoroll-window'/>
|
||||
<menuitem action='edit-region-dedicated-window'/>
|
||||
<menu action='RegionMenuEdit'>
|
||||
<menuitem action='combine-regions'/>
|
||||
<menuitem action='uncombine-regions'/>
|
||||
|
|
|
|||
|
|
@ -467,6 +467,10 @@ EditingContext::register_common_actions (Bindings* common_bindings, std::string
|
|||
reg_sens (_common_actions, "editor-copy", _("Copy"), sigc::mem_fun (*this, &EditingContext::copy));
|
||||
reg_sens (_common_actions, "editor-paste", _("Paste"), sigc::mem_fun (*this, &EditingContext::keyboard_paste));
|
||||
|
||||
RadioAction::Group note_mode_group;
|
||||
note_mode_actions[ARDOUR::Sustained] = ActionManager::register_radio_action (_common_actions, note_mode_group, "set-note-mode-sustained", _("Sustained"), sigc::bind (sigc::mem_fun (*this, &EditingContext::note_mode_chosen), ARDOUR::Sustained));
|
||||
note_mode_actions[ARDOUR::Percussive] = ActionManager::register_radio_action (_common_actions, note_mode_group, "set-note-mode-percussivee", _("Percussive"), sigc::bind (sigc::mem_fun (*this, &EditingContext::note_mode_chosen), ARDOUR::Percussive));
|
||||
|
||||
RadioAction::Group mouse_mode_group;
|
||||
|
||||
mouse_mode_actions[Editing::MouseObject] = ActionManager::register_radio_action (_common_actions, mouse_mode_group, "set-mouse-mode-object", _("Grab (Object Tool)"), sigc::bind (sigc::mem_fun (*this, &EditingContext::mouse_mode_chosen), Editing::MouseObject));
|
||||
|
|
|
|||
|
|
@ -297,10 +297,12 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider,
|
|||
void set_draw_length (Editing::GridType);
|
||||
void set_draw_velocity (int);
|
||||
void set_draw_channel (int);
|
||||
virtual void set_note_mode (ARDOUR::NoteMode) {}
|
||||
|
||||
Editing::GridType draw_length () const;
|
||||
int draw_velocity () const;
|
||||
int draw_channel () const;
|
||||
virtual ARDOUR::NoteMode note_mode() const { return ARDOUR::Sustained; }
|
||||
|
||||
Editing::SnapMode snap_mode () const;
|
||||
|
||||
|
|
@ -548,6 +550,7 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider,
|
|||
std::map<Editing::SnapMode, Glib::RefPtr<Gtk::RadioAction> > snap_mode_actions;
|
||||
std::map<Editing::GridType, Glib::RefPtr<Gtk::RadioAction> > draw_length_actions;
|
||||
std::map<Editing::MouseMode, Glib::RefPtr<Gtk::RadioAction> > mouse_mode_actions;
|
||||
std::map<ARDOUR::NoteMode, Glib::RefPtr<Gtk::RadioAction> > note_mode_actions;
|
||||
std::map<Editing::ZoomFocus, Glib::RefPtr<Gtk::RadioAction> > zoom_focus_actions;
|
||||
std::map<int, Glib::RefPtr<Gtk::RadioAction> > draw_velocity_actions;
|
||||
std::map<int, Glib::RefPtr<Gtk::RadioAction> > draw_channel_actions;
|
||||
|
|
@ -555,6 +558,7 @@ class EditingContext : public ARDOUR::SessionHandlePtr, public AxisViewProvider,
|
|||
void draw_channel_chosen (int);
|
||||
void draw_velocity_chosen (int);
|
||||
void draw_length_chosen (Editing::GridType);
|
||||
virtual void note_mode_chosen (ARDOUR::NoteMode) {}
|
||||
|
||||
sigc::signal<void> DrawLengthChanged;
|
||||
sigc::signal<void> DrawVelocityChanged;
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ public:
|
|||
|
||||
bool extend_selection_to_track (TimeAxisView&);
|
||||
|
||||
void edit_region_in_pianoroll_window ();
|
||||
void edit_region_in_dedicated_window ();
|
||||
void maybe_edit_region_in_bottom_pane (RegionView&);
|
||||
|
||||
void play_selection ();
|
||||
|
|
@ -1156,7 +1156,6 @@ private:
|
|||
void remove_selected_regions ();
|
||||
void remove_regions (const RegionSelection&, bool can_ripple, bool as_part_of_other_command);
|
||||
void remove_clicked_region ();
|
||||
void show_region_properties ();
|
||||
void show_midi_list_editor ();
|
||||
void rename_region ();
|
||||
void duplicate_some_regions (RegionSelection&, float times);
|
||||
|
|
|
|||
|
|
@ -1417,11 +1417,8 @@ Editor::register_region_actions ()
|
|||
/* Open the list editor dialogue for the selected regions */
|
||||
register_region_action (_region_actions, RegionActionTarget (SelectedRegions), "show-region-list-editor", _("List Editor..."), sigc::mem_fun (*this, &Editor::show_midi_list_editor));
|
||||
|
||||
/* Open the region properties dialogue for the selected regions */
|
||||
register_region_action (_region_actions, RegionActionTarget (SelectedRegions), "show-region-properties", _("Properties..."), sigc::mem_fun (*this, &Editor::show_region_properties));
|
||||
|
||||
/* Edit the region in a separate region pianoroll window */
|
||||
register_region_action (_region_actions, RegionActionTarget (SelectedRegions), "edit-region-pianoroll-window", _("Edit in separate window..."), sigc::mem_fun (*this, &Editor::edit_region_in_pianoroll_window));
|
||||
register_region_action (_region_actions, RegionActionTarget (SelectedRegions), "edit-region-dedicated-window", _("Edit in separate window..."), sigc::mem_fun (*this, &Editor::edit_region_in_dedicated_window));
|
||||
|
||||
register_region_action (_region_actions, RegionActionTarget (SelectedRegions|EnteredRegions), "play-selected-regions", _("Play Selected Regions"), sigc::mem_fun(*this, &Editor::play_selected_region));
|
||||
register_region_action (_region_actions, RegionActionTarget (SelectedRegions|EnteredRegions), "tag-selected-regions", _("Tag Selected Regions"), sigc::mem_fun(*this, &Editor::tag_selected_region));
|
||||
|
|
|
|||
|
|
@ -1346,7 +1346,7 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
|
|||
if (!_drags->active () && Keyboard::is_edit_event (&event->button)) {
|
||||
switch (item_type) {
|
||||
case RegionItem:
|
||||
show_region_properties ();
|
||||
edit_region_in_dedicated_window ();
|
||||
break;
|
||||
case TempoMarkerItem: {
|
||||
ArdourMarker* marker;
|
||||
|
|
|
|||
|
|
@ -2757,13 +2757,6 @@ Editor::lower_region_to_bottom ()
|
|||
do_layer_operation (LowerToBottom);
|
||||
}
|
||||
|
||||
/** Show the region editor for the selected regions */
|
||||
void
|
||||
Editor::show_region_properties ()
|
||||
{
|
||||
selection->foreach_regionview (&RegionView::show_region_editor);
|
||||
}
|
||||
|
||||
/** Show the midi list editor for the selected MIDI regions */
|
||||
void
|
||||
Editor::show_midi_list_editor ()
|
||||
|
|
@ -9520,9 +9513,9 @@ Editor::temporal_zoom_extents ()
|
|||
}
|
||||
|
||||
void
|
||||
Editor::edit_region_in_pianoroll_window ()
|
||||
Editor::edit_region_in_dedicated_window ()
|
||||
{
|
||||
selection->foreach_midi_regionview (&MidiRegionView::show_region_editor);
|
||||
selection->foreach_regionview (&RegionView::show_region_editor);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ Pianoroll::Pianoroll (std::string const & name, bool with_transport)
|
|||
, bg (nullptr)
|
||||
, view (nullptr)
|
||||
, bbt_metric (*this)
|
||||
, _note_mode (Sustained)
|
||||
, ignore_channel_changes (false)
|
||||
{
|
||||
autoscroll_vertical_allowed = false;
|
||||
|
|
@ -1352,7 +1351,6 @@ Pianoroll::trigger_prop_change (PBD::PropertyChange const & what_changed)
|
|||
EC_LOCAL_TEMPO_SCOPE;
|
||||
|
||||
if (what_changed.contains (Properties::region)) {
|
||||
std::cerr << "PR region changed\n";
|
||||
std::shared_ptr<MidiRegion> mr = std::dynamic_pointer_cast<MidiRegion> (ref.trigger()->the_region());
|
||||
set_region (mr);
|
||||
}
|
||||
|
|
@ -1477,6 +1475,13 @@ Pianoroll::set_region (std::shared_ptr<ARDOUR::Region> region)
|
|||
bg->display_region (*view);
|
||||
|
||||
maybe_set_from_rsu ();
|
||||
|
||||
if (r->source()->empty()) {
|
||||
std::shared_ptr<MidiTrack> mt (std::dynamic_pointer_cast<ARDOUR::MidiTrack> (_track));
|
||||
if (mt) {
|
||||
note_mode_actions[mt->note_mode()]->set_active (true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
@ -1588,6 +1593,40 @@ Pianoroll::automation_state_changed ()
|
|||
}
|
||||
}
|
||||
|
||||
ARDOUR::NoteMode
|
||||
Pianoroll::note_mode () const
|
||||
{
|
||||
return bg->note_mode();
|
||||
}
|
||||
|
||||
void
|
||||
Pianoroll::note_mode_chosen (ARDOUR::NoteMode mode)
|
||||
{
|
||||
EC_LOCAL_TEMPO_SCOPE;
|
||||
|
||||
/* this is driven by a toggle on a radio group, and so is invoked twice,
|
||||
once for the item that became inactive and once for the one that became
|
||||
active.
|
||||
*/
|
||||
|
||||
Glib::RefPtr<Gtk::RadioAction> ract = note_mode_actions[mode];
|
||||
|
||||
if (!ract->get_active()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode != bg->note_mode()) {
|
||||
bg->set_note_mode (mode);
|
||||
if (bg->note_mode() == Percussive) {
|
||||
note_mode_button.set_active_state (Gtkmm2ext::ExplicitActive);
|
||||
} else {
|
||||
note_mode_button.set_active_state (Gtkmm2ext::Off);
|
||||
}
|
||||
}
|
||||
|
||||
instant_save ();
|
||||
}
|
||||
|
||||
void
|
||||
Pianoroll::note_mode_clicked ()
|
||||
{
|
||||
|
|
@ -1595,27 +1634,11 @@ Pianoroll::note_mode_clicked ()
|
|||
|
||||
assert (bg);
|
||||
|
||||
|
||||
if (bg->note_mode() == Sustained) {
|
||||
set_note_mode (Percussive);
|
||||
note_mode_actions[Percussive]->set_active (true);
|
||||
} else {
|
||||
set_note_mode (Sustained);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Pianoroll::set_note_mode (NoteMode nm)
|
||||
{
|
||||
EC_LOCAL_TEMPO_SCOPE;
|
||||
|
||||
assert (bg);
|
||||
|
||||
if (nm != bg->note_mode()) {
|
||||
bg->set_note_mode (nm);
|
||||
if (bg->note_mode() == Percussive) {
|
||||
note_mode_button.set_active_state (Gtkmm2ext::ExplicitActive);
|
||||
} else {
|
||||
note_mode_button.set_active_state (Gtkmm2ext::Off);
|
||||
}
|
||||
note_mode_actions[Sustained]->set_active (true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2038,6 +2061,13 @@ Pianoroll::hide_count_in ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
Pianoroll::set_from_rsu (RegionUISettings& region_ui_settings)
|
||||
{
|
||||
note_mode_actions[region_ui_settings.note_mode]->set_active (true);
|
||||
CueEditor::set_from_rsu (region_ui_settings);
|
||||
}
|
||||
|
||||
void
|
||||
Pianoroll::instant_save ()
|
||||
{
|
||||
|
|
@ -2048,6 +2078,7 @@ Pianoroll::instant_save ()
|
|||
region_ui_settings.channel = draw_channel();
|
||||
region_ui_settings.note_min = bg->lowest_note ();
|
||||
region_ui_settings.note_max = bg->highest_note();
|
||||
region_ui_settings.note_mode = note_mode ();
|
||||
|
||||
CueEditor::instant_save ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,8 +100,8 @@ class Pianoroll : public CueEditor
|
|||
int visible_channel () const { return _visible_channel; }
|
||||
|
||||
void note_mode_clicked();
|
||||
ARDOUR::NoteMode note_mode() const { return _note_mode; }
|
||||
void set_note_mode (ARDOUR::NoteMode);
|
||||
ARDOUR::NoteMode note_mode() const;
|
||||
void note_mode_chosen (ARDOUR::NoteMode);
|
||||
|
||||
void set_trigger_start (Temporal::timepos_t const &);
|
||||
void set_trigger_end (Temporal::timepos_t const &);
|
||||
|
|
@ -213,7 +213,6 @@ class Pianoroll : public CueEditor
|
|||
|
||||
int _visible_channel;
|
||||
|
||||
ARDOUR::NoteMode _note_mode;
|
||||
sigc::signal<void> NoteModeChanged;
|
||||
|
||||
void automation_state_changed ();
|
||||
|
|
@ -253,4 +252,5 @@ class Pianoroll : public CueEditor
|
|||
|
||||
void instant_save ();
|
||||
void parameter_changed (std::string param);
|
||||
void set_from_rsu (RegionUISettings&);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ RegionUISettings::RegionUISettings ()
|
|||
, snap_mode (Editing::SnapMagnetic)
|
||||
, zoom_focus (ZoomFocusLeft)
|
||||
, mouse_mode (MouseContent)
|
||||
, note_mode (ARDOUR::Sustained)
|
||||
, x_origin (0)
|
||||
, recording_length (1, 0, 0)
|
||||
, width (-1)
|
||||
|
|
@ -65,6 +66,7 @@ RegionUISettings::get_state () const
|
|||
node->set_property (X_("snap-mode"), snap_mode);
|
||||
node->set_property (X_("zoom-focus"), zoom_focus);
|
||||
node->set_property (X_("mouse-mode"), mouse_mode);
|
||||
node->set_property (X_("note-mode"), note_mode);
|
||||
node->set_property (X_("x-origin"), x_origin);
|
||||
node->set_property (X_("recording_length"), recording_length);
|
||||
|
||||
|
|
@ -95,6 +97,7 @@ RegionUISettings::set_state (XMLNode const & state, int)
|
|||
state.get_property (X_("snap-mode"), snap_mode);
|
||||
state.get_property (X_("zoom-focus"), zoom_focus);
|
||||
state.get_property (X_("mouse-mode"), mouse_mode);
|
||||
state.get_property (X_("note-mode"), note_mode);
|
||||
state.get_property (X_("x-origin"), x_origin);
|
||||
state.get_property (X_("recording_length"), recording_length);
|
||||
|
||||
|
|
@ -171,15 +174,12 @@ RegionUISettingsManager::load (std::string const & xmlpath)
|
|||
}
|
||||
|
||||
if (!state_tree.read (xmlpath)) {
|
||||
std::cerr << "bad xmlpath " << xmlpath << std::endl;
|
||||
return -1;
|
||||
}
|
||||
std::cerr << "loading " << xmlpath << std::endl;
|
||||
|
||||
XMLNode const & root (*state_tree.root());
|
||||
|
||||
if (root.name() != X_("RegionUISettings")) {
|
||||
std::cerr << "bad root\n";
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -188,8 +188,6 @@ RegionUISettingsManager::load (std::string const & xmlpath)
|
|||
PBD::ID id;
|
||||
node->get_property ("id", id);
|
||||
|
||||
std::cerr << "loaded RSU for " << id << std::endl;
|
||||
|
||||
if (rsu.set_state (*node, 0) == 0) {
|
||||
insert (std::make_pair (id, rsu));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,13 +39,14 @@ struct RegionUISettings
|
|||
Editing::SnapMode snap_mode;
|
||||
Editing::ZoomFocus zoom_focus;
|
||||
Editing::MouseMode mouse_mode;
|
||||
ARDOUR::NoteMode note_mode;
|
||||
Temporal::timepos_t x_origin;
|
||||
Temporal::BBT_Offset recording_length;
|
||||
int width;
|
||||
int height;
|
||||
int x;
|
||||
int y;
|
||||
|
||||
|
||||
/* MIDI specific */
|
||||
|
||||
Editing::GridType draw_length;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue