mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Merge with 2.0-ongoing R2943.
git-svn-id: svn://localhost/ardour2/branches/3.0@2944 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4ca1fe7993
commit
7295d8e9f6
26 changed files with 410 additions and 157 deletions
|
|
@ -273,6 +273,8 @@ if env['VST']:
|
|||
|
||||
if env['LV2']:
|
||||
gtkardour.Append (CCFLAGS="-DHAVE_SLV2")
|
||||
gtkardour.Merge ([libraries['slv2']])
|
||||
|
||||
|
||||
if gtkardour['GTKOSX']:
|
||||
extra_sources += gtkosx_files
|
||||
|
|
|
|||
|
|
@ -2,4 +2,5 @@
|
|||
dir=`dirname "$0"`
|
||||
. $dir/ardev_common.sh
|
||||
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
|
||||
export ARDOUR_INSIDE_GDB=1
|
||||
exec gdb $EXECUTABLE "$@"
|
||||
|
|
|
|||
|
|
@ -132,6 +132,9 @@
|
|||
<menuitem action='cycle-edit-point'/>
|
||||
<menuitem action='cycle-edit-point-with-marker'/>
|
||||
<menuitem action='toggle-edit-mode'/>
|
||||
<separator/>
|
||||
<menuitem action='boost-region-gain'/>
|
||||
<menuitem action='cut-region-gain'/>
|
||||
</menu>
|
||||
</menu>
|
||||
<menu name='Select' action='Select'>
|
||||
|
|
|
|||
|
|
@ -4,10 +4,10 @@
|
|||
<Option name="ui-rc-file" value="ardour3_ui_dark.rc"/>
|
||||
</UI>
|
||||
<Canvas>
|
||||
<Option name="waveform" value="373737a7"/>
|
||||
<Option name="waveform fill" value="73737378"/>
|
||||
<Option name="waveform" value="000000d6"/>
|
||||
<Option name="waveform fill" value="0b225a78"/>
|
||||
<Option name="clipped waveform" value="ff0000e5"/>
|
||||
<Option name="region base" value="bfbfc1aa"/>
|
||||
<Option name="region base" value="b2bcd3aa"/>
|
||||
<Option name="selected region base" value="565693a6"/>
|
||||
<Option name="midi frame base" value="698f9d6d"/>
|
||||
<Option name="audio track base" value="c6d3d868"/>
|
||||
|
|
|
|||
|
|
@ -198,7 +198,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
|
|||
connection_editor = 0;
|
||||
_will_create_new_session_automatically = false;
|
||||
new_session_dialog = 0;
|
||||
loading_dialog = 0;
|
||||
add_route_dialog = 0;
|
||||
route_params = 0;
|
||||
option_editor = 0;
|
||||
|
|
@ -279,12 +278,7 @@ ARDOUR_UI::create_engine ()
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// OS X where everything is sllloooowwww
|
||||
loading_dialog->set_message (_("Starting audio engine"));
|
||||
loading_dialog->show_all ();
|
||||
flush_pending ();
|
||||
#endif
|
||||
loading_message (_("Starting audio engine"));
|
||||
|
||||
try {
|
||||
engine = new ARDOUR::AudioEngine (ARDOUR_COMMAND_LINE::jack_client_name);
|
||||
|
|
@ -623,13 +617,6 @@ Please consider the possibilities, and perhaps (re)start JACK."));
|
|||
win.run ();
|
||||
}
|
||||
|
||||
static bool
|
||||
_hide_splash (gpointer arg)
|
||||
{
|
||||
((ARDOUR_UI*)arg)->hide_splash();
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::startup ()
|
||||
{
|
||||
|
|
@ -637,10 +624,6 @@ ARDOUR_UI::startup ()
|
|||
|
||||
new_session_dialog = new NewSessionDialog();
|
||||
|
||||
// in 4 seconds, hide the splash screen
|
||||
|
||||
Glib::signal_timeout().connect (bind (sigc::ptr_fun (_hide_splash), this), 4000);
|
||||
|
||||
bool backend_audio_is_running = EngineControl::engine_running();
|
||||
XMLNode* audio_setup = Config->extra_xml ("AudioSetup");
|
||||
|
||||
|
|
@ -2113,8 +2096,6 @@ ARDOUR_UI::load_cmdline_session (const Glib::ustring& session_name, const Glib::
|
|||
/* lets just try to load it */
|
||||
|
||||
if (create_engine ()) {
|
||||
hide_splash ();
|
||||
loading_dialog->hide ();
|
||||
backend_audio_error (false, new_session_dialog);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -2218,6 +2199,19 @@ ARDOUR_UI::build_session_from_nsd (const Glib::ustring& session_path, const Glib
|
|||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::end_loading_messages ()
|
||||
{
|
||||
// hide_splash ();
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::loading_message (const std::string& msg)
|
||||
{
|
||||
show_splash ();
|
||||
splash->message (msg);
|
||||
flush_pending ();
|
||||
}
|
||||
|
||||
bool
|
||||
ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be_new)
|
||||
|
|
@ -2227,14 +2221,6 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
|
|||
Glib::ustring session_path;
|
||||
Glib::ustring template_name;
|
||||
|
||||
if (!loading_dialog) {
|
||||
loading_dialog = new MessageDialog (*new_session_dialog,
|
||||
"",
|
||||
false,
|
||||
Gtk::MESSAGE_INFO,
|
||||
Gtk::BUTTONS_NONE);
|
||||
}
|
||||
|
||||
int response = Gtk::RESPONSE_NONE;
|
||||
|
||||
if (!ARDOUR_COMMAND_LINE::session_name.empty()) {
|
||||
|
|
@ -2275,8 +2261,8 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
|
|||
do {
|
||||
new_session_dialog->set_have_engine (backend_audio_is_running);
|
||||
new_session_dialog->present ();
|
||||
end_loading_messages ();
|
||||
response = new_session_dialog->run ();
|
||||
loading_dialog->hide ();
|
||||
|
||||
_session_is_new = false;
|
||||
|
||||
|
|
@ -2308,7 +2294,6 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
|
|||
if (create_engine ()) {
|
||||
|
||||
backend_audio_error (!backend_audio_is_running, new_session_dialog);
|
||||
loading_dialog->hide ();
|
||||
flush_pending ();
|
||||
|
||||
new_session_dialog->set_existing_session (false);
|
||||
|
|
@ -2318,7 +2303,6 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
|
|||
goto try_again;
|
||||
}
|
||||
|
||||
loading_dialog->hide ();
|
||||
backend_audio_is_running = true;
|
||||
|
||||
if (response == Gtk::RESPONSE_OK) {
|
||||
|
|
@ -2402,7 +2386,6 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
|
|||
|
||||
try_again:
|
||||
if (response == Gtk::RESPONSE_NONE) {
|
||||
loading_dialog->hide ();
|
||||
new_session_dialog->set_existing_session (false);
|
||||
new_session_dialog->reset ();
|
||||
}
|
||||
|
|
@ -2412,7 +2395,6 @@ ARDOUR_UI::get_session_parameters (bool backend_audio_is_running, bool should_be
|
|||
|
||||
done:
|
||||
show();
|
||||
loading_dialog->hide ();
|
||||
new_session_dialog->hide();
|
||||
new_session_dialog->reset();
|
||||
goto_editor_window ();
|
||||
|
|
@ -2462,14 +2444,7 @@ ARDOUR_UI::load_session (const Glib::ustring& path, const Glib::ustring& snap_na
|
|||
goto out;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
// OS X where everything is sllloooowwww
|
||||
if (loading_dialog) {
|
||||
loading_dialog->set_markup (_("Please wait while Ardour loads your session"));
|
||||
flush_pending ();
|
||||
}
|
||||
#endif
|
||||
|
||||
loading_message (_("Please wait while Ardour loads your session"));
|
||||
disable_screen_updates ();
|
||||
|
||||
try {
|
||||
|
|
@ -2647,6 +2622,7 @@ ARDOUR_UI::show_splash ()
|
|||
}
|
||||
|
||||
splash->show ();
|
||||
splash->queue_draw ();
|
||||
splash->get_window()->process_updates (true);
|
||||
flush_pending ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -768,7 +768,9 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
Glib::RefPtr<Gtk::TextBuffer::Tag> ptag, Glib::RefPtr<Gtk::TextBuffer::Tag> mtag, const char *msg);
|
||||
Gtk::Label status_bar_label;
|
||||
Gtk::ToggleButton error_log_button;
|
||||
Gtk::MessageDialog* loading_dialog;
|
||||
|
||||
void loading_message (const std::string& msg);
|
||||
void end_loading_messages ();
|
||||
|
||||
void platform_specific ();
|
||||
void platform_setup ();
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "public_editor.h"
|
||||
#include "mixer_ui.h"
|
||||
#include "keyboard.h"
|
||||
#include "splash.h"
|
||||
#include "route_params_ui.h"
|
||||
#include "i18n.h"
|
||||
|
||||
|
|
@ -106,9 +107,21 @@ ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
|
|||
s->restore_history ("");
|
||||
}
|
||||
|
||||
static bool
|
||||
_hide_splash (gpointer arg)
|
||||
{
|
||||
((ARDOUR_UI*)arg)->hide_splash();
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::goto_editor_window ()
|
||||
{
|
||||
if (splash && splash->is_visible()) {
|
||||
// in 2 seconds, hide the splash screen
|
||||
Glib::signal_timeout().connect (bind (sigc::ptr_fun (_hide_splash), this), 2000);
|
||||
}
|
||||
|
||||
editor->show_window ();
|
||||
editor->present ();
|
||||
flush_pending ();
|
||||
|
|
|
|||
|
|
@ -36,6 +36,10 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
|
|||
|
||||
void on_realize ();
|
||||
void on_show ();
|
||||
void on_hide ();
|
||||
bool on_map_event (GdkEventAny*);
|
||||
bool on_focus_in_event (GdkEventFocus*);
|
||||
bool on_focus_out_event (GdkEventFocus*);
|
||||
|
||||
OSStatus carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event);
|
||||
|
||||
|
|
@ -60,6 +64,7 @@ class AUPluginUI : public PlugUIBase, public Gtk::VBox
|
|||
EventHandlerRef carbon_event_handler;
|
||||
bool carbon_parented;
|
||||
bool cocoa_parented;
|
||||
bool _activating_from_app;
|
||||
|
||||
void test_view_support (bool&, bool&);
|
||||
bool test_cocoa_view_support ();
|
||||
|
|
|
|||
|
|
@ -35,10 +35,12 @@ AUPluginUI::AUPluginUI (boost::shared_ptr<PluginInsert> insert)
|
|||
bool has_carbon;
|
||||
bool has_cocoa;
|
||||
|
||||
_activating_from_app = false;
|
||||
carbon_parented = false;
|
||||
cocoa_parented = false;
|
||||
cocoa_parent = 0;
|
||||
cocoa_window = 0;
|
||||
au_view = 0;
|
||||
|
||||
test_view_support (has_carbon, has_cocoa);
|
||||
|
||||
|
|
@ -250,7 +252,7 @@ AUPluginUI::create_carbon_view (bool generic)
|
|||
kWindowNoShadowAttribute|
|
||||
kWindowNoTitleBarAttribute);
|
||||
|
||||
if ((err = CreateNewWindow(kDocumentWindowClass, attr, &r, &carbon_window)) != noErr) {
|
||||
if ((err = CreateNewWindow(kFloatingWindowClass, attr, &r, &carbon_window)) != noErr) {
|
||||
error << string_compose (_("AUPluginUI: cannot create carbon window (err: %1)"), err) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -314,7 +316,10 @@ AUPluginUI::activate ()
|
|||
|
||||
if (carbon_parented) {
|
||||
[cocoa_parent makeKeyAndOrderFront:nil];
|
||||
cerr << "APP activated, activate carbon window\n";
|
||||
_activating_from_app = true;
|
||||
ActivateWindow (carbon_window, TRUE);
|
||||
_activating_from_app = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -338,17 +343,26 @@ AUPluginUI::carbon_event (EventHandlerCallRef nextHandlerRef, EventRef event)
|
|||
ClickActivationResult howToHandleClick;
|
||||
NSWindow* win = get_nswindow ();
|
||||
|
||||
cerr << "window " << win << " carbon event type " << eventKind << endl;
|
||||
|
||||
switch (eventKind) {
|
||||
case kEventWindowHandleActivate:
|
||||
cerr << "carbon window activated\n";
|
||||
if (_activating_from_app) {
|
||||
cerr << "app activation, ignore window activation\n";
|
||||
return noErr;
|
||||
}
|
||||
[win makeMainWindow];
|
||||
return eventNotHandledErr;
|
||||
break;
|
||||
|
||||
case kEventWindowHandleDeactivate:
|
||||
cerr << "carbon window deactivated\n";
|
||||
return eventNotHandledErr;
|
||||
break;
|
||||
|
||||
case kEventWindowGetClickActivation:
|
||||
cerr << "carbon window CLICK activated\n";
|
||||
howToHandleClick = kActivateAndHandleClick;
|
||||
SetEventParameter(event, kEventParamClickActivation, typeClickActivationResult,
|
||||
sizeof(ClickActivationResult), &howToHandleClick);
|
||||
|
|
@ -470,13 +484,27 @@ AUPluginUI::parent_cocoa_window ()
|
|||
newContentSize.width += (newFrame.size.width - currentFrame.size.width);
|
||||
newContentSize.height += (newFrame.size.height - currentFrame.size.height);
|
||||
|
||||
#ifdef PACK_COCOA_INTO_GTK_WINDOW
|
||||
NSView* view = [win contentView];
|
||||
|
||||
[win setContentSize:newContentSize];
|
||||
[view addSubview:scroll_view];
|
||||
#else
|
||||
[cocoa_window setContentSize:newContentSize];
|
||||
[cocoa_window setContentView:scroll_view];
|
||||
#endif
|
||||
|
||||
} else {
|
||||
|
||||
#ifdef PACK_COCOA_INTO_GTK_WINDOW
|
||||
NSView* view = [win contentView];
|
||||
|
||||
[win setContentSize:au_view_frame.size];
|
||||
[view addSubview:au_view];
|
||||
#else
|
||||
[cocoa_window setContentSize:au_view_frame.size];
|
||||
[cocoa_window setContentView:au_view];
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -497,16 +525,16 @@ AUPluginUI::parent_cocoa_window ()
|
|||
[cocoa_window setFrame:view_frame display:NO];
|
||||
|
||||
/* make top level window big enough to hold cocoa window and titlebar */
|
||||
|
||||
|
||||
content_frame.size.width = view_frame.size.width;
|
||||
content_frame.size.height = view_frame.size.height + titlebar_height;
|
||||
|
||||
[win setFrame:content_frame display:NO];
|
||||
|
||||
/* now make cocoa window a child of this top level */
|
||||
|
||||
|
||||
[win addChildWindow:cocoa_window ordered:NSWindowAbove];
|
||||
// [win setLevel:NSFloatingWindowLevel];
|
||||
[win setLevel:NSFloatingWindowLevel];
|
||||
[win setHidesOnDeactivate:YES];
|
||||
|
||||
cocoa_parented = true;
|
||||
|
|
@ -519,7 +547,7 @@ AUPluginUI::on_realize ()
|
|||
{
|
||||
VBox::on_realize ();
|
||||
|
||||
if (cocoa_window) {
|
||||
if (au_view) {
|
||||
|
||||
if (parent_cocoa_window ()) {
|
||||
}
|
||||
|
|
@ -532,6 +560,27 @@ AUPluginUI::on_realize ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
AUPluginUI::on_hide ()
|
||||
{
|
||||
// VBox::on_hide ();
|
||||
cerr << "AU plugin window hidden\n";
|
||||
}
|
||||
|
||||
bool
|
||||
AUPluginUI::on_map_event (GdkEventAny* ev)
|
||||
{
|
||||
cerr << "AU plugin map event\n";
|
||||
|
||||
if (au_view) {
|
||||
show_all ();
|
||||
} else if (carbon_window) {
|
||||
[cocoa_parent setIsVisible:YES];
|
||||
ShowWindow (carbon_window);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
AUPluginUI::on_show ()
|
||||
{
|
||||
|
|
@ -539,10 +588,11 @@ AUPluginUI::on_show ()
|
|||
|
||||
VBox::on_show ();
|
||||
|
||||
if (cocoa_window) {
|
||||
[cocoa_window setIsVisible:YES];
|
||||
if (au_view) {
|
||||
show_all ();
|
||||
} else if (carbon_window) {
|
||||
[cocoa_parent setIsVisible:YES];
|
||||
ShowWindow (carbon_window);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -565,3 +615,17 @@ create_au_gui (boost::shared_ptr<PluginInsert> plugin_insert, VBox** box)
|
|||
(*box) = aup;
|
||||
return aup;
|
||||
}
|
||||
|
||||
bool
|
||||
AUPluginUI::on_focus_in_event (GdkEventFocus* ev)
|
||||
{
|
||||
cerr << "au plugin focus in\n";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
AUPluginUI::on_focus_out_event (GdkEventFocus* ev)
|
||||
{
|
||||
cerr << "au plugin focus out\n";
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1048,6 +1048,7 @@ class Editor : public PublicEditor
|
|||
void reverse_region ();
|
||||
void normalize_region ();
|
||||
void denormalize_region ();
|
||||
void adjust_region_scale_amplitude (bool up);
|
||||
void quantize_region ();
|
||||
|
||||
void audition_region_from_region_list ();
|
||||
|
|
|
|||
|
|
@ -356,8 +356,13 @@ Editor::register_actions ()
|
|||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, "normalize-region", _("Normalize Region"), mem_fun(*this, &Editor::normalize_region));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, "boost-region-gain", _("Boost Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), true));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, "cut-region-gain", _("Cut Region Gain"), bind (mem_fun(*this, &Editor::adjust_region_scale_amplitude), false));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, "quantize-region", _("Quantize Region"), mem_fun(*this, &Editor::quantize_region));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_action (editor_actions, "crop", _("Crop"), mem_fun(*this, &Editor::crop_region_to_selection));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, "insert-chunk", _("Insert Chunk"), bind (mem_fun(*this, &Editor::paste_named_selection), 1.0f));
|
||||
|
|
|
|||
|
|
@ -173,7 +173,10 @@ Editor::set_selected_mixer_strip (TimeAxisView& view)
|
|||
current_mixer_strip = 0;
|
||||
}
|
||||
|
||||
cms_new (rt->route ());
|
||||
current_mixer_strip = new MixerStrip (*ARDOUR_UI::instance()->the_mixer(),
|
||||
*session,
|
||||
rt->route(), false);
|
||||
current_mixer_strip->GoingAway.connect (mem_fun(*this, &Editor::cms_deleted));
|
||||
|
||||
if (show) {
|
||||
show_editor_mixer (true);
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
#include <ardour/region_factory.h>
|
||||
#include <ardour/playlist_factory.h>
|
||||
#include <ardour/reverse.h>
|
||||
#include <ardour/dB.h>
|
||||
#include <ardour/quantize.h>
|
||||
|
||||
#include "ardour_ui.h"
|
||||
|
|
@ -66,6 +67,7 @@
|
|||
#include "gtk-custom-hruler.h"
|
||||
#include "gui_thread.h"
|
||||
#include "keyboard.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
|
@ -4119,6 +4121,8 @@ Editor::denormalize_region ()
|
|||
return;
|
||||
}
|
||||
|
||||
ExclusiveRegionSelection (*this, entered_regionview);
|
||||
|
||||
if (selection->regions.empty()) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -4137,6 +4141,62 @@ Editor::denormalize_region ()
|
|||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
void
|
||||
Editor::adjust_region_scale_amplitude (bool up)
|
||||
{
|
||||
if (!session) {
|
||||
return;
|
||||
}
|
||||
|
||||
ExclusiveRegionSelection (*this, entered_regionview);
|
||||
|
||||
if (selection->regions.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
begin_reversible_command ("denormalize");
|
||||
|
||||
for (RegionSelection::iterator r = selection->regions.begin(); r != selection->regions.end(); ++r) {
|
||||
AudioRegionView* const arv = dynamic_cast<AudioRegionView*>(*r);
|
||||
if (!arv)
|
||||
continue;
|
||||
XMLNode &before = arv->region()->get_state();
|
||||
|
||||
double fraction = gain_to_slider_position (arv->audio_region()->scale_amplitude ());
|
||||
|
||||
cerr << "slider pos for " << arv->audio_region()->scale_amplitude ()
|
||||
<< " = " << fraction
|
||||
<< endl;
|
||||
|
||||
if (up) {
|
||||
fraction += 0.05;
|
||||
fraction = min (fraction, 1.0);
|
||||
} else {
|
||||
fraction -= 0.05;
|
||||
fraction = max (fraction, 0.0);
|
||||
}
|
||||
|
||||
if (!up && fraction <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (up && fraction >= 1.0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
fraction = slider_position_to_gain (fraction);
|
||||
fraction = coefficient_to_dB (fraction);
|
||||
fraction = dB_to_coefficient (fraction);
|
||||
|
||||
cerr << "set scale amp for " << arv->audio_region()->name() << " to " << fraction << endl;
|
||||
|
||||
arv->audio_region()->set_scale_amplitude (fraction);
|
||||
session->add_command (new MementoCommand<Region>(*(arv->region().get()), &before, &arv->region()->get_state()));
|
||||
}
|
||||
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Editor::reverse_region ()
|
||||
|
|
|
|||
|
|
@ -67,6 +67,9 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr<PluginInsert> insert, nframes6
|
|||
bool have_gui = false;
|
||||
non_gtk_gui = false;
|
||||
|
||||
Label* label = manage (new Label());
|
||||
label->set_markup ("<b>THIS IS THE PLUGIN UI</b>");
|
||||
|
||||
if (insert->plugin()->has_editor()) {
|
||||
switch (insert->type()) {
|
||||
case ARDOUR::VST:
|
||||
|
|
@ -74,7 +77,10 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr<PluginInsert> insert, nframes6
|
|||
break;
|
||||
|
||||
case ARDOUR::AudioUnit:
|
||||
have_gui = create_audiounit_editor (insert);
|
||||
//have_gui = create_audiounit_editor (insert);
|
||||
have_gui = true;
|
||||
get_vbox()->pack_start (*label, false, false);
|
||||
cerr << "#*#*#*#*#*#*#*#*## PACK " << label << " INTO PLUGIN UI\n";
|
||||
break;
|
||||
|
||||
case ARDOUR::LADSPA:
|
||||
|
|
@ -82,8 +88,13 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr<PluginInsert> insert, nframes6
|
|||
break;
|
||||
|
||||
default:
|
||||
#ifndef VST_SUPPORT
|
||||
error << _("unknown type of editor-supplying plugin (note: no VST support in this version of ardour)")
|
||||
<< endmsg;
|
||||
#else
|
||||
error << _("unknown type of editor-supplying plugin")
|
||||
<< endmsg;
|
||||
#endif
|
||||
throw failed_constructor ();
|
||||
}
|
||||
|
||||
|
|
@ -106,9 +117,10 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr<PluginInsert> insert, nframes6
|
|||
set_name ("PluginEditor");
|
||||
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
|
||||
|
||||
signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)));
|
||||
signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)), false);
|
||||
insert->GoingAway.connect (mem_fun(*this, &PluginUIWindow::plugin_going_away));
|
||||
|
||||
#if 0
|
||||
gint h = _pluginui->get_preferred_height ();
|
||||
gint w = _pluginui->get_preferred_width ();
|
||||
|
||||
|
|
@ -122,12 +134,37 @@ PluginUIWindow::PluginUIWindow (boost::shared_ptr<PluginInsert> insert, nframes6
|
|||
}
|
||||
|
||||
set_default_size (w, h);
|
||||
#endif
|
||||
}
|
||||
|
||||
PluginUIWindow::~PluginUIWindow ()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
PluginUIWindow::on_show ()
|
||||
{
|
||||
cerr << "PluginWindow shown\n";
|
||||
|
||||
ArdourDialog::on_show ();
|
||||
Glib::ListHandle<Widget*> kids (get_vbox()->get_children());
|
||||
|
||||
cerr << "send show to " << kids.size() << " children of this plugin UI\n";
|
||||
|
||||
for (Glib::ListHandle<Widget*>::iterator x = kids.begin(); x != kids.end(); ++x) {
|
||||
cerr << "\tSend show to " << (*x) << endl;
|
||||
(*x)->show ();
|
||||
}
|
||||
cerr << "!! send done\n";
|
||||
}
|
||||
|
||||
void
|
||||
PluginUIWindow::on_hide ()
|
||||
{
|
||||
cerr << "PluginWindow hidden\n";
|
||||
ArdourDialog::on_hide ();
|
||||
}
|
||||
|
||||
bool
|
||||
PluginUIWindow::create_vst_editor(boost::shared_ptr<PluginInsert> insert)
|
||||
{
|
||||
|
|
@ -162,6 +199,7 @@ PluginUIWindow::create_audiounit_editor (boost::shared_ptr<PluginInsert> insert)
|
|||
#else
|
||||
VBox* box;
|
||||
_pluginui = create_au_gui (insert, &box);
|
||||
cerr << "#*#*#*#*#*#*#*#*## PACK " << box << " INTO PLUGIN UI\n";
|
||||
get_vbox()->add (*box);
|
||||
non_gtk_gui = true;
|
||||
|
||||
|
|
@ -177,9 +215,11 @@ PluginUIWindow::app_activated (bool yn)
|
|||
{
|
||||
#if defined (HAVE_AUDIOUNITS) && defined(GTKOSX)
|
||||
if (yn) {
|
||||
_pluginui->activate ();
|
||||
if (_pluginui) {
|
||||
_pluginui->activate ();
|
||||
}
|
||||
}
|
||||
cerr << "activated ? " << yn << endl;
|
||||
cerr << "APP activated ? " << yn << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -208,7 +248,9 @@ PluginUIWindow::plugin_going_away ()
|
|||
{
|
||||
ENSURE_GUI_THREAD(mem_fun(*this, &PluginUIWindow::plugin_going_away));
|
||||
|
||||
_pluginui->stop_updating(0);
|
||||
if (_pluginui) {
|
||||
_pluginui->stop_updating(0);
|
||||
}
|
||||
delete_when_idle (this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -210,9 +210,11 @@ class PluginUIWindow : public ArdourDialog
|
|||
|
||||
void resize_preferred();
|
||||
|
||||
virtual bool on_key_press_event (GdkEventKey*);
|
||||
virtual bool on_key_release_event (GdkEventKey*);
|
||||
|
||||
bool on_key_press_event (GdkEventKey*);
|
||||
bool on_key_release_event (GdkEventKey*);
|
||||
void on_show ();
|
||||
void on_hide ();
|
||||
|
||||
private:
|
||||
PlugUIBase* _pluginui;
|
||||
bool non_gtk_gui;
|
||||
|
|
|
|||
|
|
@ -1435,7 +1435,7 @@ ProcessorBox::route_name_changed (PluginUIWindow* plugin_ui, boost::weak_ptr<Plu
|
|||
string
|
||||
ProcessorBox::generate_processor_title (boost::shared_ptr<PluginInsert> pi)
|
||||
{
|
||||
string maker = pi->plugin()->maker();
|
||||
string maker = pi->plugin()->maker() ? pi->plugin()->maker() : "";
|
||||
string::size_type email_pos;
|
||||
|
||||
if ((email_pos = maker.find_first_of ('<')) != string::npos) {
|
||||
|
|
|
|||
|
|
@ -30,25 +30,39 @@ Splash::Splash ()
|
|||
throw failed_constructor();
|
||||
}
|
||||
|
||||
set_size_request (pixbuf->get_width(), pixbuf->get_height());
|
||||
darea.set_size_request (pixbuf->get_width(), pixbuf->get_height());
|
||||
set_type_hint (Gdk::WINDOW_TYPE_HINT_SPLASHSCREEN);
|
||||
set_keep_above (true);
|
||||
set_position (WIN_POS_CENTER);
|
||||
add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
|
||||
darea.add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
|
||||
|
||||
layout = create_pango_layout ("");
|
||||
|
||||
darea.show ();
|
||||
darea.signal_expose_event().connect (mem_fun (*this, &Splash::expose));
|
||||
|
||||
add (darea);
|
||||
}
|
||||
|
||||
void
|
||||
Splash::on_realize ()
|
||||
{
|
||||
Window::on_realize ();
|
||||
layout->set_font_description (get_style()->get_font());
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
Splash::on_button_release_event (GdkEventButton* ev)
|
||||
{
|
||||
hide ();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
Splash::on_expose_event (GdkEventExpose* ev)
|
||||
Splash::expose (GdkEventExpose* ev)
|
||||
{
|
||||
RefPtr<Gdk::Window> window = get_window();
|
||||
|
||||
Window::on_expose_event (ev);
|
||||
RefPtr<Gdk::Window> window = darea.get_window();
|
||||
|
||||
window->draw_pixbuf (get_style()->get_bg_gc (STATE_NORMAL), pixbuf,
|
||||
ev->area.x, ev->area.y,
|
||||
|
|
@ -56,5 +70,22 @@ Splash::on_expose_event (GdkEventExpose* ev)
|
|||
ev->area.width, ev->area.height,
|
||||
Gdk::RGB_DITHER_NONE, 0, 0);
|
||||
|
||||
Glib::RefPtr<Gtk::Style> style = darea.get_style();
|
||||
Glib::RefPtr<Gdk::GC> white = style->get_white_gc();
|
||||
|
||||
window->draw_layout (white, 10, pixbuf->get_height() - 30, layout);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
Splash::message (const string& msg)
|
||||
{
|
||||
string str ("<b>");
|
||||
str += msg;
|
||||
str += "</b>";
|
||||
|
||||
layout->set_markup (str);
|
||||
darea.queue_draw ();
|
||||
get_window()->process_updates (true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,9 @@
|
|||
#define __ardour_gtk_splash_h__
|
||||
|
||||
#include <gtkmm/window.h>
|
||||
#include <gtkmm/drawingarea.h>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include <gdkmm/pixbuf.h>
|
||||
|
||||
class ARDOUR_UI;
|
||||
|
|
@ -31,11 +34,16 @@ class Splash : public Gtk::Window
|
|||
Splash ();
|
||||
~Splash () {}
|
||||
|
||||
bool on_expose_event (GdkEventExpose*);
|
||||
bool expose (GdkEventExpose*);
|
||||
bool on_button_release_event (GdkEventButton*);
|
||||
void on_realize ();
|
||||
|
||||
void message (const std::string& msg);
|
||||
|
||||
private:
|
||||
Glib::RefPtr<Gdk::Pixbuf> pixbuf;
|
||||
Gtk::DrawingArea darea;
|
||||
Glib::RefPtr<Pango::Layout> layout;
|
||||
};
|
||||
|
||||
#endif /* __ardour_gtk_splash_h__ */
|
||||
|
|
|
|||
|
|
@ -375,8 +375,9 @@ class IO : public Automatable, public Latent
|
|||
bool ensure_inputs_locked (ChanCount, bool clear, void *src);
|
||||
bool ensure_outputs_locked (ChanCount, bool clear, void *src);
|
||||
|
||||
int32_t find_input_port_hole ();
|
||||
int32_t find_output_port_hole ();
|
||||
std::string build_legal_port_name (DataType type, bool for_input);
|
||||
int32_t find_input_port_hole (const char* base);
|
||||
int32_t find_output_port_hole (const char* base);
|
||||
|
||||
void create_bundles_for_inputs_and_outputs ();
|
||||
void setup_bundles_for_inputs_and_outputs ();
|
||||
|
|
|
|||
|
|
@ -516,7 +516,7 @@ PluginInfoList
|
|||
AUPluginInfo::discover ()
|
||||
{
|
||||
PluginInfoList plugs;
|
||||
|
||||
|
||||
discover_fx (plugs);
|
||||
discover_music (plugs);
|
||||
|
||||
|
|
|
|||
|
|
@ -1119,9 +1119,8 @@ AudioEngine::connect_to_jack (string client_name)
|
|||
const char *server_name = NULL;
|
||||
|
||||
jack_client_name = client_name; /* might be reset below */
|
||||
|
||||
_jack = jack_client_open (jack_client_name.c_str(), options, &status, server_name);
|
||||
|
||||
|
||||
if (_jack == NULL) {
|
||||
|
||||
if (status & JackServerFailed) {
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <pbd/xml++.h>
|
||||
#include <pbd/replace_all.h>
|
||||
#include <pbd/unknown_type.h>
|
||||
|
||||
#include <ardour/audioengine.h>
|
||||
#include <ardour/io.h>
|
||||
|
|
@ -612,7 +613,6 @@ int
|
|||
IO::add_output_port (string destination, void* src, DataType type)
|
||||
{
|
||||
Port* our_port;
|
||||
char name[64];
|
||||
|
||||
if (type == DataType::NIL)
|
||||
type = _default_type;
|
||||
|
|
@ -630,15 +630,10 @@ IO::add_output_port (string destination, void* src, DataType type)
|
|||
|
||||
/* Create a new output port */
|
||||
|
||||
// FIXME: naming scheme for differently typed ports?
|
||||
if (_output_maximum.get(type) == 1) {
|
||||
snprintf (name, sizeof (name), _("%s/out"), _name.c_str());
|
||||
} else {
|
||||
snprintf (name, sizeof (name), _("%s/out %u"), _name.c_str(), find_output_port_hole());
|
||||
}
|
||||
string portname = build_legal_port_name (type, false);
|
||||
|
||||
if ((our_port = _session.engine().register_output_port (type, name, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register output port %1"), name) << endmsg;
|
||||
if ((our_port = _session.engine().register_output_port (type, portname, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register output port %1"), portname) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -723,7 +718,6 @@ int
|
|||
IO::add_input_port (string source, void* src, DataType type)
|
||||
{
|
||||
Port* our_port;
|
||||
char name[64];
|
||||
|
||||
if (type == DataType::NIL)
|
||||
type = _default_type;
|
||||
|
|
@ -740,15 +734,10 @@ IO::add_input_port (string source, void* src, DataType type)
|
|||
|
||||
/* Create a new input port */
|
||||
|
||||
// FIXME: naming scheme for differently typed ports?
|
||||
if (_input_maximum.get(type) == 1) {
|
||||
snprintf (name, sizeof (name), _("%s/in"), _name.c_str());
|
||||
} else {
|
||||
snprintf (name, sizeof (name), _("%s/in %u"), _name.c_str(), find_input_port_hole());
|
||||
}
|
||||
string portname = build_legal_port_name (type, true);
|
||||
|
||||
if ((our_port = _session.engine().register_input_port (type, name, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register input port %1"), name) << endmsg;
|
||||
if ((our_port = _session.engine().register_input_port (type, portname, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register input port %1"), portname) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -845,18 +834,12 @@ IO::ensure_inputs_locked (ChanCount count, bool clear, void* src)
|
|||
/* create any necessary new ports */
|
||||
while (n_inputs().get(*t) < n) {
|
||||
|
||||
char buf[64];
|
||||
|
||||
if (_input_maximum.get(*t) == 1) {
|
||||
snprintf (buf, sizeof (buf), _("%s/in"), _name.c_str());
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), _("%s/in %u"), _name.c_str(), find_input_port_hole());
|
||||
}
|
||||
string portname = build_legal_port_name (*t, true);
|
||||
|
||||
try {
|
||||
|
||||
if ((input_port = _session.engine().register_input_port (*t, buf, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register input port %1"), buf) << endmsg;
|
||||
if ((input_port = _session.engine().register_input_port (*t, portname, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register input port %1"), portname) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -960,19 +943,11 @@ IO::ensure_io (ChanCount in, ChanCount out, bool clear, void* src)
|
|||
|
||||
while (n_inputs().get(*t) < nin) {
|
||||
|
||||
char buf[64];
|
||||
|
||||
/* Create a new input port */
|
||||
|
||||
if (_input_maximum.get(*t) == 1) {
|
||||
snprintf (buf, sizeof (buf), _("%s/in"), _name.c_str());
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), _("%s/in %u"), _name.c_str(), find_input_port_hole());
|
||||
}
|
||||
string portname = build_legal_port_name (*t, true);
|
||||
|
||||
try {
|
||||
if ((port = _session.engine().register_input_port (*t, buf, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register input port %1"), buf) << endmsg;
|
||||
if ((port = _session.engine().register_input_port (*t, portname, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register input port %1"), portname) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -992,19 +967,11 @@ IO::ensure_io (ChanCount in, ChanCount out, bool clear, void* src)
|
|||
|
||||
while (n_outputs().get(*t) < nout) {
|
||||
|
||||
char buf[64];
|
||||
|
||||
/* Create a new output port */
|
||||
|
||||
if (_output_maximum.get(*t) == 1) {
|
||||
snprintf (buf, sizeof (buf), _("%s/out"), _name.c_str());
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), _("%s/out %u"), _name.c_str(), find_output_port_hole());
|
||||
}
|
||||
|
||||
string portname = build_legal_port_name (*t, false);
|
||||
|
||||
try {
|
||||
if ((port = _session.engine().register_output_port (*t, buf, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register output port %1"), buf) << endmsg;
|
||||
if ((port = _session.engine().register_output_port (*t, portname, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register output port %1"), portname) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1115,16 +1082,10 @@ IO::ensure_outputs_locked (ChanCount count, bool clear, void* src)
|
|||
/* create any necessary new ports */
|
||||
while (n_outputs().get(*t) < n) {
|
||||
|
||||
char buf[64];
|
||||
string portname = build_legal_port_name (*t, false);
|
||||
|
||||
if (_output_maximum.get(*t) == 1) {
|
||||
snprintf (buf, sizeof (buf), _("%s/out"), _name.c_str());
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), _("%s/out %u"), _name.c_str(), find_output_port_hole());
|
||||
}
|
||||
|
||||
if ((output_port = _session.engine().register_output_port (*t, buf, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register output port %1"), buf) << endmsg;
|
||||
if ((output_port = _session.engine().register_output_port (*t, portname, _public_ports)) == 0) {
|
||||
error << string_compose(_("IO: cannot register output port %1"), portname) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -2290,8 +2251,62 @@ IO::transport_stopped (nframes_t frame)
|
|||
_panner->transport_stopped (frame);
|
||||
}
|
||||
|
||||
string
|
||||
IO::build_legal_port_name (DataType type, bool in)
|
||||
{
|
||||
const int name_size = jack_port_name_size();
|
||||
int limit;
|
||||
string suffix;
|
||||
int maxports;
|
||||
|
||||
if (type == DataType::AUDIO) {
|
||||
suffix = _("audio");
|
||||
} else if (type == DataType::MIDI) {
|
||||
suffix = _("midi");
|
||||
} else {
|
||||
throw unknown_type();
|
||||
}
|
||||
|
||||
if (in) {
|
||||
suffix += _("_in");
|
||||
maxports = _input_maximum.get(type);
|
||||
} else {
|
||||
suffix += _("_out");
|
||||
maxports = _output_maximum.get(type);
|
||||
}
|
||||
|
||||
if (maxports == 1) {
|
||||
// allow space for the slash + the suffix
|
||||
limit = name_size - _session.engine().client_name().length() - (suffix.length() + 1);
|
||||
char buf[name_size+1];
|
||||
snprintf (buf, name_size+1, ("%.*s/%s"), limit, _name.c_str(), suffix.c_str());
|
||||
return string (buf);
|
||||
}
|
||||
|
||||
// allow up to 4 digits for the output port number, plus the slash, suffix and extra space
|
||||
|
||||
limit = name_size - _session.engine().client_name().length() - (suffix.length() + 5);
|
||||
|
||||
char buf1[name_size+1];
|
||||
char buf2[name_size+1];
|
||||
|
||||
snprintf (buf1, name_size+1, ("%.*s/%s"), limit, _name.c_str(), suffix.c_str());
|
||||
|
||||
int port_number;
|
||||
|
||||
if (in) {
|
||||
port_number = find_input_port_hole (buf1);
|
||||
} else {
|
||||
port_number = find_output_port_hole (buf1);
|
||||
}
|
||||
|
||||
snprintf (buf2, name_size+1, "%s %d", buf1, port_number);
|
||||
|
||||
return string (buf2);
|
||||
}
|
||||
|
||||
int32_t
|
||||
IO::find_input_port_hole ()
|
||||
IO::find_input_port_hole (const char* base)
|
||||
{
|
||||
/* CALLER MUST HOLD IO LOCK */
|
||||
|
||||
|
|
@ -2301,11 +2316,14 @@ IO::find_input_port_hole ()
|
|||
return 1;
|
||||
}
|
||||
|
||||
for (n = 1; n < UINT_MAX; ++n) {
|
||||
/* we only allow up to 4 characters for the port number
|
||||
*/
|
||||
|
||||
for (n = 1; n < 9999; ++n) {
|
||||
char buf[jack_port_name_size()];
|
||||
PortSet::iterator i = _inputs.begin();
|
||||
|
||||
snprintf (buf, jack_port_name_size(), _("%s/in %u"), _name.c_str(), n);
|
||||
snprintf (buf, jack_port_name_size(), _("%s %u"), base, n);
|
||||
|
||||
for ( ; i != _inputs.end(); ++i) {
|
||||
if (i->short_name() == buf) {
|
||||
|
|
@ -2321,7 +2339,7 @@ IO::find_input_port_hole ()
|
|||
}
|
||||
|
||||
int32_t
|
||||
IO::find_output_port_hole ()
|
||||
IO::find_output_port_hole (const char* base)
|
||||
{
|
||||
/* CALLER MUST HOLD IO LOCK */
|
||||
|
||||
|
|
@ -2331,11 +2349,14 @@ IO::find_output_port_hole ()
|
|||
return 1;
|
||||
}
|
||||
|
||||
for (n = 1; n < UINT_MAX; ++n) {
|
||||
/* we only allow up to 4 characters for the port number
|
||||
*/
|
||||
|
||||
for (n = 1; n < 9999; ++n) {
|
||||
char buf[jack_port_name_size()];
|
||||
PortSet::iterator i = _outputs.begin();
|
||||
|
||||
snprintf (buf, jack_port_name_size(), _("%s/out %u"), _name.c_str(), n);
|
||||
snprintf (buf, jack_port_name_size(), _("%s %u"), base, n);
|
||||
|
||||
for ( ; i != _outputs.end(); ++i) {
|
||||
if (i->short_name() == buf) {
|
||||
|
|
|
|||
|
|
@ -74,9 +74,12 @@ RBEffect::run (boost::shared_ptr<AudioRegion> region)
|
|||
nframes_t pos = 0;
|
||||
int avail = 0;
|
||||
|
||||
double this_time_fraction = tsr.time_fraction * region->stretch ();
|
||||
double this_pitch_fraction = tsr.pitch_fraction * region->shift ();
|
||||
|
||||
RubberBandStretcher stretcher (session.frame_rate(), region->n_channels(),
|
||||
(RubberBandStretcher::Options) tsr.opts,
|
||||
tsr.time_fraction, tsr.pitch_fraction);
|
||||
this_time_fraction, this_pitch_fraction);
|
||||
|
||||
stretcher.setExpectedInputDuration(region->length());
|
||||
stretcher.setDebugLevel(1);
|
||||
|
|
@ -91,14 +94,14 @@ RBEffect::run (boost::shared_ptr<AudioRegion> region)
|
|||
digits just to disambiguate close but not identical FX
|
||||
*/
|
||||
|
||||
if (tsr.time_fraction == 1.0) {
|
||||
snprintf (suffix, sizeof (suffix), "@%d", (int) floor (tsr.pitch_fraction * 100.0f));
|
||||
} else if (tsr.pitch_fraction == 1.0) {
|
||||
snprintf (suffix, sizeof (suffix), "@%d", (int) floor (tsr.time_fraction * 100.0f));
|
||||
if (this_time_fraction == 1.0) {
|
||||
snprintf (suffix, sizeof (suffix), "@%d", (int) floor (this_pitch_fraction * 100.0f));
|
||||
} else if (this_pitch_fraction == 1.0) {
|
||||
snprintf (suffix, sizeof (suffix), "@%d", (int) floor (this_time_fraction * 100.0f));
|
||||
} else {
|
||||
snprintf (suffix, sizeof (suffix), "@%d-%d",
|
||||
(int) floor (tsr.time_fraction * 100.0f),
|
||||
(int) floor (tsr.pitch_fraction * 100.0f));
|
||||
(int) floor (this_time_fraction * 100.0f),
|
||||
(int) floor (this_pitch_fraction * 100.0f));
|
||||
}
|
||||
|
||||
/* create new sources */
|
||||
|
|
@ -259,9 +262,8 @@ RBEffect::run (boost::shared_ptr<AudioRegion> region)
|
|||
nframes_t start;
|
||||
nframes_t length;
|
||||
|
||||
// note: tsr.time_fraction is a percentage of original length. 100 = no change,
|
||||
// 50 is half as long, 200 is twice as long, etc.
|
||||
|
||||
// note: this_time_fraction is a ratio of original length. 1.0 = no change,
|
||||
// 0.5 is half as long, 2.0 is twice as long, etc.
|
||||
|
||||
float stretch = (*x)->stretch() * (tsr.time_fraction/100.0);
|
||||
float shift = (*x)->shift() * tsr.pitch_fraction;
|
||||
|
|
|
|||
|
|
@ -32,13 +32,19 @@ using namespace std;
|
|||
using namespace PBD;
|
||||
|
||||
BindingProxy::BindingProxy (Controllable& c)
|
||||
: prompter (Gtk::WIN_POS_MOUSE, 30000, false),
|
||||
: prompter (0),
|
||||
controllable (c),
|
||||
bind_button (2),
|
||||
bind_statemask (Gdk::CONTROL_MASK)
|
||||
|
||||
{
|
||||
prompter.signal_unmap_event().connect (mem_fun (*this, &BindingProxy::prompter_hiding));
|
||||
}
|
||||
|
||||
BindingProxy::~BindingProxy ()
|
||||
{
|
||||
if (prompter) {
|
||||
delete prompter;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -61,8 +67,12 @@ BindingProxy::button_press_handler (GdkEventButton *ev)
|
|||
if ((ev->state & bind_statemask) && ev->button == bind_button) {
|
||||
if (Controllable::StartLearning (&controllable)) {
|
||||
string prompt = _("operate controller now");
|
||||
prompter.set_text (prompt);
|
||||
prompter.touch (); // shows popup
|
||||
if (prompter == 0) {
|
||||
prompter = new PopUp (Gtk::WIN_POS_MOUSE, 30000, false);
|
||||
prompter->signal_unmap_event().connect (mem_fun (*this, &BindingProxy::prompter_hiding));
|
||||
}
|
||||
prompter->set_text (prompt);
|
||||
prompter->touch (); // shows popup
|
||||
learning_connection = controllable.LearningFinished.connect (mem_fun (*this, &BindingProxy::learning_finished));
|
||||
}
|
||||
return true;
|
||||
|
|
@ -75,7 +85,9 @@ void
|
|||
BindingProxy::learning_finished ()
|
||||
{
|
||||
learning_connection.disconnect ();
|
||||
prompter.touch (); // hides popup
|
||||
if (prompter) {
|
||||
prompter->touch (); // hides popup
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class BindingProxy : public sigc::trackable
|
|||
{
|
||||
public:
|
||||
BindingProxy (PBD::Controllable&);
|
||||
virtual ~BindingProxy() {}
|
||||
virtual ~BindingProxy();
|
||||
|
||||
void set_bind_button_state (guint button, guint statemask);
|
||||
void get_bind_button_state (guint &button, guint &statemask);
|
||||
|
|
@ -42,7 +42,7 @@ class BindingProxy : public sigc::trackable
|
|||
|
||||
protected:
|
||||
|
||||
Gtkmm2ext::PopUp prompter;
|
||||
Gtkmm2ext::PopUp* prompter;
|
||||
PBD::Controllable& controllable;
|
||||
guint bind_button;
|
||||
guint bind_statemask;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/sh
|
||||
export ARDOUR_PATH=../gtk2_ardour/icons:../gtk2_ardour/pixmaps:../gtk2_ardour
|
||||
export LD_LIBRARY_PATH=../gtk2_ardour:../libs/surfaces/control_protocol:../libs/ardour:../libs/midi++2:../libs/pbd:../libs/soundtouch:../libs/gtkmm2ext:../libs/sigc++2:../libs/glibmm2:../libs/gtkmm2/atk:../libs/gtkmm2/pango:../libs/gtkmm2/gdk:../libs/gtkmm2/gtk:../libs/libgnomecanvasmm:../libs/libsndfile:../libs/appleutility:$LD_LIBRARY_PATH
|
||||
export LD_LIBRARY_PATH=../gtk2_ardour:../libs/surfaces/control_protocol:../libs/ardour:../libs/midi++2:../libs/pbd:../libs/soundtouch:../libs/gtkmm2ext:../libs/sigc++2:../libs/glibmm2:../libs/gtkmm2/atk:../libs/gtkmm2/pango:../libs/gtkmm2/gdk:../libs/gtkmm2/gtk:../libs/libgnomecanvasmm:../libs/libsndfile:../libs/appleutility:../libs/rubberband:../libs/vamp-sdk:$LD_LIBRARY_PATH
|
||||
export GTK_PATH=$PWD/../libs/clearlooks:~/.ardour2
|
||||
exec wine ./ardour_vst.exe.so "$@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue