13
0

Merge branch 'ardour'

This commit is contained in:
Robin Gareus 2024-06-11 22:38:31 +02:00
commit 89a738d3a7
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
8 changed files with 93 additions and 5 deletions

View File

@ -152,6 +152,7 @@ ARDOUR_UI::start_session_load (bool create_new)
SessionDialog* session_dialog = new SessionDialog (create_new ? SessionDialog::New : SessionDialog::Recent, string(), Config->get_default_session_parent_dir(), string(), true);
session_dialog->signal_response().connect (sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::session_dialog_response_handler), session_dialog));
session_dialog->set_position (WIN_POS_CENTER);
session_dialog->present ();
}

View File

@ -174,6 +174,15 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session* sess, std::shared_ptr<Route> rt,
{
init ();
set_route (rt);
if (is_master () && !_route->comment().empty () && _session->config.get_show_master_bus_comment_on_load () && self_destruct) {
open_comment_editor ();
_comment_window->hide ();
_comment_window->set_position (Gtk::WIN_POS_CENTER_ON_PARENT);
_comment_window->present ();
/* show only once */
_session->config.set_show_master_bus_comment_on_load (false);
}
}
void

View File

@ -76,6 +76,7 @@
#include "keyboard.h"
#include "mixer_strip.h"
#include "mixer_ui.h"
#include "option_editor.h"
#include "opts.h"
#include "patch_change_widget.h"
#include "playlist_selector.h"
@ -127,9 +128,9 @@ RouteUI::RouteUI (ARDOUR::Session* sess)
, solo_menu(0)
, sends_menu(0)
, playlist_action_menu (0)
, _comment_window(0)
, _playlist_selector(0)
, _record_menu(0)
, _comment_window(0)
, _comment_area(0)
, _invert_menu(0)
{
@ -1784,10 +1785,15 @@ RouteUI::open_comment_editor ()
void
RouteUI::setup_comment_editor ()
{
const float scale = std::max(1.f, UIConfiguration::instance().get_ui_scale());
_comment_window = new ArdourWindow (""); // title will be reset to show route
_comment_window->set_skip_taskbar_hint (true);
_comment_window->signal_hide().connect (sigc::mem_fun(*this, &MixerStrip::comment_editor_done_editing));
_comment_window->set_default_size (400, 200);
_comment_window->set_default_size (400 * scale, 200 * scale);
VBox* vbox = manage (new VBox ());
vbox->show ();
_comment_area = manage (new TextView());
_comment_area->set_name ("MixerTrackCommentArea");
@ -1796,7 +1802,23 @@ RouteUI::setup_comment_editor ()
_comment_area->get_buffer()->set_text (_route->comment());
_comment_area->show ();
_comment_window->add (*_comment_area);
vbox->pack_start (*_comment_area);
if (is_master ()) {
BoolOption* bo = new BoolOption (
"show-master-bus-comment-on-load",
_("Show this comment on next session load"),
sigc::mem_fun (_session->config, &SessionConfiguration::get_show_master_bus_comment_on_load),
sigc::mem_fun (_session->config, &SessionConfiguration::set_show_master_bus_comment_on_load)
);
vbox->pack_start (bo->tip_widget (), false, false, 4);
bo->tip_widget ().show_all ();
bo->parameter_changed ("show-master-bus-comment-on-load");
vbox->signal_unrealize().connect ([bo]() { delete bo; });
_session->config.ParameterChanged.connect (*this, invalidator (*this), boost::bind (&BoolOption::parameter_changed, bo, _1), gui_context());
}
_comment_window->add (*vbox);
}
void

View File

@ -268,6 +268,8 @@ protected:
ARDOUR::SoloMuteRelease* _solo_release;
ARDOUR::SoloMuteRelease* _mute_release;
ArdourWindow* _comment_window;
private:
void invert_menu_toggled (uint32_t);
bool invert_press (GdkEventButton*);
@ -322,7 +324,6 @@ private:
PlaylistSelector* _playlist_selector;
Gtk::Menu* _record_menu;
ArdourWindow* _comment_window;
Gtk::TextView* _comment_area;
Gtk::CheckMenuItem* _step_edit_item;

View File

@ -451,6 +451,15 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
sigc::mem_fun (*_session_config, &SessionConfiguration::set_count_in)
));
add_option (_("Misc"), new OptionEditorHeading (_("Project Banner")));
add_option (_("Misc"), new BoolOption (
"show-master-bus-comment-on-load",
_("Show master bus comment window on session load"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_master_bus_comment_on_load),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_master_bus_comment_on_load)
));
add_option (_("Misc"), new OptionEditorHeading (_("Defaults")));
Gtk::Button* btn = Gtk::manage (new Gtk::Button (_("Use these settings as defaults")));

View File

@ -106,6 +106,7 @@ CONFIG_VARIABLE (bool, show_monitor_on_meterbridge, "show-monitor-on-meterbridge
CONFIG_VARIABLE (bool, show_name_on_meterbridge, "show-name-on-meterbridge", true)
CONFIG_VARIABLE (bool, show_fader_on_meterbridge, "show-fader-on-meterbridge", false)
CONFIG_VARIABLE (uint32_t, meterbridge_label_height, "meterbridge-label-height", 0)
CONFIG_VARIABLE (bool, show_master_bus_comment_on_load, "show-master-bus-comment-on-load", false)
/* If the user changes the session default_time_domain, we also stash that in rc_config as a global preference,
where it is used to initialize the session timebase menu during new session creation

View File

@ -514,7 +514,7 @@ SurroundReturn::run (BufferSet& bufs, samplepos_t start_sample, samplepos_t end_
timepos_t end (end_sample + latency);
timepos_t next (start_sample + latency - 1);
while (!content_creation) {
while (true) {
Evoral::ControlEvent next_event (timepos_t (Temporal::AudioTime), 0.0f);
if (!p->find_next_event (next, end, next_event)) {
break;

View File

@ -0,0 +1,45 @@
ardour { ["type"] = "EditorAction", name = "Select Regions at the Playhead",
license = "MIT",
author = "Ardour Team",
description = [[Select regions under the playhead on selected track(s)]]
}
function factory (params) return function ()
local loc = Session:locations () -- all marker locations
-- get the playhead postion
local playhead = Temporal.timepos_t (Session:transport_sample ())
local sl = ArdourUI.SelectionList () -- empty selection list
-- http://manual.ardour.org/lua-scripting/class_reference/#ArdourUI:Selection
local sel = Editor:get_selection ()
-- Track/Bus Selection -- iterate over all Editor-GUI selected tracks
-- http://manual.ardour.org/lua-scripting/class_reference/#ArdourUI:TrackSelection
for r in sel.tracks:routelist ():iter () do
-- each of the items 'r' is-a
-- http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Route
local track = r:to_track () -- see if it's a track
if track:isnil () then
-- if not, skip it
goto continue
end
-- get track's playlist
-- http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Playlist
local playlist = track:playlist ()
for region in playlist:regions_at (playhead):iter () do
local rv = Editor:regionview_from_region (region)
sl:push_back (rv);
end
::continue::
end
-- set/replace current selection in the editor
Editor:set_selection (sl, ArdourUI.SelectionOp.Set);
end end