Merge remote-tracking branch 'origin/master' into export-dialog

Fix conflicts in:
	gtk2_ardour/export_dialog.cc
	gtk2_ardour/export_dialog.h
	libs/ardour/export_handler.cc
This commit is contained in:
Colin Fletcher 2014-01-08 15:14:35 +00:00
commit 52003be369
273 changed files with 36125 additions and 68692 deletions

View File

@ -1,5 +1,5 @@
Download waf (http://code.google.com/p/waf/)
Download autowaf (http://svn.drobilla.net/autowaf)
autowaf.py is present in the tools directory of the Ardour source code.
From within the waf source tree, run:

View File

@ -56,6 +56,7 @@ AddRouteDialog::AddRouteDialog ()
, configuration_label (_("Configuration:"))
, mode_label (_("Track mode:"))
, instrument_label (_("Instrument:"))
, reasonable_synth_id(0)
{
set_name ("AddRouteDialog");
set_modal (true);
@ -82,7 +83,7 @@ AddRouteDialog::AddRouteDialog ()
build_instrument_list ();
instrument_combo.set_model (instrument_list);
instrument_combo.pack_start (instrument_list_columns.name);
instrument_combo.set_active (0);
instrument_combo.set_active (reasonable_synth_id);
instrument_combo.set_button_sensitivity (Gtk::SENSITIVITY_AUTO);
VBox* vbox = manage (new VBox);
@ -587,6 +588,7 @@ AddRouteDialog::build_instrument_list ()
row[instrument_list_columns.info_ptr] = PluginInfoPtr ();
row[instrument_list_columns.name] = _("-none-");
uint32_t n = 1;
for (PluginInfoList::const_iterator i = all_plugs.begin(); i != all_plugs.end(); ++i) {
if (manager.get_status (*i) == PluginManager::Hidden) continue;
@ -595,6 +597,10 @@ AddRouteDialog::build_instrument_list ()
row = *(instrument_list->append());
row[instrument_list_columns.name] = (*i)->name;
row[instrument_list_columns.info_ptr] = *i;
if ((*i)->unique_id == "https://community.ardour.org/node/7596") {
reasonable_synth_id = n;
}
n++;
}
}
}

View File

@ -122,6 +122,7 @@ class AddRouteDialog : public ArdourDialog
InstrumentListColumns instrument_list_columns;
void build_instrument_list ();
uint32_t reasonable_synth_id;
};
#endif /* __gtk_ardour_add_route_dialog_h__ */

View File

@ -35,10 +35,9 @@
<menuitem action='addExistingAudioFiles'/>
<!--menuitem action='importFromSession'/-->
#ifndef NOVIDEOTIMELINE
<menuitem action='OpenVideo'/>
<menuitem action='CloseVideo'/>
#endif
<menu name='Export' action='Export'>
<menuitem action='ExportAudio'/>
<menuitem action='StemExport'/>
@ -282,9 +281,7 @@
<menuitem action='snap-regions-to-grid'/>
<menuitem action='toggle-region-lock'/>
<menuitem action='toggle-region-lock-style'/>
#ifndef NOVIDEOTIMELINE
<menuitem action='toggle-region-video-lock'/>
#endif
<menuitem action='set-region-sync-position'/>
<menuitem action='remove-region-sync'/>
<menuitem action='nudge-forward'/>
@ -437,9 +434,7 @@
<menuitem action="toggle-cd-marker-ruler"/>
<menuitem action="toggle-marker-ruler"/>
<separator/>
#ifndef NOVIDEOTIMELINE
<menuitem action="toggle-video-ruler"/>
#endif
</menu>
<menu action="VideoMonitorMenu">
<menuitem action="zoom-vmon-100"/>
@ -543,10 +538,8 @@
<menuitem action="toggle-marker-ruler"/>
<menuitem action="toggle-cd-marker-ruler"/>
<menuitem action="toggle-loop-punch-ruler"/>
#ifndef NOVIDEOTIMELINE
<separator/>
<menuitem action="toggle-video-ruler"/>
#endif
</popup>
<popup name='ProcessorMenu'>
@ -642,9 +635,7 @@
<menuitem action='naturalize-region'/>
<menuitem action='toggle-region-lock'/>
<menuitem action='toggle-region-lock-style'/>
#ifndef NOVIDEOTIMELINE
<menuitem action='toggle-region-video-lock'/>
#endif
<menuitem action='snap-regions-to-grid'/>
<menuitem action='set-region-sync-position'/>
<menuitem action='remove-region-sync'/>

View File

@ -731,6 +731,19 @@ style "midi_track_base" = "default"
bg[SELECTED] = @@COLPREFIX@_bg
}
style "audio_track_fader" = "gain_fader"
{
bg[PRELIGHT] = @@COLPREFIX@_audio_track
}
style "audio_bus_fader" = "gain_fader"
{
bg[PRELIGHT] = @@COLPREFIX@_audio_bus
}
style "midi_track_fader" = "gain_fader"
{
bg[PRELIGHT] = @@COLPREFIX@_midi_track
}
style "audio_track_metrics" = "audio_track_base"
{
font_name = "@FONT_TINY@"
@ -815,7 +828,9 @@ style "plugin_slider"
bg[ACTIVE] = shade (0.6, @@COLPREFIX@_lightest)
bg[INSENSITIVE] = shade (0.6, @@COLPREFIX@_lightest)
bg[SELECTED] = shade (0.6, @@COLPREFIX@_lightest)
bg[PRELIGHT] = shade (0.6, @@COLPREFIX@_lightest)
# outer round-corner-background (pixslider does its own hover prelight)
bg[PRELIGHT] = @@COLPREFIX@_bg
# the numeric display
@ -826,6 +841,16 @@ style "plugin_slider"
text[PRELIGHT] = @@COLPREFIX@_text
}
style "processor_control_button" = "very_small_text"
{
}
style "processor_control_slider" = "plugin_slider"
{
bg[PRELIGHT] = @@COLPREFIX@_darkest
bg[NORMAL] = @@COLPREFIX@_bg
}
style "track_list_display" = "small_bold_text"
{
text[NORMAL] = @@COLPREFIX@_text

View File

@ -186,12 +186,12 @@
<Option name="processor postfader: led active" value="78cb4eff"/>
<Option name="processor postfader: text" value="aaaaa3ff"/>
<Option name="processor postfader: text active" value="eeeeecff"/>
<Option name="processor control button: fill start" value="000000ff"/>
<Option name="processor control button: fill end" value="000000ff"/>
<Option name="processor control button: fill start active" value="000000ff"/>
<Option name="processor control button: fill end active" value="000000ff"/>
<Option name="processor control button: led" value="000000ff"/>
<Option name="processor control button: led active" value="ff0000ff"/>
<Option name="processor control button: fill start" value="222222ff"/>
<Option name="processor control button: fill end" value="333333ff"/>
<Option name="processor control button: fill start active" value="444444ff"/>
<Option name="processor control button: fill end active" value="333333ff"/>
<Option name="processor control button: led" value="224400ff"/>
<Option name="processor control button: led active" value="99cc00ff"/>
<Option name="processor control button: text" value="ffffffff"/>
<Option name="processor control button: text active" value="ffffffff"/>
<Option name="monitor button: fill start" value="5f5a58ff"/>

View File

@ -186,9 +186,13 @@ widget "*AudioMidiTrackMetricsInactive" style:highest "midi_track_metrics_inacti
widget "*TimeAxisViewControlsBaseUnselected" style:highest "audio_track_base"
widget "*AudioTrackControlsBaseUnselected" style:highest "audio_track_base"
widget "*MidiTrackControlsBaseUnselected" style:highest "midi_track_base"
widget "*AudioTrackFader" style:highest "gain_fader"
widget "*MidiTrackFader" style:highest "gain_fader"
widget "*AudioBusFader" style:highest "gain_fader"
widget "*SendUIFader" style:highest "plugin_slider"
widget "*ReturnUIFader" style:highest "plugin_slider"
widget "*AudioTrackFader" style:highest "audio_track_fader"
widget "*MidiTrackFader" style:highest "midi_track_fader"
widget "*AudioBusFader" style:highest "audio_bus_fader"
widget "*BusControlsBaseUnselected" style:highest "audio_bus_base"
widget "*TrackSeparator" style:highest "track_separator"
@ -234,6 +238,8 @@ widget "*MotionControllerValue*" style:highest "small_entry"
widget "*ParameterValueDisplay" style:highest "medium_bold_entry"
widget "*PluginUIClickBox" style:highest "medium_bold_entry"
widget "*PluginUIClickBox*" style:highest "medium_bold_entry"
widget "*ProcessorControlSlider" style:highest "processor_control_slider"
widget "*processor control button" style:highest "processor_control_button"
widget "*PluginSlider" style:highest "plugin_slider"
widget "*GainFader" style:highest "plugin_slider"
widget "*MixerTrackCommentArea" style:highest "option_entry"

View File

@ -162,7 +162,7 @@ ArdourButton::set_markup (const std::string& str)
_layout = Pango::Layout::create (get_pango_context());
}
_layout->set_text (str);
_layout->set_markup (str);
queue_resize ();
}
@ -302,6 +302,9 @@ ArdourButton::render (cairo_t* cr)
}
if ( ((_elements & Text)==Text) && !_text.empty()) {
cairo_save (cr);
cairo_rectangle (cr, 2, 1, get_width()-4, get_height()-2);
cairo_clip(cr);
cairo_new_path (cr);
cairo_set_source_rgba (cr, text_r, text_g, text_b, text_a);
@ -342,7 +345,7 @@ ArdourButton::render (cairo_t* cr)
/* use old center'ed layout for follow up items - until rotation/aligment code is completed */
cairo_move_to (cr, (get_width() - _text_width)/2.0, get_height()/2.0 - _text_height/2.0);
}
cairo_restore (cr);
}
if (((_elements & Indicator)==Indicator)) {
@ -472,6 +475,7 @@ ArdourButton::on_size_request (Gtk::Requisition* req)
req->height = _text_height + ypad;
}
}
req->width += _corner_radius;
}
void

View File

@ -156,7 +156,7 @@ class ArdourButton : public CairoWidget , public Gtkmm2ext::Activatable
bool _fixed_diameter;
bool _distinct_led_click;
bool _hovering;
static bool _flat_buttons;
void setup_led_rect ();

View File

@ -101,6 +101,7 @@ typedef uint64_t microseconds_t;
#include "missing_plugin_dialog.h"
#include "mixer_ui.h"
#include "mouse_cursors.h"
#include "nsm.h"
#include "opts.h"
#include "pingback.h"
#include "processor_box.h"
@ -361,9 +362,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
(void) theme_manager.get (true);
starting.connect (sigc::mem_fun(*this, &ARDOUR_UI::startup));
stopping.connect (sigc::mem_fun(*this, &ARDOUR_UI::shutdown));
_process_thread = new ProcessThread ();
_process_thread->init ();
@ -438,7 +436,7 @@ ARDOUR_UI::engine_halted (const char* reason, bool free_reason)
msgstr = string_compose (_("The audio backend was shutdown because:\n\n%1"), reason);
} else {
msgstr = string_compose (_("\
`The audio backend has either been shutdown or it\n\
The audio backend has either been shutdown or it\n\
disconnected %1 because %1\n\
was not fast enough. Try to restart\n\
the audio backend and save the session."), PROGRAM_NAME);
@ -536,6 +534,10 @@ ARDOUR_UI::post_engine ()
ARDOUR_UI::~ARDOUR_UI ()
{
if (ui_config->dirty()) {
ui_config->save_state();
}
delete keyboard;
delete editor;
delete mixer;
@ -712,11 +714,12 @@ ARDOUR_UI::check_announcements ()
#endif
}
void
ARDOUR_UI::startup ()
int
ARDOUR_UI::starting ()
{
Application* app = Application::instance ();
char *nsm_url;
const char *nsm_url;
bool brand_new_user = ArdourStartup::required ();
app->ShouldQuit.connect (sigc::mem_fun (*this, &ARDOUR_UI::queue_finish));
app->ShouldLoad.connect (sigc::mem_fun (*this, &ARDOUR_UI::idle_load));
@ -727,9 +730,17 @@ ARDOUR_UI::startup ()
app->ready ();
nsm_url = getenv ("NSM_URL");
/* we need to create this early because it may need to set the
* audio backend end up.
*/
try {
audio_midi_setup.get (true);
} catch (...) {
return -1;
}
if (nsm_url) {
if ((nsm_url = g_getenv ("NSM_URL")) != 0) {
nsm = new NSM_Client;
if (!nsm->init (nsm_url)) {
nsm->announce (PROGRAM_NAME, ":dirty:", "ardour3");
@ -739,19 +750,33 @@ ARDOUR_UI::startup ()
for ( i = 0; i < 5000; ++i) {
nsm->check ();
usleep (i);
if (nsm->is_active())
if (nsm->is_active()) {
break;
}
}
if (i == 5000) {
error << _("NSM server did not announce itself") << endmsg;
return -1;
}
// wait for open command from nsm server
for ( i = 0; i < 5000; ++i) {
nsm->check ();
usleep (1000);
if (nsm->client_id ())
if (nsm->client_id ()) {
break;
}
}
if (i == 5000) {
error << _("NSM: no client ID provided") << endmsg;
return -1;
}
if (_session && nsm) {
_session->set_nsm_state( nsm->is_active() );
} else {
error << _("NSM: no session created") << endmsg;
return -1;
}
// nsm requires these actions disabled
@ -770,37 +795,34 @@ ARDOUR_UI::startup ()
}
}
}
else {
} else {
delete nsm;
nsm = 0;
error << _("NSM: initialization failed") << endmsg;
return -1;
}
} else {
if (ArdourStartup::required()) {
if (brand_new_user) {
ArdourStartup s;
s.present ();
main().run();
s.hide ();
switch (s.response ()) {
case Gtk::RESPONSE_REJECT:
exit (1);
default:
case Gtk::RESPONSE_OK:
break;
default:
return -1;
}
}
/* we need to create this early because it may need to set the
* audio backend end up.
*/
audio_midi_setup.get (true);
/* go get a session */
if (get_session_parameters (true, ARDOUR_COMMAND_LINE::new_session, ARDOUR_COMMAND_LINE::load_template)) {
exit (1);
const bool new_session_required = (ARDOUR_COMMAND_LINE::new_session || brand_new_user);
if (get_session_parameters (false, new_session_required, ARDOUR_COMMAND_LINE::load_template)) {
return -1;
}
}
@ -816,13 +838,7 @@ ARDOUR_UI::startup ()
_status_bar_visibility.update ();
BootMessage (string_compose (_("%1 is ready for use"), PROGRAM_NAME));
}
void
ARDOUR_UI::no_memory_warning ()
{
XMLNode node (X_("no-memory-warning"));
Config->add_instant_xml (node);
return 0;
}
void
@ -881,9 +897,6 @@ ARDOUR_UI::check_memory_locking ()
VBox* vbox = msg.get_vbox();
HBox hbox;
CheckButton cb (_("Do not show this window again"));
cb.signal_toggled().connect (sigc::mem_fun (*this, &ARDOUR_UI::no_memory_warning));
hbox.pack_start (cb, true, false);
vbox->pack_start (hbox);
cb.show();
@ -894,6 +907,11 @@ ARDOUR_UI::check_memory_locking ()
editor->ensure_float (msg);
msg.run ();
if (cb.get_active()) {
XMLNode node (X_("no-memory-warning"));
Config->add_instant_xml (node);
}
}
}
}
@ -1195,7 +1213,7 @@ ARDOUR_UI::update_cpu_load ()
should also be changed.
*/
float const c = AudioEngine::instance()->get_cpu_load ();
float const c = AudioEngine::instance()->get_dsp_load ();
snprintf (buf, sizeof (buf), _("DSP: <span foreground=\"%s\">%5.1f%%</span>"), c >= 90 ? X_("red") : X_("green"), c);
cpu_load_label.set_markup (buf);
}
@ -2172,8 +2190,13 @@ ARDOUR_UI::snapshot_session (bool switch_to_it)
prompter.set_name ("Prompter");
prompter.add_button (Gtk::Stock::SAVE, Gtk::RESPONSE_ACCEPT);
prompter.set_title (_("Take Snapshot"));
prompter.set_prompt (_("Name of new snapshot"));
if (switch_to_it) {
prompter.set_title (_("Save as..."));
prompter.set_prompt (_("New session name"));
} else {
prompter.set_title (_("Take Snapshot"));
prompter.set_prompt (_("Name of new snapshot"));
}
if (!switch_to_it) {
char timebuf[128];
@ -2594,11 +2617,14 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
} else {
session_path = "";
session_name = "";
session_dialog.clear_given ();
}
if (should_be_new || session_name.empty()) {
/* need the dialog to get info from user */
cerr << "run dialog\n";
switch (session_dialog.run()) {
case RESPONSE_ACCEPT:
break;
@ -2618,6 +2644,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
should_be_new = false;
session_name = session_dialog.session_name (likely_new);
session_path = session_dialog.session_folder ();
if (nsm) {
likely_new = true;
@ -2694,10 +2721,11 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
}
char illegal = Session::session_name_is_legal(session_name);
if (illegal) {
pop_back_splash (session_dialog);
MessageDialog msg (session_dialog, string_compose(_("To ensure compatibility with various systems\n"
"session names may not contain a '%1' character"), illegal));
"session names may not contain a '%1' character"), illegal));
msg.run ();
ARDOUR_COMMAND_LINE::session_name = ""; // cancel that
continue;
@ -2723,6 +2751,12 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
_session->save_state (ARDOUR_COMMAND_LINE::immediate_save, false);
exit (1);
}
/* clear this to avoid endless attempts to load the
same session.
*/
ARDOUR_COMMAND_LINE::session_name = "";
}
}
@ -2834,6 +2868,22 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
}
}
if (!new_session->writable()) {
MessageDialog msg (_("This session has been opened in read-only mode.\n\nYou will not be able to record or save."),
true,
Gtk::MESSAGE_INFO,
BUTTONS_OK);
msg.set_keep_above (true);
msg.set_title (_("Read-only Session"));
msg.set_position (Gtk::WIN_POS_CENTER);
pop_back_splash (msg);
msg.present ();
(void) msg.run ();
msg.hide ();
}
/* Now the session been created, add the transport controls */
new_session->add_controllable(roll_controllable);
new_session->add_controllable(stop_controllable);
@ -3190,6 +3240,57 @@ ARDOUR_UI::flush_trash ()
display_cleanup_results (rep, _("deleted file"), true);
}
void
ARDOUR_UI::setup_order_hint ()
{
uint32_t order_hint = 0;
/*
we want the new routes to have their order keys set starting from
the highest order key in the selection + 1 (if available).
*/
if (add_route_dialog->get_transient_for () == mixer->get_toplevel()) {
for (RouteUISelection::iterator s = mixer->selection().routes.begin(); s != mixer->selection().routes.end(); ++s) {
if ((*s)->route()->order_key() > order_hint) {
order_hint = (*s)->route()->order_key();
}
}
if (!mixer->selection().routes.empty()) {
order_hint++;
}
} else {
for (TrackSelection::iterator s = editor->get_selection().tracks.begin(); s != editor->get_selection().tracks.end(); ++s) {
RouteTimeAxisView* tav = dynamic_cast<RouteTimeAxisView*> (*s);
if (tav->route()->order_key() > order_hint) {
order_hint = tav->route()->order_key();
}
}
if (!editor->get_selection().tracks.empty()) {
order_hint++;
}
}
_session->set_order_hint (order_hint);
/* create a gap in the existing route order keys to accomodate new routes.*/
boost::shared_ptr <RouteList> rd = _session->get_routes();
for (RouteList::iterator ri = rd->begin(); ri != rd->end(); ++ri) {
boost::shared_ptr<Route> rt (*ri);
if (rt->is_monitor()) {
continue;
}
if (rt->order_key () >= order_hint) {
rt->set_order_key (rt->order_key () + add_route_dialog->count());
}
}
}
void
ARDOUR_UI::add_route (Gtk::Window* float_window)
{
@ -3205,6 +3306,7 @@ ARDOUR_UI::add_route (Gtk::Window* float_window)
}
if (float_window) {
add_route_dialog->unset_transient_for ();
add_route_dialog->set_transient_for (*float_window);
}
@ -3224,6 +3326,8 @@ ARDOUR_UI::add_route (Gtk::Window* float_window)
return;
}
setup_order_hint();
PBD::ScopedConnection idle_connection;
if (count > 8) {
@ -3461,7 +3565,8 @@ ARDOUR_UI::add_video (Gtk::Window* float_window)
if (!transcode_video_dialog->get_audiofile().empty()) {
editor->embed_audio_from_video(
transcode_video_dialog->get_audiofile(),
video_timeline->get_offset()
video_timeline->get_offset(),
(transcode_video_dialog->import_option() != VTL_IMPORT_NO_VIDEO)
);
}
switch (transcode_video_dialog->import_option()) {
@ -3701,8 +3806,8 @@ ARDOUR_UI::session_dialog (std::string msg)
int
ARDOUR_UI::pending_state_dialog ()
{
HBox* hbox = new HBox();
Image* image = new Image (Stock::DIALOG_QUESTION, ICON_SIZE_DIALOG);
HBox* hbox = manage (new HBox());
Image* image = manage (new Image (Stock::DIALOG_QUESTION, ICON_SIZE_DIALOG));
ArdourDialog dialog (_("Crash Recovery"), true);
Label message (string_compose (_("\
This session appears to have been in the\n\
@ -3771,6 +3876,7 @@ ARDOUR_UI::disconnect_from_engine ()
/* drop connection to AudioEngine::Halted so that we don't act
* as if the engine unexpectedly shut down
*/
halt_connection.disconnect ();
if (AudioEngine::instance()->stop ()) {
@ -3789,8 +3895,13 @@ int
ARDOUR_UI::reconnect_to_engine ()
{
if (AudioEngine::instance()->start ()) {
MessageDialog msg (*editor, _("Could not reconnect to the Audio/MIDI engine"));
msg.run ();
if (editor) {
MessageDialog msg (*editor, _("Could not reconnect to the Audio/MIDI engine"));
msg.run ();
} else {
MessageDialog msg (_("Could not reconnect to the Audio/MIDI engine"));
msg.run ();
}
return -1;
}
@ -4107,6 +4218,7 @@ int
ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate)
{
audio_midi_setup->set_desired_sample_rate (desired_sample_rate);
audio_midi_setup->set_position (WIN_POS_CENTER);
switch (audio_midi_setup->run()) {
case Gtk::RESPONSE_OK:
@ -4117,3 +4229,5 @@ ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate)
return -1;
}
}

View File

@ -72,7 +72,6 @@
#include "ardour_window.h"
#include "editing.h"
#include "meterbridge.h"
#include "nsm.h"
#include "ui_config.h"
#include "enums.h"
#include "visibility_group.h"
@ -105,6 +104,7 @@ class SpeakerDialog;
class ThemeManager;
class TimeInfoBox;
class MidiTracer;
class NSM_Client;
class LevelMeterHBox;
class GlobalPortMatrixWindow;
class GUIObjectState;
@ -330,8 +330,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
static ARDOUR_UI *theArdourUI;
void startup ();
void shutdown ();
int starting ();
int ask_about_saving_session (const std::vector<std::string>& actions);
@ -583,6 +582,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void snapshot_session (bool switch_to_it);
void rename_session ();
void setup_order_hint ();
Mixer_UI *mixer;
int create_mixer ();
@ -693,7 +693,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
bool first_idle ();
void no_memory_warning ();
void check_memory_locking ();
bool check_audioengine();

View File

@ -50,14 +50,6 @@ namespace ARDOUR {
using namespace ARDOUR;
void
ARDOUR_UI::shutdown ()
{
if (ui_config->dirty()) {
ui_config->save_state();
}
}
void
ARDOUR_UI::we_have_dependents ()
{

View File

@ -186,6 +186,11 @@ ARDOUR_UI::set_session (Session *s)
update_format ();
if (meter_box.get_parent()) {
transport_tearoff_hbox.remove (meter_box);
transport_tearoff_hbox.remove (editor_meter_peak_display);
}
if (editor_meter) {
meter_box.remove(*editor_meter);
delete editor_meter;
@ -193,7 +198,9 @@ ARDOUR_UI::set_session (Session *s)
editor_meter_peak_display.hide();
}
if (_session && _session->master_out()) {
if (_session
&& _session->master_out()
&& _session->master_out()->n_outputs().n(DataType::AUDIO) > 0) {
editor_meter = new LevelMeterHBox(_session);
editor_meter->set_meter (_session->master_out()->shared_peak_meter().get());
editor_meter->clear_meters();
@ -216,14 +223,12 @@ ARDOUR_UI::set_session (Session *s)
editor_meter_peak_display.signal_button_release_event().connect (sigc::mem_fun(*this, &ARDOUR_UI::editor_meter_peak_button_release), false);
if (Config->get_show_editor_meter()) {
transport_tearoff_hbox.pack_start (meter_box, false, false);
transport_tearoff_hbox.pack_start (editor_meter_peak_display, false, false);
meter_box.show();
editor_meter_peak_display.show();
} else {
meter_box.hide();
editor_meter_peak_display.hide();
}
}
}
}
int
@ -335,7 +340,7 @@ ARDOUR_UI::goto_mixer_window ()
screen = Gdk::Screen::get_default();
}
if (screen && screen->get_height() < 700) {
if (g_getenv ("ARDOUR_LOVES_STUPID_TINY_SCREENS") == 0 && screen && screen->get_height() < 700) {
Gtk::MessageDialog msg (_("This screen is not tall enough to display the mixer window"));
msg.run ();
return;

View File

@ -139,7 +139,7 @@ ARDOUR_UI::install_actions ()
sigc::mem_fun (*this, &ARDOUR_UI::remove_video));
act->set_sensitive (false);
act = ActionManager::register_action (main_actions, X_("ExportVideo"), _("Export To Video File"),
sigc::mem_fun (*editor, &PublicEditor::export_video));
hide_return (sigc::bind (sigc::mem_fun(*editor, &PublicEditor::export_video), false)));
ActionManager::session_sensitive_actions.push_back (act);
act = ActionManager::register_action (main_actions, X_("Snapshot"), _("Snapshot..."), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::snapshot_session), false));

View File

@ -401,12 +401,19 @@ ARDOUR_UI::parameter_changed (std::string p)
start_clocking ();
} else if (p == "show-editor-meter") {
bool show = Config->get_show_editor_meter();
if (editor_meter && show) {
meter_box.show();
editor_meter_peak_display.show();
} else if (editor_meter && !show) {
meter_box.hide();
editor_meter_peak_display.hide();
if (editor_meter) {
if (meter_box.get_parent()) {
transport_tearoff_hbox.remove (meter_box);
transport_tearoff_hbox.remove (editor_meter_peak_display);
}
if (show) {
transport_tearoff_hbox.pack_start (meter_box, false, false);
transport_tearoff_hbox.pack_start (editor_meter_peak_display, false, false);
meter_box.show();
editor_meter_peak_display.show();
}
}
}
}

View File

@ -620,6 +620,9 @@ AudioClock::end_edit (bool modify)
break;
case Frames:
if (edit_string.length() < 1) {
edit_string = pre_edit_string;
}
break;
}

View File

@ -75,14 +75,6 @@ set_language_preference ()
{
gtk_disable_setlocale ();
if (g_getenv ("LANGUAGE") || g_getenv ("LC_ALL") || g_getenv ("LANG")) {
return;
}
if (g_getenv ("ARDOUR_EN")) {
return;
}
/* the gettext manual is potentially misleading about the utility of
LANGUAGE. It notes that if LANGUAGE is set to include a dialect/region-free
language code, like "it", it will assume that you mean the main
@ -126,6 +118,6 @@ set_language_preference ()
*/
cout << "LANG set to " << [nslocale UTF8String] << endl;
setenv ("LANG", [nslocale UTF8String], 0);
setenv ("LANG", [nslocale UTF8String], 0);
CFRelease (cflocale);
}

View File

@ -1911,6 +1911,9 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
edit_items.push_back (MenuElem (_("Bounce Range to Region List"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, false)));
edit_items.push_back (MenuElem (_("Bounce Range to Region List With Processing"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), false, true)));
edit_items.push_back (MenuElem (_("Export Range..."), sigc::mem_fun(*this, &Editor::export_selection)));
if (ARDOUR_UI::instance()->video_timeline->get_duration() > 0) {
edit_items.push_back (MenuElem (_("Export Video Range..."), sigc::bind (sigc::mem_fun(*this, &Editor::export_video), true)));
}
}
@ -4868,8 +4871,10 @@ Editor::add_routes (RouteList& routes)
rtv->view()->RegionViewRemoved.connect (sigc::mem_fun (*this, &Editor::region_view_removed));
}
_routes->routes_added (new_views);
_summary->routes_added (new_views);
if (new_views.size() > 0) {
_routes->routes_added (new_views);
_summary->routes_added (new_views);
}
if (show_editor_mixer_when_tracks_arrive) {
show_editor_mixer (true);

View File

@ -924,7 +924,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void toggle_ruler_video (bool onoff) {ruler_video_action->set_active(onoff);}
int videotl_bar_height; /* in units of timebar_height; default: 4 */
int get_videotl_bar_height () const { return videotl_bar_height; }
void export_video ();
void export_video (bool range = false);
void toggle_region_video_lock ();
Gtk::VBox time_button_vbox;
@ -1085,6 +1085,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
bool button_press_handler_1 (ArdourCanvas::Item *, GdkEvent *, ItemType);
bool button_press_handler_2 (ArdourCanvas::Item *, GdkEvent *, ItemType);
bool button_release_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
bool button_double_click_handler (ArdourCanvas::Item*, GdkEvent*, ItemType);
bool button_press_dispatch (GdkEventButton*);
bool button_release_dispatch (GdkEventButton*);
bool motion_handler (ArdourCanvas::Item*, GdkEvent*, bool from_autoscroll = false);
@ -1448,7 +1449,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void toggle_video_timeline_locked ();
void set_video_timeline_locked (const bool);
void queue_visual_videotimeline_update ();
void embed_audio_from_video (std::string, framepos_t n = 0);
void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true);
PBD::Signal0<void> EditorFreeze;
PBD::Signal0<void> EditorThaw;
@ -1523,6 +1524,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void marker_menu_edit ();
void marker_menu_remove ();
void marker_menu_rename ();
void rename_marker (Marker *marker);
void toggle_marker_menu_lock ();
void toggle_marker_menu_glue ();
void marker_menu_hide ();

View File

@ -422,7 +422,7 @@ struct EditorOrderTimeAxisViewSorter {
RouteTimeAxisView* ra = dynamic_cast<RouteTimeAxisView*> (a);
RouteTimeAxisView* rb = dynamic_cast<RouteTimeAxisView*> (b);
assert (ra && rb);
return ra->route()->order_key (EditorSort) < rb->route()->order_key (EditorSort);
return ra->route()->order_key () < rb->route()->order_key ();
}
};

View File

@ -176,12 +176,6 @@ EditorGroupTabs::default_properties () const
return plist;
}
RouteSortOrderKey
EditorGroupTabs::order_key () const
{
return EditorSort;
}
RouteList
EditorGroupTabs::selected_routes () const
{

View File

@ -37,7 +37,6 @@ private:
}
void add_menu_items (Gtk::Menu *, ARDOUR::RouteGroup *);
PBD::PropertyList default_properties () const;
ARDOUR::RouteSortOrderKey order_key () const;
ARDOUR::RouteList selected_routes () const;
void sync_order_keys ();
};

View File

@ -1338,12 +1338,23 @@ Editor::marker_menu_rename ()
/*NOTREACHED*/
}
rename_marker (marker);
}
void
Editor::rename_marker(Marker *marker)
{
Location* loc;
bool is_start;
loc = find_location_from_marker (marker, is_start);
if (!loc) return;
if (!loc)
return;
if (loc == transport_loop_location() || loc == transport_punch_location() || loc->is_session_range())
return;
ArdourPrompter dialog (true);
string txt;
@ -1378,6 +1389,7 @@ Editor::marker_menu_rename ()
dialog.get_result(txt);
loc->set_name (txt);
_session->set_dirty ();
XMLNode &after = _session->locations()->get_state();
_session->add_command (new MementoCommand<Locations>(*(_session->locations()), &before, &after));

View File

@ -86,7 +86,7 @@ Editor::show_editor_mixer (bool yn)
screen = Gdk::Screen::get_default();
}
if (screen && screen->get_height() < 700) {
if (g_getenv ("ARDOUR_LOVES_STUPID_TINY_SCREENS") == 0 && screen && screen->get_height() < 700) {
Gtk::MessageDialog msg (_("This screen is not tall enough to display the editor mixer"));
msg.run ();
return;
@ -133,17 +133,19 @@ Editor::show_editor_mixer (bool yn)
if (current_mixer_strip == 0) {
create_editor_mixer ();
}
current_mixer_strip->set_route (r);
current_mixer_strip->set_width_enum (editor_mixer_strip_width, (void*) this);
}
if (current_mixer_strip->get_parent() == 0) {
if (current_mixer_strip && current_mixer_strip->get_parent() == 0) {
global_hpacker.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK );
global_hpacker.reorder_child (*current_mixer_strip, 0);
current_mixer_strip->show ();
}
if (r) {
current_mixer_strip->set_route (r);
current_mixer_strip->set_width_enum (editor_mixer_strip_width, (void*) this);
}
} else {
if (current_mixer_strip) {

View File

@ -1269,6 +1269,10 @@ bool
Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
{
if (event->type != GDK_BUTTON_PRESS) {
if (event->type == GDK_2BUTTON_PRESS) {
gdk_pointer_ungrab (GDK_CURRENT_TIME);
return button_double_click_handler (item, event, item_type);
}
return false;
}
@ -1392,6 +1396,52 @@ Editor::button_release_dispatch (GdkEventButton* ev)
return button_bindings->activate (b, Gtkmm2ext::Bindings::Release);
}
bool
Editor::button_double_click_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type) {
if (event->button.button != 1) {
return false;
}
switch (item_type) {
case RegionItem:
RegionView *rv;
rv = clicked_regionview;
rv->show_region_editor ();
return true;
case NoteItem:
case PlayheadCursorItem:
break;
case MarkerItem:
case RangeMarkerBarItem:
case CdMarkerBarItem:
Marker* marker;
if ((marker = static_cast<Marker *> (item->get_data ("marker"))) == 0) {
break;
}
rename_marker (marker);
return true;
case TempoMarkerItem:
edit_tempo_marker (item);
return true;
case MeterMarkerItem:
edit_meter_marker (item);
return true;
case MarkerBarItem:
case TempoBarItem:
case MeterBarItem:
case TransportMarkerBarItem:
case StreamItem:
break;
default:
break;
}
return false;
}
bool
Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type)
{

View File

@ -4712,7 +4712,7 @@ Editor::apply_midi_note_edit_op_to_region (MidiOperator& op, MidiRegionView& mrv
vector<Evoral::Sequence<Evoral::MusicalTime>::Notes> v;
v.push_back (selected);
framepos_t pos_frames = mrv.midi_region()->position();
framepos_t pos_frames = mrv.midi_region()->position() - mrv.midi_region()->start();
double pos_beats = _session->tempo_map().framewalk_to_beats(0, pos_frames);
return op (mrv.midi_region()->model(), pos_beats, v);
@ -5528,7 +5528,7 @@ Editor::split_region ()
struct EditorOrderRouteSorter {
bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
return a->order_key (EditorSort) < b->order_key (EditorSort);
return a->order_key () < b->order_key ();
}
};

View File

@ -1115,7 +1115,7 @@ EditorRegions::sorter (TreeModel::iterator a, TreeModel::iterator b)
switch (_sort_type) {
case ByName:
cmp = g_strcasecmp (region1->name().c_str(), region2->name().c_str());
cmp = region1->name().compare(region2->name());
break;
case ByLength:
@ -1140,7 +1140,7 @@ EditorRegions::sorter (TreeModel::iterator a, TreeModel::iterator b)
break;
case BySourceFileName:
cmp = g_strcasecmp (region1->source()->name().c_str(), region2->source()->name().c_str());
cmp = region1->source()->name().compare(region2->source()->name());
break;
case BySourceFileLength:
@ -1153,9 +1153,9 @@ EditorRegions::sorter (TreeModel::iterator a, TreeModel::iterator b)
case BySourceFileFS:
if (region1->source()->name() == region2->source()->name()) {
cmp = g_strcasecmp (region1->name().c_str(), region2->name().c_str());
cmp = region1->name().compare(region2->name());
} else {
cmp = g_strcasecmp (region1->source()->name().c_str(), region2->source()->name().c_str());
cmp = region1->source()->name().compare(region2->source()->name());
}
break;
}

View File

@ -284,7 +284,7 @@ EditorRoutes::EditorRoutes (Editor* e)
_display.set_enable_search (false);
Route::SyncOrderKeys.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::sync_treeview_from_order_keys, this, _1), gui_context());
Route::SyncOrderKeys.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::sync_treeview_from_order_keys, this), gui_context());
}
bool
@ -600,9 +600,24 @@ EditorRoutes::active_changed (std::string const & path)
void
EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
{
TreeModel::Row row;
PBD::Unwinder<bool> at (_adding_routes, true);
bool from_scratch = (_model->children().size() == 0);
Gtk::TreeModel::Children::iterator insert_iter = _model->children().end();
for (Gtk::TreeModel::Children::iterator it = _model->children().begin(); it != _model->children().end(); ++it) {
boost::shared_ptr<Route> r = (*it)[_columns.route];
if (r->order_key() == (routes.front()->route()->order_key() + routes.size())) {
insert_iter = it;
break;
}
}
if(!from_scratch) {
_editor->selection->tracks.clear();
}
suspend_redisplay ();
_display.set_model (Glib::RefPtr<ListStore>());
@ -611,7 +626,7 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
boost::shared_ptr<MidiTrack> midi_trk = boost::dynamic_pointer_cast<MidiTrack> ((*x)->route());
row = *(_model->append ());
TreeModel::Row row = *(_model->insert (insert_iter));
row[_columns.text] = (*x)->route()->name();
row[_columns.visible] = (*x)->marked_for_display();
@ -635,6 +650,10 @@ EditorRoutes::routes_added (list<RouteTimeAxisView*> routes)
row[_columns.solo_safe_state] = (*x)->route()->solo_safe();
row[_columns.name_editable] = true;
if (!from_scratch) {
_editor->selection->add(*x);
}
boost::weak_ptr<Route> wr ((*x)->route());
(*x)->route()->gui_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::handle_gui_changes, this, _1, _2), gui_context());
@ -812,7 +831,7 @@ EditorRoutes::show_track_in_display (TimeAxisView& tv)
void
EditorRoutes::reset_remote_control_ids ()
{
if (Config->get_remote_model() != EditorOrdered || !_session || _session->deletion_in_progress()) {
if (Config->get_remote_model() == UserOrdered || !_session || _session->deletion_in_progress()) {
return;
}
@ -841,7 +860,7 @@ EditorRoutes::reset_remote_control_ids ()
uint32_t new_rid = (visible ? rid : invisible_key--);
if (new_rid != route->remote_control_id()) {
route->set_remote_control_id_from_order_key (EditorSort, new_rid);
route->set_remote_control_id_explicit (new_rid);
rid_change = true;
}
@ -887,20 +906,20 @@ EditorRoutes::sync_order_keys_from_treeview ()
boost::shared_ptr<Route> route = (*ri)[_columns.route];
bool visible = (*ri)[_columns.visible];
uint32_t old_key = route->order_key (EditorSort);
uint32_t old_key = route->order_key ();
if (order != old_key) {
route->set_order_key (EditorSort, order);
route->set_order_key (order);
changed = true;
}
if ((Config->get_remote_model() == EditorOrdered) && !route->is_master() && !route->is_monitor()) {
if ((Config->get_remote_model() == MixerOrdered) && !route->is_master() && !route->is_monitor()) {
uint32_t new_rid = (visible ? rid : invisible_key--);
if (new_rid != route->remote_control_id()) {
route->set_remote_control_id_from_order_key (EditorSort, new_rid);
route->set_remote_control_id_explicit (new_rid);
rid_change = true;
}
@ -915,7 +934,7 @@ EditorRoutes::sync_order_keys_from_treeview ()
if (changed) {
/* tell the world that we changed the editor sort keys */
_session->sync_order_keys (EditorSort);
_session->sync_order_keys ();
}
if (rid_change) {
@ -925,37 +944,17 @@ EditorRoutes::sync_order_keys_from_treeview ()
}
void
EditorRoutes::sync_treeview_from_order_keys (RouteSortOrderKey src)
EditorRoutes::sync_treeview_from_order_keys ()
{
/* Some route order key(s) for `src' has been changed, make sure that
/* Some route order key(s) have been changed, make sure that
we update out tree/list model and GUI to reflect the change.
*/
if (!_session || _session->deletion_in_progress()) {
if (_ignore_reorder || !_session || _session->deletion_in_progress()) {
return;
}
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("editor sync model from order keys, src = %1\n", enum_2_string (src)));
if (src == MixerSort) {
if (!Config->get_sync_all_route_ordering()) {
/* mixer sort keys changed - we don't care */
return;
}
DEBUG_TRACE (DEBUG::OrderKeys, "reset editor order key to match mixer\n");
/* mixer sort keys were changed, update the editor sort
* keys since "sync mixer+editor order" is enabled.
*/
boost::shared_ptr<RouteList> r = _session->get_routes ();
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
(*i)->sync_order_keys (src);
}
}
DEBUG_TRACE (DEBUG::OrderKeys, "editor sync model from order keys.\n");
/* we could get here after either a change in the Mixer or Editor sort
* order, but either way, the mixer order keys reflect the intended
@ -975,7 +974,7 @@ EditorRoutes::sync_treeview_from_order_keys (RouteSortOrderKey src)
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
boost::shared_ptr<Route> route = (*ri)[_columns.route];
sorted_routes.push_back (RoutePlusOrderKey (route, old_order, route->order_key (EditorSort)));
sorted_routes.push_back (RoutePlusOrderKey (route, old_order, route->order_key ()));
}
SortByNewDisplayOrder cmp;
@ -1341,7 +1340,7 @@ struct EditorOrderRouteSorter {
/* everything else before master */
return false;
}
return a->order_key (EditorSort) < b->order_key (EditorSort);
return a->order_key () < b->order_key ();
}
};
@ -1501,7 +1500,7 @@ EditorRoutes::move_selected_tracks (bool up)
}
for (leading = view_routes.begin(); leading != view_routes.end(); ++leading) {
uint32_t order = leading->second->order_key (EditorSort);
uint32_t order = leading->second->order_key ();
neworder.push_back (order);
}

View File

@ -72,7 +72,7 @@ private:
void on_tv_solo_safe_toggled (std::string const &);
void build_menu ();
void show_menu ();
void sync_treeview_from_order_keys (ARDOUR::RouteSortOrderKey);
void sync_treeview_from_order_keys ();
void route_deleted (Gtk::TreeModel::Path const &);
void visible_changed (std::string const &);
void active_changed (std::string const &);

View File

@ -779,7 +779,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
RouteTimeAxisView* closest = 0;
int distance = INT_MAX;
int key = rtv->route()->order_key (EditorSort);
int key = rtv->route()->order_key ();
for (RegionSelection::iterator x = selection->regions.begin(); x != selection->regions.end(); ++x) {
@ -794,7 +794,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
if (result.second) {
/* newly added to already_in_selection */
int d = artv->route()->order_key (EditorSort);
int d = artv->route()->order_key ();
d -= key;
@ -810,7 +810,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
/* now add all tracks between that one and this one */
int okey = closest->route()->order_key (EditorSort);
int okey = closest->route()->order_key ();
if (okey > key) {
swap (okey, key);
@ -820,7 +820,7 @@ Editor::set_selected_regionview_from_click (bool press, Selection::Operation op)
RouteTimeAxisView* artv = dynamic_cast<RouteTimeAxisView*>(*x);
if (artv && artv != rtv) {
int k = artv->route()->order_key (EditorSort);
int k = artv->route()->order_key ();
if (k >= okey && k <= key) {

View File

@ -45,7 +45,7 @@
#include "ardour/stretch.h"
#ifdef USE_RUBBERBAND
#include "rubberband/RubberBandStretcher.h"
#include <rubberband/RubberBandStretcher.h>
using namespace RubberBand;
#endif

View File

@ -93,13 +93,10 @@ Editor::toggle_video_timeline_locked ()
}
void
Editor::embed_audio_from_video (std::string path, framepos_t n)
Editor::embed_audio_from_video (std::string path, framepos_t n, bool lock_position_to_video)
{
vector<std::string> paths;
paths.push_back(path);
#if 0
do_import (paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, ARDOUR::SrcBest, n);
#else
current_interthread_info = &import_status;
import_status.current = 1;
import_status.total = paths.size ();
@ -111,18 +108,19 @@ Editor::embed_audio_from_video (std::string path, framepos_t n)
boost::shared_ptr<ARDOUR::Track> track;
bool ok = (import_sndfiles (paths, Editing::ImportDistinctFiles, Editing::ImportAsTrack, ARDOUR::SrcBest, n, 1, 1, track, false) == 0);
if (ok && track) {
boost::shared_ptr<ARDOUR::Playlist> pl = track->playlist();
pl->find_next_region(n, ARDOUR::End, 0)->set_video_locked(true);
if (lock_position_to_video) {
boost::shared_ptr<ARDOUR::Playlist> pl = track->playlist();
pl->find_next_region(n, ARDOUR::End, 0)->set_video_locked(true);
}
_session->save_state ("");
}
import_status.all_done = true;
#endif
unlink(path.c_str());
}
void
Editor::export_video ()
Editor::export_video (bool range)
{
if (ARDOUR::Config->get_show_video_export_info()) {
ExportVideoInfobox infobox (_session);
@ -138,7 +136,7 @@ Editor::export_video ()
break;
}
}
ExportVideoDialog dialog (_session, get_selection().time);
ExportVideoDialog dialog (_session, get_selection().time, range);
Gtk::ResponseType r = (Gtk::ResponseType) dialog.run();
dialog.hide();
#if 0

File diff suppressed because it is too large Load Diff

View File

@ -36,6 +36,7 @@
#include "pbd/signals.h"
#include "ardour_dialog.h"
#include "ardour_button.h"
class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
public:
@ -62,6 +63,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
Gtk::ComboBoxText driver_combo;
Gtk::ComboBoxText device_combo;
Gtk::ComboBoxText sample_rate_combo;
Gtk::ComboBoxText midi_option_combo;
Gtk::ComboBoxText buffer_size_combo;
Gtk::Label buffer_size_duration_label;
Gtk::Adjustment input_latency_adjustment;
@ -84,14 +86,17 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
Gtk::ComboBoxText lm_output_channel_combo;
Gtk::ComboBoxText lm_input_channel_combo;
Gtk::Label lm_start_stop_label;
Gtk::ToggleButton lm_measure_button;
Gtk::Label lm_measure_label;
Gtk::Button lm_measure_button;
Gtk::Button lm_use_button;
Gtk::Button lm_back_button;
ArdourButton lm_button;
Gtk::Label lm_title;
Gtk::Label lm_results;
Gtk::Table lm_table;
Gtk::VBox lm_vbox;
bool have_lm_results;
bool lm_running;
Gtk::Button* cancel_button;
Gtk::Button* ok_button;
@ -109,7 +114,6 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
uint32_t ignore_changes;
uint32_t _desired_sample_rate;
bool no_push;
bool started_at_least_once;
void driver_changed ();
@ -117,6 +121,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
void sample_rate_changed ();
void buffer_size_changed ();
void parameter_changed ();
void midi_option_changed ();
void setup_midi_tab_for_backend ();
void setup_midi_tab_for_jack ();
@ -133,6 +138,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
std::string get_device_name() const;
std::string get_driver() const;
std::string get_backend() const;
std::string get_midi_option () const;
void device_changed ();
void list_devices ();
@ -149,6 +155,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
uint32_t input_channels;
uint32_t output_channels;
bool active;
std::string midi_option;
State()
: input_latency (0)
@ -188,7 +195,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
void update_sensitivity ();
/* latency measurement */
void latency_button_toggled ();
void latency_button_clicked ();
bool check_latency_measurement ();
sigc::connection latency_timeout;
void enable_latency_tab ();
@ -205,6 +212,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
PBD::ScopedConnection stopped_connection;
void connect_disconnect_click ();
void calibrate_latency ();
};
#endif /* __gtk2_ardour_engine_dialog_h__ */

View File

@ -174,9 +174,9 @@ ExportDialog::init_components ()
}
void
ExportDialog::notify_errors ()
ExportDialog::notify_errors (bool force)
{
if (status->errors()) {
if (force || status->errors()) {
std::string txt = _("Export has been aborted due to an error!\nSee the Log for details.");
Gtk::MessageDialog msg (txt, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
msg.run();
@ -269,25 +269,30 @@ ExportDialog::soundcloud_upload_progress(double total, double now, std::string t
void
ExportDialog::do_export ()
{
profile_manager->prepare_for_export ();
handler->upload_username = soundcloud_selector->username();
handler->upload_password = soundcloud_selector->password();
handler->upload_public = soundcloud_selector->upload_public();
handler->upload_open = soundcloud_selector->upload_open();
try {
profile_manager->prepare_for_export ();
handler->upload_username = soundcloud_selector->username();
handler->upload_password = soundcloud_selector->password();
handler->upload_public = soundcloud_selector->upload_public();
handler->upload_open = soundcloud_selector->upload_open();
handler->SoundcloudProgress.connect_same_thread(
*this,
boost::bind(&ExportDialog::soundcloud_upload_progress, this, _1, _2, _3)
);
handler->SoundcloudProgress.connect_same_thread(
*this,
boost::bind(&ExportDialog::soundcloud_upload_progress, this, _1, _2, _3)
);
#if 0
handler->SoundcloudProgress.connect(
*this, invalidator (*this),
boost::bind(&ExportDialog::soundcloud_upload_progress, this, _1, _2, _3),
gui_context()
);
handler->SoundcloudProgress.connect(
*this, invalidator (*this),
boost::bind(&ExportDialog::soundcloud_upload_progress, this, _1, _2, _3),
gui_context()
);
#endif
handler->do_export ();
show_progress ();
handler->do_export ();
show_progress ();
} catch(std::exception & e) {
error << string_compose (_("Export initialization failed: %1"), e.what()) << endmsg;
notify_errors(true);
}
}
void

View File

@ -93,7 +93,7 @@ class ExportDialog : public ArdourDialog, public PBD::ScopedConnectionList
void init ();
void notify_errors ();
void notify_errors (bool force = false);
void close_dialog ();
void sync_with_manager ();

View File

@ -920,8 +920,6 @@ ExportFormatDialog::show_ogg_enconding_options (boost::shared_ptr<ARDOUR::Export
encoding_options_table.resize (1, 1);
encoding_options_table.attach (tag_checkbox, 0, 1, 0, 1);
update_tagging_selection ();
show_all_children ();
}

View File

@ -61,7 +61,7 @@ using namespace PBD;
using namespace ARDOUR;
using namespace VideoUtils;
ExportVideoDialog::ExportVideoDialog (Session* s, TimeSelection &tme)
ExportVideoDialog::ExportVideoDialog (Session* s, TimeSelection &tme, bool range)
: ArdourDialog (_("Export Video File "))
, export_range (tme)
, outfn_path_label (_("File:"), Gtk::ALIGN_LEFT)
@ -152,7 +152,11 @@ ExportVideoDialog::ExportVideoDialog (Session* s, TimeSelection &tme)
if (!export_range.empty()) {
insnd_combo.append_text (_("Selected range")); // TODO show export_range.start() -> export_range.end_frame()
}
insnd_combo.set_active(0);
if (range) {
insnd_combo.set_active(2);
} else {
insnd_combo.set_active(0);
}
outfn_path_entry.set_width_chars(38);
outfn_path_entry.set_text (_session->session_directory().export_path() + G_DIR_SEPARATOR +"export.avi");
@ -510,9 +514,8 @@ ExportVideoDialog::launch_export ()
end += av_offset;
}
else if (insnd_combo.get_active_row_number() == 2) {
// TODO quantize to video-frame ?!
start = export_range.start();
end = export_range.end_frame();
start = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(export_range.start());
end = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(export_range.end_frame());
}
if (end <= 0) {
start = _session->current_start_frame();
@ -522,6 +525,15 @@ ExportVideoDialog::launch_export ()
printf("audio export-range %lld -> %lld\n", start, end);
#endif
const frameoffset_t vstart = ARDOUR_UI::instance()->video_timeline->get_offset();
const frameoffset_t vend = vstart + ARDOUR_UI::instance()->video_timeline->get_duration();
if ( (start >= end) || (end < vstart) || (start > vend)) {
warning << _("Export Video: export-range does not include video.") << endmsg;
Gtk::Dialog::response(RESPONSE_CANCEL);
return;
}
tsp->set_range (start, end);
tsp->set_name ("mysession");
tsp->set_range_id ("session");

View File

@ -41,7 +41,7 @@
class ExportVideoDialog : public ArdourDialog , public PBD::ScopedConnectionList
{
public:
ExportVideoDialog (ARDOUR::Session*, TimeSelection &tme);
ExportVideoDialog (ARDOUR::Session*, TimeSelection &tme, bool range = false);
~ExportVideoDialog ();
std::string get_exported_filename () { return outfn_path_entry.get_text(); }

View File

@ -101,6 +101,7 @@ class GainMeterBase : virtual public sigc::trackable, ARDOUR::SessionHandlePtr
friend class MixerStrip;
friend class MeterStrip;
friend class RouteTimeAxisView;
boost::shared_ptr<ARDOUR::Route> _route;
boost::shared_ptr<ARDOUR::PeakMeter> _meter;
boost::shared_ptr<ARDOUR::Amp> _amp;

View File

@ -490,6 +490,32 @@ GenericPluginUI::integer_printer (char buf[32], Adjustment &adj, ControlUI* cui)
return true;
}
bool
GenericPluginUI::midinote_printer (char buf[32], Adjustment &adj, ControlUI* cui)
{
float const v = adj.get_value ();
if (cui->scale_points) {
Plugin::ScalePoints::const_iterator i = cui->scale_points->begin ();
while (i != cui->scale_points->end() && i->second != v) {
++i;
}
if (i != cui->scale_points->end ()) {
snprintf (buf, 32, "%s", i->first.c_str());
return true;
}
}
if (v >= 0 && v <= 127) {
int mn = rint(v);
const char notename[12][3] = { "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B" };
snprintf (buf, 32, "%s %d", notename[mn%12], (mn/12)-2);
} else {
snprintf (buf, 32, "%.0f", v);
}
return true;
}
void
GenericPluginUI::print_parameter (char *buf, uint32_t len, uint32_t param)
{
@ -610,7 +636,12 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
if (desc.integer_step) {
control_ui->clickbox = new ClickBox (adj, "PluginUIClickBox");
Gtkmm2ext::set_size_request_to_display_given_text (*control_ui->clickbox, "g9999999", 2, 2);
control_ui->clickbox->set_printer (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::integer_printer), control_ui));
if (desc.midinote) {
printf("MIDI NOTE\n");
control_ui->clickbox->set_printer (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::midinote_printer), control_ui));
} else {
control_ui->clickbox->set_printer (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::integer_printer), control_ui));
}
} else {
//sigc::slot<void,char*,uint32_t> pslot = sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::print_parameter), (uint32_t) port_index);

View File

@ -447,23 +447,15 @@ GroupTabs::un_subgroup (RouteGroup* g)
}
struct CollectSorter {
CollectSorter (RouteSortOrderKey key) : _key (key) {}
bool operator () (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
return a->order_key (_key) < b->order_key (_key);
return a->order_key () < b->order_key ();
}
RouteSortOrderKey _key;
};
struct OrderSorter {
OrderSorter (RouteSortOrderKey key) : _key (key) {}
bool operator() (boost::shared_ptr<Route> a, boost::shared_ptr<Route> b) {
return a->order_key (_key) < b->order_key (_key);
return a->order_key () < b->order_key ();
}
RouteSortOrderKey _key;
};
/** Collect all members of a RouteGroup so that they are together in the Editor or Mixer.
@ -473,19 +465,19 @@ void
GroupTabs::collect (RouteGroup* g)
{
boost::shared_ptr<RouteList> group_routes = g->route_list ();
group_routes->sort (CollectSorter (order_key ()));
group_routes->sort (CollectSorter ());
int const N = group_routes->size ();
RouteList::iterator i = group_routes->begin ();
boost::shared_ptr<RouteList> routes = _session->get_routes ();
routes->sort (OrderSorter (order_key ()));
routes->sort (OrderSorter ());
RouteList::const_iterator j = routes->begin ();
int diff = 0;
int coll = -1;
while (i != group_routes->end() && j != routes->end()) {
int const k = (*j)->order_key (order_key ());
int const k = (*j)->order_key ();
if (*i == *j) {
@ -496,14 +488,14 @@ GroupTabs::collect (RouteGroup* g)
--diff;
}
(*j)->set_order_key (order_key (), coll);
(*j)->set_order_key (coll);
++coll;
++i;
} else {
(*j)->set_order_key (order_key (), k + diff);
(*j)->set_order_key (k + diff);
}

View File

@ -92,7 +92,6 @@ private:
virtual void add_menu_items (Gtk::Menu *, ARDOUR::RouteGroup *) {}
virtual PBD::PropertyList default_properties () const = 0;
virtual ARDOUR::RouteSortOrderKey order_key () const = 0;
virtual ARDOUR::RouteList selected_routes () const = 0;
virtual void sync_order_keys () = 0;

View File

@ -732,13 +732,13 @@ piano_keyboard_set_keyboard_layout(PianoKeyboard *pk, const char *layout)
{
assert(layout);
if (!g_strcasecmp(layout, "QWERTY")) {
if (!g_ascii_strcasecmp(layout, "QWERTY")) {
bind_keys_qwerty(pk);
} else if (!g_strcasecmp(layout, "QWERTZ")) {
} else if (!g_ascii_strcasecmp(layout, "QWERTZ")) {
bind_keys_qwertz(pk);
} else if (!g_strcasecmp(layout, "AZERTY")) {
} else if (!g_ascii_strcasecmp(layout, "AZERTY")) {
bind_keys_azerty(pk);
} else {

View File

@ -157,6 +157,8 @@ LevelMeterBase::update_meters ()
(*i).meter->set (meter_deflect_ppm (peak + meter_lineup(0)));
} else if (meter_type == MeterVU) {
(*i).meter->set (meter_deflect_vu (peak + vu_standard() + meter_lineup(0)));
} else if (meter_type == MeterK12) {
(*i).meter->set (meter_deflect_k (peak, 12), meter_deflect_k(_meter->meter_level(n, MeterPeak), 12));
} else if (meter_type == MeterK14) {
(*i).meter->set (meter_deflect_k (peak, 14), meter_deflect_k(_meter->meter_level(n, MeterPeak), 14));
} else if (meter_type == MeterK20) {
@ -320,6 +322,17 @@ LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
c[6] = c[7] = 0xffff00ff;
c[8] = c[9] = 0xff0000ff;
break;
case MeterK12:
stp[0] = 115.0 * meter_deflect_k(-32, 12); //-20
stp[1] = 115.0 * meter_deflect_k(-12, 12); // 0
stp[2] = 115.0 * meter_deflect_k(-10, 12); // +2
stp[3] = 115.0 * meter_deflect_k( -8, 12); // +4
c[0] = c[1] = 0x008800ff;
c[2] = c[3] = 0x00ff00ff;
c[4] = c[5] = 0xffff00ff;
c[6] = c[7] = 0xffff00ff;
c[8] = c[9] = 0xff0000ff;
break;
case MeterIEC2BBC:
c[0] = c[1] = c[2] = c[3] = c[4] = c[5] = c[6] = c[7] = c[8] = c[9] =
ARDOUR_UI::config()->color_by_name ("meter color BBC");

View File

@ -478,12 +478,12 @@ void
LV2PluginUI::on_window_hide()
{
//printf("LV2PluginUI::on_window_hide\n");
_message_update_connection.disconnect();
if (_lv2->is_external_ui()) {
if (!_external_ui_ptr) { return; }
LV2_EXTERNAL_UI_HIDE(_external_ui_ptr);
if (!_lv2->is_external_kx()) { return ; }
_message_update_connection.disconnect();
_screen_update_connection.disconnect();
_external_ui_ptr = NULL;
suil_instance_free((SuilInstance*)_inst);

View File

@ -153,7 +153,7 @@ fixup_bundle_environment (int, char* [])
vector<string> lpath;
lpath.push_back (bundle_dir);
lpath.push_back ("share");
lpath.push_back ("Resources");
lpath.push_back ("locale");
localedir = strdup (Glib::build_filename (lpath).c_str());
}
@ -172,9 +172,9 @@ fixup_bundle_environment (int, char* [])
export_search_path (bundle_dir, "ARDOUR_INSTANT_XML_PATH", "/Resources");
export_search_path (bundle_dir, "LADSPA_PATH", "/Plugins");
export_search_path (bundle_dir, "VAMP_PATH", "/lib");
export_search_path (bundle_dir, "SUIL_MODULE_DIR", "/lib");
export_search_path (bundle_dir, "GTK_PATH", "/lib/gtkengines");
setenv ("SUIL_MODULE_DIR", (bundle_dir + "/lib").c_str(), 1);
setenv ("PATH", (bundle_dir + "/MacOS:" + std::string(getenv ("PATH"))).c_str(), 1);
/* unset GTK_RC_FILES so that we only load the RC files that we define
@ -282,9 +282,9 @@ fixup_bundle_environment (int /*argc*/, char* argv[])
export_search_path (dir_path, "ARDOUR_DATA_PATH", "/share");
export_search_path (dir_path, "LADSPA_PATH", "/plugins");
export_search_path (dir_path, "VAMP_PATH", "/lib");
export_search_path (dir_path, "SUIL_MODULE_DIR", "/lib");
export_search_path (dir_path, "GTK_PATH", "/lib/gtkengines");
setenv ("SUIL_MODULE_DIR", (dir_path + "/lib").c_str(), 1);
setenv ("PATH", (dir_path + "/bin:" + std::string(getenv ("PATH"))).c_str(), 1);
/* unset GTK_RC_FILES so that we only load the RC files that we define
@ -518,6 +518,7 @@ int main (int argc, char *argv[])
ui->run (text_receiver);
Gtkmm2ext::Application::instance()->cleanup();
delete ui;
ui = 0;
ARDOUR::cleanup ();

View File

@ -101,6 +101,9 @@ ArdourMeter::meter_type_string (ARDOUR::MeterType mt)
case MeterK14:
return _("K14");
break;
case MeterK12:
return _("K12");
break;
case MeterVU:
return _("VU");
break;
@ -199,6 +202,16 @@ static inline float mtr_col_and_fract(
}
fraction = meter_deflect_k (val, 14);
break;
case MeterK12:
if (val >= -8.0) {
cairo_set_source_rgb (cr, 1.0, 0.0, 0.0); // red
} else if (val >= -12.0) {
cairo_set_source_rgb (cr, 0.8, 0.8, 0.0); // yellow
} else {
cairo_set_source_rgb (cr, 0.0, 1.0, 0.0); // green
}
fraction = meter_deflect_k (val, 12);
break;
}
return fraction;
}
@ -226,6 +239,7 @@ static void set_bg_color(Gtk::Widget& w, cairo_t* cr, MeterType type) {
case MeterIEC1NOR:
case MeterIEC2BBC:
case MeterIEC2EBU:
case MeterK12:
case MeterK14:
case MeterK20:
if (rgba_p_from_style("meterstripPPM", &r, &g, &b, "bg")) {
@ -334,6 +348,20 @@ meter_render_ticks (Gtk::Widget& w, MeterType type, vector<ARDOUR::DataType> typ
case DataType::AUDIO:
switch (type) {
case MeterK12:
points.insert (std::pair<float,float>(-52.0f, 1.0));
points.insert (std::pair<float,float>(-42.0f, 1.0));
points.insert (std::pair<float,float>(-32.0f, 1.0));
points.insert (std::pair<float,float>(-22.0f, 1.0));
points.insert (std::pair<float,float>(-18.0f, 1.0));
points.insert (std::pair<float,float>(-15.0f, 1.0));
points.insert (std::pair<float,float>(-12.0f, 1.0));
points.insert (std::pair<float,float>( -9.0f, 1.0));
points.insert (std::pair<float,float>( -8.0f, 0.8));
points.insert (std::pair<float,float>( -6.0f, 1.0));
points.insert (std::pair<float,float>( -3.0f, 1.0));
points.insert (std::pair<float,float>( 0.0f, 1.0));
break;
case MeterK14:
points.insert (std::pair<float,float>(-54.0f, 1.0));
points.insert (std::pair<float,float>(-44.0f, 1.0));
@ -645,6 +673,20 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
case DataType::AUDIO:
layout->set_attributes (audio_font_attributes);
switch (type) {
case MeterK12:
overlay_midi = 0;
points.insert (std::pair<float,string>(-52.0f, "-40"));
points.insert (std::pair<float,string>(-42.0f, "-30"));
points.insert (std::pair<float,string>(-32.0f, "-20"));
points.insert (std::pair<float,string>(-22.0f, "-10"));
points.insert (std::pair<float,string>(-18.0f, "-6"));
points.insert (std::pair<float,string>(-15.0f, "-3"));
points.insert (std::pair<float,string>(-12.0f, " 0"));
points.insert (std::pair<float,string>( -9.0f, "+3"));
points.insert (std::pair<float,string>( -6.0f, "+6"));
points.insert (std::pair<float,string>( -3.0f, "+9"));
points.insert (std::pair<float,string>( 0.0f, "+12"));
break;
case MeterK14:
overlay_midi = 0;
points.insert (std::pair<float,string>(-54.0f, "-40"));
@ -903,6 +945,9 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
case MeterK14:
layout->set_text("K14");
break;
case MeterK12:
layout->set_text("K12");
break;
default:
case MeterPeak:
case MeterKrms:

View File

@ -177,6 +177,11 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
namebx.set_size_request(18, 52);
namebx.pack_start(name_label, true, false, 3);
mon_in_box.pack_start(*monitor_input_button, true, false);
btnbox.pack_start(mon_in_box, false, false, 1);
mon_disk_box.pack_start(*monitor_disk_button, true, false);
btnbox.pack_start(mon_disk_box, false, false, 1);
recbox.pack_start(*rec_enable_button, true, false);
btnbox.pack_start(recbox, false, false, 1);
mutebox.pack_start(*mute_button, true, false);
@ -193,9 +198,17 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
solo_button->set_corner_radius(2);
solo_button->set_size_request(16, 16);
monitor_input_button->set_corner_radius(2);
monitor_input_button->set_size_request(16, 16);
monitor_disk_button->set_corner_radius(2);
monitor_disk_button->set_size_request(16, 16);
mutebox.set_size_request(16, 16);
solobox.set_size_request(16, 16);
recbox.set_size_request(16, 16);
mon_in_box.set_size_request(16, 16);
mon_disk_box.set_size_request(16, 16);
spacer.set_size_request(-1,0);
update_button_box();
@ -232,6 +245,8 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
mtr_container.show();
mtr_hsep.show();
nfo_vbox.show();
monitor_input_button->show();
monitor_disk_button->show();
_route->shared_peak_meter()->ConfigurationChanged.connect (
route_connections, invalidator (*this), boost::bind (&MeterStrip::meter_configuration_changed, this, _1), gui_context()
@ -339,6 +354,8 @@ MeterStrip::set_button_names()
}
}
monitor_input_button->set_text (_("I"));
monitor_disk_button->set_text (_("D"));
}
void
@ -545,6 +562,7 @@ MeterStrip::update_background(MeterType type)
case MeterIEC1NOR:
case MeterIEC2BBC:
case MeterIEC2EBU:
case MeterK12:
case MeterK14:
case MeterK20:
mtr_container.set_name ("meterstripPPM");
@ -651,6 +669,14 @@ MeterStrip::update_button_box ()
} else {
recbox.hide();
}
if (_session->config.get_show_monitor_on_meterbridge()) {
height += 18 + 18;
mon_in_box.show();
mon_disk_box.show();
} else {
mon_in_box.hide();
mon_disk_box.hide();
}
btnbox.set_size_request(16, height);
check_resize();
}
@ -684,6 +710,9 @@ MeterStrip::parameter_changed (std::string const & p)
else if (p == "show-name-on-meterbridge") {
update_name_box();
}
else if (p == "show-monitor-on-meterbridge") {
update_button_box();
}
else if (p == "meterbridge-label-height") {
queue_resize();
}
@ -719,6 +748,7 @@ MeterStrip::popup_level_meter_menu (GdkEventButton* ev)
add_level_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterIEC2EBU), MeterIEC2EBU);
add_level_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterK20), MeterK20);
add_level_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterK14), MeterK14);
add_level_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterK12), MeterK12);
add_level_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterVU), MeterVU);
MeterType cmt = _route->meter_type();

View File

@ -108,6 +108,8 @@ class MeterStrip : public Gtk::VBox, public RouteUI
Gtk::HBox mutebox;
Gtk::HBox solobox;
Gtk::HBox recbox;
Gtk::HBox mon_in_box;
Gtk::HBox mon_disk_box;
Gtk::Alignment meter_align;
Gtk::Alignment peak_align;

View File

@ -92,7 +92,7 @@ struct SignalOrderRouteSorter {
/* everything comes before b */
return true;
}
return a->order_key (MixerSort) < b->order_key (MixerSort);
return a->order_key () < b->order_key ();
}
};
@ -138,7 +138,7 @@ Meterbridge::Meterbridge ()
signal_delete_event().connect (sigc::mem_fun (*this, &Meterbridge::hide_window));
signal_configure_event().connect (sigc::mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::configure_handler));
Route::SyncOrderKeys.connect (*this, invalidator (*this), boost::bind (&Meterbridge::sync_order_keys, this, _1), gui_context());
Route::SyncOrderKeys.connect (*this, invalidator (*this), boost::bind (&Meterbridge::sync_order_keys, this), gui_context());
MeterStrip::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&Meterbridge::remove_strip, this, _1), gui_context());
MeterStrip::MetricChanged.connect (*this, invalidator (*this), boost::bind(&Meterbridge::resync_order, this), gui_context());
MeterStrip::ConfigurationChanged.connect (*this, invalidator (*this), boost::bind(&Meterbridge::queue_resize, this), gui_context());
@ -637,7 +637,7 @@ Meterbridge::remove_strip (MeterStrip* strip)
}
void
Meterbridge::sync_order_keys (RouteSortOrderKey)
Meterbridge::sync_order_keys ()
{
Glib::Threads::Mutex::Lock lm (_resync_mutex);
@ -776,7 +776,7 @@ Meterbridge::sync_order_keys (RouteSortOrderKey)
void
Meterbridge::resync_order()
{
sync_order_keys(MixerSort);
sync_order_keys();
}
void

View File

@ -80,7 +80,7 @@ class Meterbridge :
void remove_strip (MeterStrip *);
void session_going_away ();
void sync_order_keys (ARDOUR::RouteSortOrderKey src);
void sync_order_keys ();
void resync_order ();
mutable Glib::Threads::Mutex _resync_mutex;
@ -107,7 +107,7 @@ class Meterbridge :
/* everything comes before b */
return true;
}
return a->order_key (ARDOUR::MixerSort) < b->order_key (ARDOUR::MixerSort);
return a->order_key () < b->order_key ();
}
};

View File

@ -170,12 +170,6 @@ MixerGroupTabs::default_properties () const
return plist;
}
RouteSortOrderKey
MixerGroupTabs::order_key () const
{
return MixerSort;
}
RouteList
MixerGroupTabs::selected_routes () const
{

View File

@ -36,7 +36,6 @@ private:
}
PBD::PropertyList default_properties () const;
ARDOUR::RouteSortOrderKey order_key () const;
ARDOUR::RouteList selected_routes () const;
void sync_order_keys ();

View File

@ -2141,6 +2141,7 @@ MixerStrip::popup_level_meter_menu (GdkEventButton* ev)
add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterIEC2EBU), MeterIEC2EBU);
add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterK20), MeterK20);
add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterK14), MeterK14);
add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterK12), MeterK12);
add_level_meter_item_type (items, tgroup, ArdourMeter::meter_type_string(MeterVU), MeterVU);
int _strip_type;

View File

@ -96,7 +96,7 @@ Mixer_UI::Mixer_UI ()
/* allow this window to become the key focus window */
set_flags (CAN_FOCUS);
Route::SyncOrderKeys.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::sync_treeview_from_order_keys, this, _1), gui_context());
Route::SyncOrderKeys.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::sync_treeview_from_order_keys, this), gui_context());
scroller.set_can_default (true);
set_default (scroller);
@ -313,6 +313,22 @@ Mixer_UI::hide_window (GdkEventAny *ev)
void
Mixer_UI::add_strips (RouteList& routes)
{
bool from_scratch = track_model->children().size() == 0;
Gtk::TreeModel::Children::iterator insert_iter = track_model->children().end();
for (Gtk::TreeModel::Children::iterator it = track_model->children().begin(); it != track_model->children().end(); ++it) {
boost::shared_ptr<Route> r = (*it)[track_columns.route];
if (r->order_key() == (routes.front()->order_key() + routes.size())) {
insert_iter = it;
break;
}
}
if(!from_scratch) {
_selection.clear_routes ();
}
MixerStrip* strip;
try {
@ -359,11 +375,15 @@ Mixer_UI::add_strips (RouteList& routes)
show_strip (strip);
TreeModel::Row row = *(track_model->append());
TreeModel::Row row = *(track_model->insert(insert_iter));
row[track_columns.text] = route->name();
row[track_columns.visible] = strip->route()->is_master() ? true : strip->marked_for_display();
row[track_columns.route] = route;
row[track_columns.strip] = strip;
if (!from_scratch) {
_selection.add (strip);
}
route->PropertyChanged.connect (*this, invalidator (*this), boost::bind (&Mixer_UI::strip_property_changed, this, _1, strip), gui_context());
@ -408,7 +428,7 @@ Mixer_UI::remove_strip (MixerStrip* strip)
void
Mixer_UI::reset_remote_control_ids ()
{
if (Config->get_remote_model() != MixerOrdered || !_session || _session->deletion_in_progress()) {
if (Config->get_remote_model() == UserOrdered || !_session || _session->deletion_in_progress()) {
return;
}
@ -434,7 +454,7 @@ Mixer_UI::reset_remote_control_ids ()
uint32_t new_rid = (visible ? rid : invisible_key--);
if (new_rid != route->remote_control_id()) {
route->set_remote_control_id_from_order_key (MixerSort, new_rid);
route->set_remote_control_id_explicit (new_rid);
rid_change = true;
}
@ -476,10 +496,10 @@ Mixer_UI::sync_order_keys_from_treeview ()
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
bool visible = (*ri)[track_columns.visible];
uint32_t old_key = route->order_key (MixerSort);
uint32_t old_key = route->order_key ();
if (order != old_key) {
route->set_order_key (MixerSort, order);
route->set_order_key (order);
changed = true;
}
@ -488,7 +508,7 @@ Mixer_UI::sync_order_keys_from_treeview ()
uint32_t new_rid = (visible ? rid : invisible_key--);
if (new_rid != route->remote_control_id()) {
route->set_remote_control_id_from_order_key (MixerSort, new_rid);
route->set_remote_control_id_explicit (new_rid);
rid_change = true;
}
@ -503,7 +523,7 @@ Mixer_UI::sync_order_keys_from_treeview ()
if (changed) {
/* tell everyone that we changed the mixer sort keys */
_session->sync_order_keys (MixerSort);
_session->sync_order_keys ();
}
if (rid_change) {
@ -513,33 +533,13 @@ Mixer_UI::sync_order_keys_from_treeview ()
}
void
Mixer_UI::sync_treeview_from_order_keys (RouteSortOrderKey src)
Mixer_UI::sync_treeview_from_order_keys ()
{
if (!_session || _session->deletion_in_progress()) {
return;
}
DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("mixer sync model from order keys, src = %1\n", enum_2_string (src)));
if (src == EditorSort) {
if (!Config->get_sync_all_route_ordering()) {
/* editor sort keys changed - we don't care */
return;
}
DEBUG_TRACE (DEBUG::OrderKeys, "reset mixer order key to match editor\n");
/* editor sort keys were changed, update the mixer sort
* keys since "sync mixer+editor order" is enabled.
*/
boost::shared_ptr<RouteList> r = _session->get_routes ();
for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
(*i)->sync_order_keys (src);
}
}
DEBUG_TRACE (DEBUG::OrderKeys, "mixer sync model from order keys.\n");
/* we could get here after either a change in the Mixer or Editor sort
* order, but either way, the mixer order keys reflect the intended
@ -559,7 +559,7 @@ Mixer_UI::sync_treeview_from_order_keys (RouteSortOrderKey src)
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
boost::shared_ptr<Route> route = (*ri)[track_columns.route];
sorted_routes.push_back (RoutePlusOrderKey (route, old_order, route->order_key (MixerSort)));
sorted_routes.push_back (RoutePlusOrderKey (route, old_order, route->order_key ()));
}
SortByNewDisplayOrder cmp;
@ -1100,7 +1100,7 @@ struct SignalOrderRouteSorter {
/* everything comes before b */
return true;
}
return a->order_key (MixerSort) < b->order_key (MixerSort);
return a->order_key () < b->order_key ();
}
};
@ -1122,7 +1122,7 @@ Mixer_UI::initial_track_display ()
add_strips (copy);
}
_session->sync_order_keys (MixerSort);
_session->sync_order_keys ();
redisplay_track_list ();
}

View File

@ -250,9 +250,9 @@ class Mixer_UI : public Gtk::Window, public PBD::ScopedConnectionList, public AR
Width _strip_width;
void sync_order_keys_from_treeview ();
void sync_treeview_from_order_keys (ARDOUR::RouteSortOrderKey);
void sync_treeview_from_order_keys ();
void reset_remote_control_ids ();
void reset_order_keys (ARDOUR::RouteSortOrderKey);
void reset_order_keys ();
bool ignore_reorder;

View File

@ -37,6 +37,7 @@
#include "ardour/plugin_manager.h"
#include "ardour/plugin.h"
#include "ardour/utils.h"
#include "ardour_ui.h"
#include "plugin_selector.h"
@ -538,13 +539,13 @@ struct PluginMenuCompareByCreator {
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
int cmp;
cmp = g_strcasecmp (a->creator.c_str(), b->creator.c_str());
cmp = cmp_nocase_utf8 (a->creator, b->creator);
if (cmp < 0) {
return true;
} else if (cmp == 0) {
/* same creator ... compare names */
if (g_strcasecmp (a->name.c_str(), b->name.c_str()) < 0) {
if (cmp_nocase_utf8 (a->name, b->name) < 0) {
return true;
}
}
@ -556,7 +557,7 @@ struct PluginMenuCompareByName {
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
int cmp;
cmp = g_strcasecmp (a->name.c_str(), b->name.c_str());
cmp = cmp_nocase_utf8 (a->name, b->name);
if (cmp < 0) {
return true;
@ -574,13 +575,13 @@ struct PluginMenuCompareByCategory {
bool operator() (PluginInfoPtr a, PluginInfoPtr b) const {
int cmp;
cmp = g_strcasecmp (a->category.c_str(), b->category.c_str());
cmp = cmp_nocase_utf8 (a->category, b->category);
if (cmp < 0) {
return true;
} else if (cmp == 0) {
/* same category ... compare names */
if (g_strcasecmp (a->name.c_str(), b->name.c_str()) < 0) {
if (cmp_nocase_utf8 (a->name, b->name) < 0) {
return true;
}
}

View File

@ -161,6 +161,7 @@ PluginUIWindow::PluginUIWindow (
PluginUIWindow::~PluginUIWindow ()
{
cerr << "PluginWindow deleted for " << this << endl;
delete _pluginui;
}
@ -405,8 +406,6 @@ PluginUIWindow::plugin_going_away ()
}
death_connection.disconnect ();
delete_when_idle (this);
}
PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)

View File

@ -277,6 +277,7 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
/* XXX: remove */
void print_parameter (char *buf, uint32_t len, uint32_t param);
bool integer_printer (char* buf, Gtk::Adjustment &, ControlUI *);
bool midinote_printer(char* buf, Gtk::Adjustment &, ControlUI *);
};
class PluginUIWindow : public ArdourWindow

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -315,7 +315,7 @@ struct RouteIOs {
class RouteIOsComparator {
public:
bool operator() (RouteIOs const & a, RouteIOs const & b) {
return a.route->order_key (EditorSort) < b.route->order_key (EditorSort);
return a.route->order_key () < b.route->order_key ();
}
};
@ -438,7 +438,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
ardour->add_bundle (ltc);
}
/* Ardour's surfaces */
/* Ardour's control surfaces */
ControlProtocolManager& m = ControlProtocolManager::instance ();
for (list<ControlProtocolInfo*>::iterator i = m.control_protocol_info.begin(); i != m.control_protocol_info.end(); ++i) {

View File

@ -158,7 +158,7 @@ PortMatrix::init ()
_session->engine().PortRegisteredOrUnregistered.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports, this), gui_context());
/* watch for route order keys changing, which changes the order of things in our global ports list(s) */
Route::SyncOrderKeys.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports_proxy, this, _1), gui_context());
Route::SyncOrderKeys.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports_proxy, this), gui_context());
/* Part 3: other stuff */
@ -619,15 +619,13 @@ PortMatrix::setup_global_ports ()
}
void
PortMatrix::setup_global_ports_proxy (RouteSortOrderKey sk)
PortMatrix::setup_global_ports_proxy ()
{
if (sk == EditorSort) {
/* Avoid a deadlock by calling this in an idle handler: see IOSelector::io_changed_proxy
for a discussion.
*/
/* Avoid a deadlock by calling this in an idle handler: see IOSelector::io_changed_proxy
for a discussion.
*/
Glib::signal_idle().connect_once (sigc::mem_fun (*this, &PortMatrix::setup_global_ports));
}
Glib::signal_idle().connect_once (sigc::mem_fun (*this, &PortMatrix::setup_global_ports));
}
void

View File

@ -188,7 +188,7 @@ private:
void disassociate_all_on_channel (boost::weak_ptr<ARDOUR::Bundle>, uint32_t, int);
void disassociate_all_on_bundle (boost::weak_ptr<ARDOUR::Bundle>, int);
void setup_global_ports ();
void setup_global_ports_proxy (ARDOUR::RouteSortOrderKey);
void setup_global_ports_proxy ();
void toggle_show_only_bundles ();
bool on_scroll_event (GdkEventScroll *);
boost::shared_ptr<ARDOUR::IO> io_from_bundle (boost::shared_ptr<ARDOUR::Bundle>) const;

View File

@ -38,6 +38,7 @@
#include <gtkmm2ext/choice.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/doi.h>
#include <gtkmm2ext/rgb_macros.h>
#include "ardour/amp.h"
#include "ardour/audio_track.h"
@ -91,6 +92,9 @@ RefPtr<Action> ProcessorBox::rename_action;
RefPtr<Action> ProcessorBox::edit_action;
RefPtr<Action> ProcessorBox::edit_generic_action;
static const uint32_t audio_port_color = 0x4A8A0EFF; // Green
static const uint32_t midi_port_color = 0x960909FF; //Red
ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processor> p, Width w)
: _button (ArdourButton::led_default_elements)
, _position (PreFader)
@ -98,6 +102,8 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo
, _processor (p)
, _width (w)
, _visual_state (Gtk::STATE_NORMAL)
, _input_icon(true)
, _output_icon(false)
{
_vbox.show ();
@ -109,18 +115,37 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo
if (_processor) {
_vbox.pack_start (_routing_icon);
_vbox.pack_start (_input_icon);
_vbox.pack_start (_button, true, true);
_vbox.pack_end (_output_icon);
_button.set_active (_processor->active());
_routing_icon.set_no_show_all(true);
_input_icon.set_no_show_all(true);
_button.show ();
_routing_icon.set_visible(false);
_input_icon.hide();
_output_icon.show();
_processor->ActiveChanged.connect (active_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_active_changed, this), gui_context());
_processor->PropertyChanged.connect (name_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_property_changed, this, _1), gui_context());
_processor->ConfigurationChanged.connect (config_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_configuration_changed, this, _1, _2), gui_context());
set<Evoral::Parameter> p = _processor->what_can_be_automated ();
for (set<Evoral::Parameter>::iterator i = p.begin(); i != p.end(); ++i) {
Control* c = new Control (_processor->automation_control (*i), _processor->describe_parameter (*i));
std::string label = _processor->describe_parameter (*i);
if (boost::dynamic_pointer_cast<Send> (_processor)) {
label = _("Send");
} else if (boost::dynamic_pointer_cast<Return> (_processor)) {
label = _("Return");
}
Control* c = new Control (_processor->automation_control (*i), label);
_controls.push_back (c);
@ -128,13 +153,14 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo
/* Add non-Amp controls to the processor box */
_vbox.pack_start (c->box);
}
if (boost::dynamic_pointer_cast<Send> (_processor)) {
/* Don't label send faders */
c->hide_label ();
}
}
_input_icon.set_ports(_processor->input_streams());
_output_icon.set_ports(_processor->output_streams());
_routing_icon.set_sources(_processor->input_streams());
_routing_icon.set_sinks(_processor->output_streams());
setup_tooltip ();
setup_visuals ();
} else {
@ -168,9 +194,17 @@ ProcessorEntry::drag_text () const
}
void
ProcessorEntry::set_position (Position p)
ProcessorEntry::set_position (Position p, uint32_t num)
{
_position = p;
_position_num = num;
if (_position_num == 0 || _routing_icon.get_visible()) {
_input_icon.show();
} else {
_input_icon.hide();
}
setup_visuals ();
}
@ -245,6 +279,18 @@ ProcessorEntry::processor_property_changed (const PropertyChange& what_changed)
}
}
void
ProcessorEntry::processor_configuration_changed (const ChanCount in, const ChanCount out)
{
_input_icon.set_ports(in);
_output_icon.set_ports(out);
_routing_icon.set_sources(in);
_routing_icon.set_sinks(out);
_input_icon.queue_draw();
_output_icon.queue_draw();
_routing_icon.queue_draw();
}
void
ProcessorEntry::setup_tooltip ()
{
@ -402,18 +448,19 @@ ProcessorEntry::Control::Control (boost::shared_ptr<AutomationControl> c, string
, _adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0, 1, 0.01, 0.1)
, _slider (&_adjustment, 0, 13, false)
, _slider_persistant_tooltip (&_slider)
, _button (ArdourButton::Element (ArdourButton::Text | ArdourButton::Indicator))
, _button (ArdourButton::led_default_elements)
, _ignore_ui_adjustment (false)
, _visible (false)
, _name (n)
{
_slider.set_controllable (c);
box.set_padding(0, 0, 4, 4);
if (c->toggled()) {
_button.set_text (_name);
_button.set_led_left (true);
_button.set_name ("processor control button");
box.pack_start (_button);
box.add (_button);
_button.show ();
_button.signal_clicked.connect (sigc::mem_fun (*this, &Control::button_clicked));
@ -422,10 +469,10 @@ ProcessorEntry::Control::Control (boost::shared_ptr<AutomationControl> c, string
} else {
_slider.set_name ("PluginSlider");
_slider.set_name ("ProcessorControlSlider");
_slider.set_text (_name);
box.pack_start (_slider);
box.add (_slider);
_slider.show ();
double const lo = c->internal_to_interface (c->lower ());
@ -470,7 +517,6 @@ ProcessorEntry::Control::set_tooltip ()
string sm = Glib::Markup::escape_text (s.str());
ARDOUR_UI::instance()->set_tip (_label, sm);
_slider_persistant_tooltip.set_tip (sm);
ARDOUR_UI::instance()->set_tip (_button, sm);
}
@ -505,6 +551,7 @@ ProcessorEntry::Control::button_clicked ()
c->set_value (n ? 0 : 1);
_button.set_active (!n);
set_tooltip ();
}
void
@ -578,12 +625,6 @@ ProcessorEntry::Control::hide_things ()
}
}
void
ProcessorEntry::Control::hide_label ()
{
_label.hide ();
}
string
ProcessorEntry::Control::state_id () const
{
@ -593,35 +634,60 @@ ProcessorEntry::Control::state_id () const
return string_compose (X_("control %1"), c->id().to_s ());
}
BlankProcessorEntry::BlankProcessorEntry (ProcessorBox* b, Width w)
: ProcessorEntry (b, boost::shared_ptr<Processor>(), w)
{
}
PluginInsertProcessorEntry::PluginInsertProcessorEntry (ProcessorBox* b, boost::shared_ptr<ARDOUR::PluginInsert> p, Width w)
: ProcessorEntry (b, p, w)
, _plugin_insert (p)
{
p->SplittingChanged.connect (
p->PluginIoReConfigure.connect (
_splitting_connection, invalidator (*this), boost::bind (&PluginInsertProcessorEntry::plugin_insert_splitting_changed, this), gui_context()
);
_splitting_icon.set_size_request (-1, 12);
_vbox.pack_start (_splitting_icon);
_vbox.reorder_child (_splitting_icon, 0);
plugin_insert_splitting_changed ();
}
void
PluginInsertProcessorEntry::plugin_insert_splitting_changed ()
{
if (_plugin_insert->splitting ()) {
_splitting_icon.show ();
} else {
_splitting_icon.hide ();
_output_icon.set_ports(_plugin_insert->output_streams());
_routing_icon.set_splitting(_plugin_insert->splitting ());
ChanCount sources = _plugin_insert->input_streams();
ChanCount sinks = _plugin_insert->natural_input_streams();
/* replicated instances */
if (!_plugin_insert->splitting () && _plugin_insert->get_count() > 1) {
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
sinks.set(*t, sinks.get(*t) * _plugin_insert->get_count());
}
}
/* MIDI bypass */
if (_plugin_insert->natural_output_streams().n_midi() == 0 &&
_plugin_insert->output_streams().n_midi() == 1) {
sinks.set(DataType::MIDI, 1);
sources.set(DataType::MIDI, 1);
}
_input_icon.set_ports(sinks);
_routing_icon.set_sinks(sinks);
_routing_icon.set_sources(sources);
if (_plugin_insert->splitting () ||
_plugin_insert->input_streams().n_audio() < _plugin_insert->natural_input_streams().n_audio()
)
{
_routing_icon.set_size_request (-1, 7);
_routing_icon.set_visible(true);
_input_icon.show();
} else {
_routing_icon.set_visible(false);
if (_position_num != 0) {
_input_icon.hide();
}
}
_input_icon.queue_draw();
_output_icon.queue_draw();
_routing_icon.queue_draw();
}
void
@ -631,35 +697,78 @@ PluginInsertProcessorEntry::hide_things ()
plugin_insert_splitting_changed ();
}
void
PluginInsertProcessorEntry::setup_visuals ()
{
switch (_position) {
case PreFader:
_splitting_icon.set_name ("ProcessorPreFader");
break;
case Fader:
_splitting_icon.set_name ("ProcessorFader");
break;
case PostFader:
_splitting_icon.set_name ("ProcessorPostFader");
break;
}
ProcessorEntry::setup_visuals ();
}
bool
PluginInsertProcessorEntry::SplittingIcon::on_expose_event (GdkEventExpose* ev)
ProcessorEntry::PortIcon::on_expose_event (GdkEventExpose* ev)
{
cairo_t* cr = gdk_cairo_create (get_window()->gobj());
cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
cairo_clip (cr);
cairo_set_line_width (cr, 1.5);
cairo_set_line_width (cr, 5.0);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
Gtk::Allocation a = get_allocation();
double const width = a.get_width();
double const height = a.get_height();
Gdk::Color const bg = get_style()->get_bg (STATE_NORMAL);
cairo_set_source_rgb (cr, bg.get_red_p (), bg.get_green_p (), bg.get_blue_p ());
cairo_rectangle (cr, 0, 0, width, height);
cairo_fill (cr);
const double y0 = _input ? height-.5 : .5;
if (_ports.n_total() > 1) {
for (uint32_t i = 0; i < _ports.n_total(); ++i) {
if (i < _ports.n_midi()) {
cairo_set_source_rgb (cr,
UINT_RGBA_R_FLT(midi_port_color),
UINT_RGBA_G_FLT(midi_port_color),
UINT_RGBA_B_FLT(midi_port_color));
} else {
cairo_set_source_rgb (cr,
UINT_RGBA_R_FLT(audio_port_color),
UINT_RGBA_G_FLT(audio_port_color),
UINT_RGBA_B_FLT(audio_port_color));
}
const float x = rintf(width * (.2f + .6f * i / (_ports.n_total() - 1.f))) + .5f;
cairo_move_to (cr, x, y0);
cairo_close_path(cr);
cairo_stroke(cr);
}
} else if (_ports.n_total() == 1) {
if (_ports.n_midi() == 1) {
cairo_set_source_rgb (cr,
UINT_RGBA_R_FLT(midi_port_color),
UINT_RGBA_G_FLT(midi_port_color),
UINT_RGBA_B_FLT(midi_port_color));
} else {
cairo_set_source_rgb (cr,
UINT_RGBA_R_FLT(audio_port_color),
UINT_RGBA_G_FLT(audio_port_color),
UINT_RGBA_B_FLT(audio_port_color));
}
cairo_move_to (cr, rintf(width * .5) + .5f, y0);
cairo_close_path(cr);
cairo_stroke(cr);
}
cairo_destroy(cr);
return true;
}
bool
ProcessorEntry::RoutingIcon::on_expose_event (GdkEventExpose* ev)
{
cairo_t* cr = gdk_cairo_create (get_window()->gobj());
cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
cairo_clip (cr);
cairo_set_line_width (cr, 1.0);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
Gtk::Allocation a = get_allocation();
@ -675,21 +784,64 @@ PluginInsertProcessorEntry::SplittingIcon::on_expose_event (GdkEventExpose* ev)
Gdk::Color const fg = get_style()->get_fg (STATE_NORMAL);
cairo_set_source_rgb (cr, fg.get_red_p (), fg.get_green_p (), fg.get_blue_p ());
const float si_l = rint(width * 0.3) + .5;
const float si_c = rint(width * 0.5) + .5;
const float si_r = rint(width * 0.7) + .5;
const float si_m = rint(height * 0.5) + .5;
const uint32_t sources = _sources.n_total();
const uint32_t sinks = _sinks.n_total();
cairo_move_to (cr, si_l, height);
cairo_line_to (cr, si_l, si_m);
cairo_line_to (cr, si_r, si_m);
cairo_line_to (cr, si_r, height);
/* MIDI */
const uint32_t midi_sources = _sources.n_midi();
const uint32_t midi_sinks = _sinks.n_midi();
cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT);
cairo_move_to (cr, si_c, si_m);
cairo_line_to (cr, si_c, 0);
cairo_stroke (cr);
cairo_set_source_rgb (cr,
UINT_RGBA_R_FLT(midi_port_color),
UINT_RGBA_G_FLT(midi_port_color),
UINT_RGBA_B_FLT(midi_port_color));
if (midi_sources > 0 && midi_sinks > 0 && sinks > 1 && sources > 1) {
for (uint32_t i = 0 ; i < midi_sources; ++i) {
const float si_x = rintf(width * (.2f + .6f * i / (sinks - 1.f))) + .5f;
const float si_x0 = rintf(width * (.2f + .6f * i / (sources - 1.f))) + .5f;
cairo_move_to (cr, si_x, height);
cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0);
cairo_stroke (cr);
}
} else if (midi_sources == 1 && midi_sinks == 1 && sinks == 1 && sources == 1) {
const float si_x = rintf(width * .5f) + .5f;
cairo_move_to (cr, si_x, height);
cairo_line_to (cr, si_x, 0);
cairo_stroke (cr);
}
/* AUDIO */
const uint32_t audio_sources = _sources.n_audio();
const uint32_t audio_sinks = _sinks.n_audio();
cairo_set_source_rgb (cr,
UINT_RGBA_R_FLT(audio_port_color),
UINT_RGBA_G_FLT(audio_port_color),
UINT_RGBA_B_FLT(audio_port_color));
if (_splitting) {
assert(audio_sinks > 1);
const float si_x0 = rintf(width * .5f) + .5f;
for (uint32_t i = midi_sinks; i < sinks; ++i) {
const float si_x = rintf(width * (.2f + .6f * i / (sinks - 1.f))) + .5f;
cairo_move_to (cr, si_x, height);
cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0);
cairo_stroke (cr);
}
} else if (audio_sources > 1) {
for (uint32_t i = 0 ; i < audio_sources; ++i) {
const float si_x = rintf(width * (.2f + .6f * (i + midi_sinks) / (sinks - 1.f))) + .5f;
const float si_x0 = rintf(width * (.2f + .6f * (i + midi_sources) / (sources - 1.f))) + .5f;
cairo_move_to (cr, si_x, height);
cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0);
cairo_stroke (cr);
}
} else if (audio_sources == 1 && audio_sinks == 1) {
const float si_x = rintf(width * .5f) + .5f;
cairo_move_to (cr, si_x, height);
cairo_line_to (cr, si_x, 0);
cairo_stroke (cr);
}
cairo_destroy(cr);
return true;
}
@ -719,7 +871,7 @@ ProcessorBox::ProcessorBox (ARDOUR::Session* sess, boost::function<PluginSelecto
processor_display.set_name ("ProcessorList");
processor_display.set_data ("processorbox", this);
processor_display.set_size_request (48, -1);
processor_display.set_spacing (2);
processor_display.set_spacing (0);
processor_display.signal_enter_notify_event().connect (sigc::mem_fun(*this, &ProcessorBox::enter_notify), false);
processor_display.signal_leave_notify_event().connect (sigc::mem_fun(*this, &ProcessorBox::leave_notify), false);
@ -803,10 +955,6 @@ ProcessorBox::object_drop(DnDVBox<ProcessorEntry>* source, ProcessorEntry* posit
`dropped on' processor */
list<ProcessorEntry*> c = processor_display.children ();
list<ProcessorEntry*>::iterator i = c.begin ();
while (dynamic_cast<BlankProcessorEntry*> (*i)) {
assert (i != c.end ());
++i;
}
assert (i != c.end ());
p = (*i)->processor ();
@ -1385,14 +1533,9 @@ ProcessorBox::redisplay_processors ()
_route->foreach_processor (sigc::bind (sigc::mem_fun (*this, &ProcessorBox::help_count_visible_prefader_processors),
&_visible_prefader_processors, &fader_seen));
if (_visible_prefader_processors == 0) { // fader only
BlankProcessorEntry* bpe = new BlankProcessorEntry (this, _width);
processor_display.add_child (bpe);
}
_route->foreach_processor (sigc::mem_fun (*this, &ProcessorBox::add_processor_to_display));
for (list<ProcessorWindowProxy*>::iterator i = _processor_window_info.begin(); i != _processor_window_info.end(); ++i) {
for (ProcessorWindowProxies::iterator i = _processor_window_info.begin(); i != _processor_window_info.end(); ++i) {
(*i)->marked = false;
}
@ -1400,16 +1543,43 @@ ProcessorBox::redisplay_processors ()
/* trim dead wood from the processor window proxy list */
list<ProcessorWindowProxy*>::iterator i = _processor_window_info.begin();
ProcessorWindowProxies::iterator i = _processor_window_info.begin();
while (i != _processor_window_info.end()) {
list<ProcessorWindowProxy*>::iterator j = i;
ProcessorWindowProxies::iterator j = i;
++j;
if (!(*i)->marked) {
if (!(*i)->valid()) {
WM::Manager::instance().remove (*i);
delete *i;
_processor_window_info.erase (i);
}
} else if (!(*i)->marked) {
/* this processor is no longer part of this processor
* box.
*
* that could be because it was deleted or it could be
* because the route being displayed in the parent
* strip changed.
*
* The latter only happens with the editor mixer strip.
*/
if (is_editor_mixer_strip()) {
/* editor mixer strip .. DO NOTHING
*
* note: the processor window stays visible if
* it is already visible
*/
} else {
(*i)->hide ();
WM::Manager::instance().remove (*i);
delete *i;
_processor_window_info.erase (i);
}
}
i = j;
}
@ -1428,7 +1598,7 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr<Processor> w)
return;
}
list<ProcessorWindowProxy*>::iterator i = _processor_window_info.begin ();
ProcessorWindowProxies::iterator i = _processor_window_info.begin ();
while (i != _processor_window_info.end()) {
boost::shared_ptr<Processor> t = (*i)->processor().lock ();
@ -1543,15 +1713,16 @@ ProcessorBox::setup_entry_positions ()
list<ProcessorEntry*> children = processor_display.children ();
bool pre_fader = true;
uint32_t num = 0;
for (list<ProcessorEntry*>::iterator i = children.begin(); i != children.end(); ++i) {
if (boost::dynamic_pointer_cast<Amp>((*i)->processor())) {
pre_fader = false;
(*i)->set_position (ProcessorEntry::Fader);
(*i)->set_position (ProcessorEntry::Fader, num++);
} else {
if (pre_fader) {
(*i)->set_position (ProcessorEntry::PreFader);
(*i)->set_position (ProcessorEntry::PreFader, num++);
} else {
(*i)->set_position (ProcessorEntry::PostFader);
(*i)->set_position (ProcessorEntry::PostFader, num++);
}
}
}
@ -2077,6 +2248,18 @@ ProcessorBox::get_editor_window (boost::shared_ptr<Processor> processor, bool us
boost::shared_ptr<PortInsert> port_insert;
Window* gidget = 0;
/* This method may or may not return a Window, but if it does not it
* will modify the parent mixer strip appearance layout to allow
* "editing" the @param processor that was passed in.
*
* So for example, if the processor is an Amp (gain), the parent strip
* will be forced back into a model where the fader controls the main gain.
* If the processor is a send, then we map the send controls onto the
* strip.
*
* Plugins and others will return a window for control.
*/
if (boost::dynamic_pointer_cast<AudioTrack>(_route) != 0) {
if (boost::dynamic_pointer_cast<AudioTrack> (_route)->freeze_state() == AudioTrack::Frozen) {
@ -2554,7 +2737,13 @@ ProcessorBox::generate_processor_title (boost::shared_ptr<PluginInsert> pi)
maker += " ...";
}
return string_compose(_("%1: %2 (by %3)"), _route->name(), pi->name(), maker);
SessionObject* owner = pi->owner();
if (owner) {
return string_compose(_("%1: %2 (by %3)"), owner->name(), pi->name(), maker);
} else {
return string_compose(_("%1 (by %2)"), pi->name(), maker);
}
}
/** @param p Processor.
@ -2667,6 +2856,12 @@ ProcessorBox::update_gui_object_state (ProcessorEntry* entry)
entry->add_control_state (proc);
}
bool
ProcessorBox::is_editor_mixer_strip() const
{
return _parent_strip && !_parent_strip->mixer_owned();
}
ProcessorWindowProxy::ProcessorWindowProxy (string const & name, ProcessorBox* box, boost::weak_ptr<Processor> processor)
: WM::ProxyBase (name, string())
, marked (false)
@ -2674,8 +2869,34 @@ ProcessorWindowProxy::ProcessorWindowProxy (string const & name, ProcessorBox* b
, _processor (processor)
, is_custom (false)
, want_custom (false)
, _valid (true)
{
boost::shared_ptr<Processor> p = _processor.lock ();
if (!p) {
return;
}
p->DropReferences.connect (going_away_connection, MISSING_INVALIDATOR, boost::bind (&ProcessorWindowProxy::processor_going_away, this), gui_context());
}
ProcessorWindowProxy::~ProcessorWindowProxy()
{
/* processor window proxies do not own the windows they create with
* ::get(), so set _window to null before the normal WindowProxy method
* deletes it.
*/
_window = 0;
}
void
ProcessorWindowProxy::processor_going_away ()
{
delete _window;
_window = 0;
_valid = false;
/* should be no real reason to do this, since the object that would
send DropReferences is about to be deleted, but lets do it anyway.
*/
going_away_connection.disconnect();
}
ARDOUR::SessionHandlePtr*
@ -2685,6 +2906,12 @@ ProcessorWindowProxy::session_handle()
return 0;
}
bool
ProcessorWindowProxy::valid() const
{
return _valid;
}
XMLNode&
ProcessorWindowProxy::get_state () const
{

View File

@ -79,6 +79,7 @@ class ProcessorWindowProxy : public WM::ProxyBase
{
public:
ProcessorWindowProxy (std::string const &, ProcessorBox *, boost::weak_ptr<ARDOUR::Processor>);
~ProcessorWindowProxy();
Gtk::Window* get (bool create = false);
@ -91,6 +92,7 @@ class ProcessorWindowProxy : public WM::ProxyBase
void set_custom_ui_mode(bool use_custom) { want_custom = use_custom; }
bool marked;
bool valid () const;
void set_state (const XMLNode&);
XMLNode& get_state () const;
@ -100,6 +102,10 @@ class ProcessorWindowProxy : public WM::ProxyBase
boost::weak_ptr<ARDOUR::Processor> _processor;
bool is_custom;
bool want_custom;
bool _valid;
void processor_going_away ();
PBD::ScopedConnection going_away_connection;
};
class ProcessorEntry : public Gtkmm2ext::DnDVBoxChild, public sigc::trackable
@ -119,7 +125,7 @@ public:
PostFader
};
void set_position (Position);
void set_position (Position, uint32_t);
boost::shared_ptr<ARDOUR::Processor> processor () const;
void set_enum_width (Width);
@ -137,6 +143,7 @@ protected:
ArdourButton _button;
Gtk::VBox _vbox;
Position _position;
uint32_t _position_num;
virtual void setup_visuals ();
@ -144,6 +151,7 @@ private:
void led_clicked();
void processor_active_changed ();
void processor_property_changed (const PBD::PropertyChange&);
void processor_configuration_changed (const ARDOUR::ChanCount in, const ARDOUR::ChanCount out);
std::string name (Width) const;
void setup_tooltip ();
@ -153,6 +161,7 @@ private:
Gtk::StateType _visual_state;
PBD::ScopedConnection active_connection;
PBD::ScopedConnection name_connection;
PBD::ScopedConnection config_connection;
class Control : public sigc::trackable {
public:
@ -162,7 +171,6 @@ private:
void add_state (XMLNode *) const;
void set_state (XMLNode const *);
void hide_things ();
void hide_label ();
bool visible () const {
return _visible;
@ -172,7 +180,7 @@ private:
return _name;
}
Gtk::VBox box;
Gtk::Alignment box;
private:
void slider_adjusted ();
@ -185,7 +193,6 @@ private:
/* things for a slider */
Gtk::Adjustment _adjustment;
Gtkmm2ext::HSliderController _slider;
Gtk::Label _label;
Gtkmm2ext::PersistentTooltip _slider_persistant_tooltip;
/* things for a button */
ArdourButton _button;
@ -198,12 +205,43 @@ private:
std::list<Control*> _controls;
void toggle_control_visibility (Control *);
};
class BlankProcessorEntry : public ProcessorEntry
{
public:
BlankProcessorEntry (ProcessorBox *, Width w);
class PortIcon : public Gtk::DrawingArea {
public:
PortIcon(bool input) {
_input = input;
_ports = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 1);
set_size_request (-1, 3);
}
void set_ports(ARDOUR::ChanCount const ports) { _ports = ports; }
private:
bool on_expose_event (GdkEventExpose *);
bool _input;
ARDOUR::ChanCount _ports;
};
class RoutingIcon : public Gtk::DrawingArea {
public:
RoutingIcon() {
_sources = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 1);
_sinks = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 1);
_splitting = false;
set_size_request (-1, 4);
}
void set_sources(ARDOUR::ChanCount const sources) { _sources = sources; }
void set_sinks(ARDOUR::ChanCount const sinks) { _sinks = sinks; }
void set_splitting(const bool splitting) { _splitting = splitting; }
private:
bool on_expose_event (GdkEventExpose *);
ARDOUR::ChanCount _sources; // signals available to feed into the processor(s)
ARDOUR::ChanCount _sinks; // combined number of outputs of the processor
bool _splitting;
};
protected:
RoutingIcon _routing_icon;
PortIcon _input_icon;
PortIcon _output_icon;
};
class PluginInsertProcessorEntry : public ProcessorEntry
@ -214,17 +252,9 @@ public:
void hide_things ();
private:
void setup_visuals ();
void plugin_insert_splitting_changed ();
/* XXX: this seems a little ridiculous just for a simple scaleable icon */
class SplittingIcon : public Gtk::DrawingArea {
private:
bool on_expose_event (GdkEventExpose *);
};
boost::shared_ptr<ARDOUR::PluginInsert> _plugin_insert;
SplittingIcon _splitting_icon;
PBD::ScopedConnection _splitting_connection;
};
@ -303,6 +333,8 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
void route_going_away ();
bool is_editor_mixer_strip() const;
Gtkmm2ext::DnDVBox<ProcessorEntry> processor_display;
Gtk::ScrolledWindow processor_scroller;
@ -404,7 +436,9 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
void route_property_changed (const PBD::PropertyChange&);
std::string generate_processor_title (boost::shared_ptr<ARDOUR::PluginInsert> pi);
std::list<ProcessorWindowProxy*> _processor_window_info;
typedef std::list<ProcessorWindowProxy*> ProcessorWindowProxies;
ProcessorWindowProxies _processor_window_info;
ProcessorWindowProxy* find_window_proxy (boost::shared_ptr<ARDOUR::Processor>) const;
void set_processor_ui (boost::shared_ptr<ARDOUR::Processor>, Gtk::Window *);
@ -416,6 +450,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD
void mixer_strip_delivery_changed (boost::weak_ptr<ARDOUR::Delivery>);
XMLNode* entry_gui_object_state (ProcessorEntry *);
PBD::ScopedConnection amp_config_connection;
};
#endif /* __ardour_gtk_processor_box__ */

View File

@ -299,8 +299,8 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
virtual void set_xjadeo_sensitive (bool onoff) = 0;
virtual int get_videotl_bar_height () const = 0;
virtual void set_video_timeline_height (const int h) = 0;
virtual void embed_audio_from_video (std::string, framepos_t n = 0) = 0;
virtual void export_video () = 0;
virtual void embed_audio_from_video (std::string, framepos_t n = 0, bool lock_position_to_video = true) = 0;
virtual void export_video (bool range = false) = 0;
virtual RouteTimeAxisView* get_route_view_by_route_id (const PBD::ID& id) const = 0;

View File

@ -648,6 +648,7 @@ class ControlSurfacesOptions : public OptionEditorBox
public:
ControlSurfacesOptions (Gtk::Window& parent)
: _parent (parent)
, _ignore_view_change (0)
{
_store = ListStore::create (_model);
_view.set_model (_store);
@ -700,9 +701,14 @@ private:
void protocol_status_changed (ControlProtocolInfo* cpi) {
/* find the row */
TreeModel::Children rows = _store->children();
for (TreeModel::Children::iterator x = rows.begin(); x != rows.end(); ++x) {
string n = ((*x)[_model.name]);
if ((*x)[_model.protocol_info] == cpi) {
_ignore_view_change++;
(*x)[_model.enabled] = (cpi->protocol || cpi->requested);
_ignore_view_change--;
break;
}
}
@ -712,6 +718,10 @@ private:
{
TreeModel::Row r = *i;
if (_ignore_view_change) {
return;
}
ControlProtocolInfo* cpi = r[_model.protocol_info];
if (!cpi) {
return;
@ -720,22 +730,23 @@ private:
bool const was_enabled = (cpi->protocol != 0);
bool const is_enabled = r[_model.enabled];
if (was_enabled != is_enabled) {
if (!was_enabled) {
ControlProtocolManager::instance().instantiate (*cpi);
ControlProtocolManager::instance().activate (*cpi);
} else {
Gtk::Window* win = r[_model.editor];
if (win) {
win->hide ();
}
ControlProtocolManager::instance().teardown (*cpi);
ControlProtocolManager::instance().deactivate (*cpi);
if (win) {
delete win;
r[_model.editor] = 0;
}
r[_model.editor] = 0;
cpi->requested = false;
}
}
@ -805,6 +816,7 @@ private:
TreeView _view;
Gtk::Window& _parent;
PBD::ScopedConnection protocol_status_connection;
uint32_t _ignore_view_change;
};
class VideoTimelineOptions : public OptionEditorBox
@ -1414,14 +1426,6 @@ RCOptionEditor::RCOptionEditor ()
sigc::mem_fun (*_rc_config, &RCConfiguration::set_update_editor_during_summary_drag)
));
add_option (_("Editor"),
new BoolOption (
"sync-all-route-ordering",
_("Synchronise editor and mixer track order"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_sync_all_route_ordering),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_sync_all_route_ordering)
));
add_option (_("Editor"),
new BoolOption (
"link-editor-and-mixer-selection",
@ -1830,7 +1834,6 @@ RCOptionEditor::RCOptionEditor ()
rm->add (UserOrdered, _("assigned by user"));
rm->add (MixerOrdered, _("follows order of mixer"));
rm->add (EditorOrdered, _("follows order of editor"));
add_option (_("Control Surfaces"), rm);

View File

@ -42,7 +42,7 @@ ReturnUI::ReturnUI (Gtk::Window* parent, boost::shared_ptr<Return> r, Session* s
_gpm.set_controls (boost::shared_ptr<Route>(), r->meter(), r->amp());
_hbox.pack_start (_gpm, true, true);
set_name ("ReturnUIFrame");
set_name (X_("ReturnUIFrame"));
_vbox.set_spacing (5);
_vbox.set_border_width (5);
@ -61,7 +61,7 @@ ReturnUI::ReturnUI (Gtk::Window* parent, boost::shared_ptr<Return> r, Session* s
_return->input()->changed.connect (input_change_connection, invalidator (*this), boost::bind (&ReturnUI::ins_changed, this, _1, _2), gui_context());
_gpm.setup_meters ();
_gpm.set_fader_name ("ReturnUIFrame");
_gpm.set_fader_name (X_("ReturnUIFader"));
// screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (sigc::mem_fun (*this, &ReturnUI::update));
fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (sigc::mem_fun (*this, &ReturnUI::fast_update));

View File

@ -2266,6 +2266,8 @@ RouteTimeAxisView::meter_changed ()
if (_route && !no_redraw) {
request_redraw ();
}
// reset peak when meter point changes
gm.reset_peak_display();
}
void

View File

@ -1815,10 +1815,9 @@ RouteUI::open_remote_control_id_dialog ()
_route->remote_control_id(),
(_route->is_master() ? _("the master bus") : _("the monitor bus"))));
} else {
l->set_markup (string_compose (_("The remote control ID of %6 is: %3\n\n\n"
"Remote Control IDs are currently determined by track/bus ordering in %1\n\n"
"%4Use the User Interaction tab of the Preferences window if you want to change this%5"),
(Config->get_remote_model() == MixerOrdered ? _("the mixer") : _("the editor")),
l->set_markup (string_compose (_("The remote control ID of %5 is: %2\n\n\n"
"Remote Control IDs are currently determined by track/bus ordering in Ardour.\n\n"
"%3Use the User Interaction tab of the Preferences window if you want to change this%4"),
(is_track() ? _("track") : _("bus")),
_route->remote_control_id(),
"<span size=\"small\" style=\"italic\">",

View File

@ -46,7 +46,7 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session
_gpm.set_controls (boost::shared_ptr<Route>(), s->meter(), s->amp());
_hbox.pack_start (_gpm, true, true);
set_name ("SendUIFrame");
set_name (X_("SendUIFrame"));
_vbox.set_spacing (5);
_vbox.set_border_width (5);
@ -77,7 +77,7 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session
_panners.setup_pan ();
_gpm.setup_meters ();
_gpm.set_fader_name ("SendUIFrame");
_gpm.set_fader_name (X_("SendUIFader"));
// screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (
// sigc::mem_fun (*this, &SendUI::update));

View File

@ -74,11 +74,6 @@ SessionDialog::SessionDialog (bool require_new, const std::string& session_name,
, _master_bus_channel_count_adj (2, 0, 100, 1, 10, 0)
, _existing_session_chooser_used (false)
{
if (!session_name.empty() && !require_new) {
response (RESPONSE_OK);
return;
}
set_keep_above (true);
set_position (WIN_POS_CENTER);
get_vbox()->set_spacing (6);
@ -143,12 +138,32 @@ SessionDialog::SessionDialog (bool require_new, const std::string& session_name,
recent_label.hide ();
}
}
/* possibly get out of here immediately if everything is ready to go.
We still need to set up the whole dialog because of the way
ARDOUR_UI::get_session_parameters() might skip it on a first
pass then require it for a second pass (e.g. when there
is an error with session loading and we have to ask the user
what to do next).
*/
if (!session_name.empty() && !require_new) {
response (RESPONSE_OK);
return;
}
}
SessionDialog::~SessionDialog()
{
}
void
SessionDialog::clear_given ()
{
_provided_session_path = "";
_provided_session_name = "";
}
bool
SessionDialog::use_session_template ()
{
@ -222,12 +237,16 @@ SessionDialog::session_folder ()
TreeIter iter = recent_session_display.get_selection()->get_selected();
if (iter) {
return (*iter)[recent_session_columns.fullpath];
string s = (*iter)[recent_session_columns.fullpath];
if (Glib::file_test (s, Glib::FILE_TEST_IS_REGULAR)) {
return Glib::path_get_dirname (s);
}
return s;
}
if (_existing_session_chooser_used) {
/* existing session chosen from file chooser */
return existing_session_chooser.get_current_folder ();
return Glib::path_get_dirname (existing_session_chooser.get_current_folder ());
} else {
std::string legal_session_folder_name = legalize_for_path (new_name_entry.get_text());
return Glib::build_filename (new_folder_chooser.get_current_folder(), legal_session_folder_name);
@ -252,7 +271,9 @@ SessionDialog::setup_initial_choice_box ()
ic_new_session_button.signal_clicked().connect (sigc::mem_fun (*this, &SessionDialog::new_session_button_clicked));
Gtk::HBox* hbox = manage (new HBox);
Gtk::VBox* vbox = manage (new VBox);
hbox->set_spacing (12);
vbox->set_spacing (12);
string image_path;
@ -262,9 +283,10 @@ SessionDialog::setup_initial_choice_box ()
hbox->pack_start (*image, false, false);
}
}
hbox->pack_start (ic_new_session_button, true, true);
vbox->pack_start (ic_new_session_button, true, true, 20);
hbox->pack_start (*vbox, true, true, 20);
centering_vbox->pack_start (*hbox, false, false);
/* Possible update message */

View File

@ -51,9 +51,11 @@ class SessionDialog : public ArdourDialog {
const std::string& template_name, bool cancel_not_quit);
~SessionDialog ();
void clear_given ();
std::string session_name (bool& should_be_new);
std::string session_folder ();
bool use_session_template();
std::string session_template_name();

View File

@ -318,6 +318,13 @@ SessionOptionEditor::SessionOptionEditor (Session* s)
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_solo_on_meterbridge)
));
add_option (_("Meterbridge"), new BoolOption (
"show-monitor-on-meterbridge",
_("Monitor Buttons"),
sigc::mem_fun (*_session_config, &SessionConfiguration::get_show_monitor_on_meterbridge),
sigc::mem_fun (*_session_config, &SessionConfiguration::set_show_monitor_on_meterbridge)
));
add_option (_("Meterbridge"), new OptionEditorHeading (_("Name Labels")));
add_option (_("Meterbridge"), new BoolOption (

View File

@ -707,7 +707,7 @@ SoundFileBrowser::add_gain_meter ()
boost::shared_ptr<Route> r = _session->the_auditioner ();
gm->set_controls (r, r->shared_peak_meter(), r->amp());
gm->set_fader_name (X_("AudioTrackFader"));
gm->set_fader_name (X_("GainFader"));
meter_packer.set_border_width (12);
meter_packer.pack_start (*gm, false, true);

View File

@ -243,6 +243,7 @@ Where would you like new %1 sessions to be stored by default?\n\n\
vbox->pack_start (*txt, false, false);
vbox->pack_start (*hbox, false, true);
cerr << "set default folder to " << poor_mans_glob (Config->get_default_session_parent_dir()) << endl;
default_dir_chooser->set_current_folder (poor_mans_glob (Config->get_default_session_parent_dir()));
default_dir_chooser->signal_current_folder_changed().connect (sigc::mem_fun (*this, &ArdourStartup::default_dir_changed));
default_dir_chooser->show ();

View File

@ -37,7 +37,7 @@
#include "region_selection.h"
#ifdef USE_RUBBERBAND
#include "rubberband/RubberBandStretcher.h"
#include <rubberband/RubberBandStretcher.h>
using namespace RubberBand;
#endif

View File

@ -133,7 +133,7 @@ VideoServerDialog::VideoServerDialog (Session* s)
t->attach (cachesize_spinner, 1, 2, 2, 3);
l = manage (new Label (string_compose(
_("%1 relies on an external Video Server for the videotimeline.\nThe server configured in Edit -> Prefereces -> Video is not reachable.\nDo you want ardour to launch 'harvid' on this machine?"), PROGRAM_NAME)
_("%1 relies on an external video server for the videotimeline.\nThe server configured in Edit -> Preferences -> Video is not reachable.\nDo you want %1 to launch 'harvid' on this machine?"), PROGRAM_NAME)
, Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
l->set_max_width_chars(80);
l->set_line_wrap();

View File

@ -194,6 +194,7 @@ ProxyBase::ProxyBase (const string& name, const std::string& menu_name, const XM
ProxyBase::~ProxyBase ()
{
delete vistracker;
delete _window;
}
void
@ -348,7 +349,7 @@ ProxyBase::setup ()
assert (_window);
vistracker = new Gtkmm2ext::VisibilityTracker (*_window);
_window->signal_delete_event().connect (sigc::mem_fun (*this, &ProxyBase::handle_win_event));
_window->signal_delete_event().connect (sigc::mem_fun (*this, &ProxyBase::delete_event_handler));
if (_width != -1 || _height != -1 || _x_off != -1 || _y_off != -1) {
/* cancel any mouse-based positioning */
@ -368,8 +369,9 @@ ProxyBase::setup ()
void
ProxyBase::show ()
{
Gtk::Window* win = get (true);
win->show ();
get (true);
assert (_window);
_window->show ();
}
void
@ -383,17 +385,19 @@ ProxyBase::maybe_show ()
void
ProxyBase::show_all ()
{
Gtk::Window* win = get (true);
win->show_all ();
get (true);
assert (_window);
_window->show_all ();
}
void
ProxyBase::present ()
{
Gtk::Window* win = get (true);
win->show_all ();
win->present ();
get (true);
assert (_window);
_window->show_all ();
_window->present ();
/* turn off any mouse-based positioning */
_window->set_position (Gtk::WIN_POS_NONE);
@ -402,15 +406,14 @@ ProxyBase::present ()
void
ProxyBase::hide ()
{
Gtk::Window* win = get (false);
if (win) {
if (_window) {
save_pos_and_size();
win->hide ();
_window->hide ();
}
}
bool
ProxyBase::handle_win_event (GdkEventAny* /*ev*/)
ProxyBase::delete_event_handler (GdkEventAny* /*ev*/)
{
hide();
return true;
@ -419,10 +422,9 @@ ProxyBase::handle_win_event (GdkEventAny* /*ev*/)
void
ProxyBase::save_pos_and_size ()
{
Gtk::Window* win = get (false);
if (win) {
win->get_position (_x_off, _y_off);
win->get_size (_width, _height);
if (_window) {
_window->get_position (_x_off, _y_off);
_window->get_size (_width, _height);
}
}
/*-----------------------*/

View File

@ -122,7 +122,7 @@ class ProxyBase : public ARDOUR::SessionHandlePtr, public sigc::trackable {
Gtkmm2ext::VisibilityTracker* vistracker;
void save_pos_and_size ();
bool handle_win_event (GdkEventAny *ev);
bool delete_event_handler (GdkEventAny *ev);
void setup ();
};

View File

@ -273,6 +273,8 @@ def configure(conf):
# TODO: Insert a sanity check for on OS X to ensure CoreAudio is present
autowaf.check_pkg(conf, 'fftw3f', uselib_store='FFTW3F',
mandatory=True)
autowaf.check_pkg(conf, 'flac', uselib_store='FLAC',
atleast_version='1.2.1')
autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
@ -368,23 +370,26 @@ def build(bld):
if bld.is_defined('WINDOWS_VST_SUPPORT'):
# If we require VST support we build a stub main() and the FST library
# here using winegcc, and link it to the GTK front-end library
obj = bld(features = 'cxx c cxxprogram wine')
obj.source = '''
../libs/fst/fst.c
../libs/fst/fstinfofile.c
../libs/fst/vsti.c
../libs/fst/vstwin.c
../vst/winmain.c
'''
obj.uselib = 'ALSA'
obj = bld (features = 'cxx c cxxprogram wine')
obj.source = (
'../libs/fst/fst.c',
'../libs/fst/fstinfofile.c',
'../libs/fst/vsti.c',
'../libs/fst/vstwin.c',
'../vst/winmain.c',
)
#
# XXX do we really need to explicitly link to all of these for the wine executable?
#
obj.use = [ 'libpbd',
'libmidipp',
'libtaglib',
'libardour',
'libardour_cp',
'libtimecode',
'libmidipp',
'libgtk2_ardour',
'libgtkmm2ext',
'libtaglib']
]
obj.target = 'ardour-' + bld.env['VERSION'] + '-vst.exe.so'
obj.includes = [ '../libs/fst', '.' ]
obj.linkflags = ['-mwindows', '-Wl,--export-dynamic']
@ -400,26 +405,33 @@ def build(bld):
obj.target = 'gtk2_ardour'
else:
# just the normal executable version of the GTK GUI
obj = bld(features = 'cxx c cxxprogram')
obj = bld (features = 'cxx c cxxprogram')
obj.source = gtk2_ardour_sources
obj.target = 'ardour-' + bld.env['VERSION']
obj.includes = ['.']
# at this point, "obj" refers to either the normal native executable
# OR the shared library built for use with wine on linux.
obj.use = [ 'libpbd',
'libardour',
'libardour_cp',
'libtimecode',
'libmidipp',
'libgtkmm2ext',
]
# continue with setup of obj, which could be a shared library
# or an executable.
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG ALSA CURL DL'
obj.uselib += ' GTKMM GNOMECANVASMM GNOMECANVAS '
obj.uselib = 'UUID FLAC FONTCONFIG GLIBMM GTHREAD GTK OGG CURL DL'
obj.uselib += ' GTKMM GNOMECANVASMM GNOMECANVAS FFTW3F'
obj.uselib += ' AUDIOUNITS OSX GTKOSX LO '
obj.use = [ 'libpbd',
'libmidipp',
'libtaglib',
'ardour',
'libardour_cp',
'libgtkmm2ext',
'libtaglib' ]
if bld.is_defined('USE_EXTERNAL_LIBS'):
obj.uselib += ' TAGLIB'
else:
obj.use += ('libtaglib')
if sys.platform == 'darwin':
obj.use += ' libappleutility'
obj.defines = [
@ -646,7 +658,7 @@ def build(bld):
# Menus
menus_argv = []
if bld.is_defined('GTKOSX'):
menus_argv = [ '-E', '-P', '-DGTKOSX', '-DNOVIDEOTIMELINE' ]
menus_argv = [ '-E', '-P', '-DGTKOSX' ]
else:
menus_argv = [ '-E', '-P' ]

View File

@ -60,7 +60,7 @@ namespace ARDOUR {
*/
bool init (bool with_vst, bool try_optimization, const char* localedir);
void init_post_engine ();
int cleanup ();
void cleanup ();
bool no_auto_connect ();
void make_property_quarks ();

View File

@ -117,6 +117,17 @@ class AudioBackend : public PortEngine {
* at any time.
*/
virtual std::vector<float> available_sample_rates (const std::string& device) const = 0;
/* Returns the default sample rate that will be shown to the user when
* configuration options are first presented. If the derived class
* needs or wants to override this, it can. It also MUST override this
* if there is any chance that an SR of 44.1kHz is not in the list
* returned by available_sample_rates()
*/
virtual float default_sample_rate () const {
return 44100.0;
}
/** Returns a collection of uint32 identifying buffer sizes that are
* potentially usable with the hardware identified by @param device.
* Any of these values may be supplied in other calls to this backend
@ -126,6 +137,16 @@ class AudioBackend : public PortEngine {
*/
virtual std::vector<uint32_t> available_buffer_sizes (const std::string& device) const = 0;
/* Returns the default buffer size that will be shown to the user when
* configuration options are first presented. If the derived class
* needs or wants to override this, it can. It also MUST override this
* if there is any chance that a buffer size of 1024 is not in the list
* returned by available_buffer_sizes()
*/
virtual uint32_t default_buffer_size () const {
return 1024;
}
/** Returns the maximum number of input channels that are potentially
* usable with the hardware identified by @param device. Any number from 1
* to the value returned may be supplied in other calls to this backend as
@ -239,8 +260,29 @@ class AudioBackend : public PortEngine {
* app is undefined or cannot be launched.
*/
virtual void launch_control_app () = 0;
/* Basic state control */
/* @return a vector of strings that describe the available
* MIDI options.
*
* These can be presented to the user to decide which
* MIDI drivers, options etc. can be used. The returned strings
* should be thought of as the key to a map of possible
* approaches to handling MIDI within the backend. Ensure that
* the strings will make sense to the user.
*/
virtual std::vector<std::string> enumerate_midi_options () const = 0;
/* Request the use of the MIDI option named @param option, which
* should be one of the strings returned by enumerate_midi_options()
*
* @return zero if successful, non-zero otherwise
*/
virtual int set_midi_option (const std::string& option) = 0;
virtual std::string midi_option () const = 0;
/* State Control */
/** Start using the device named in the most recent call
* to set_device(), with the parameters set by various
* the most recent calls to set_sample_rate() etc. etc.
@ -250,9 +292,30 @@ class AudioBackend : public PortEngine {
* the AudioEngine referenced by @param engine. These calls will
* occur in a thread created by and/or under the control of the backend.
*
* @param for_latency_measurement if true, the device is being started
* to carry out latency measurements and the backend should this
* take care to return latency numbers that do not reflect
* any existing systemic latency settings.
*
* Return zero if successful, negative values otherwise.
*/
virtual int start () = 0;
*
*
*
*
* Why is this non-virtual but ::_start() is virtual ?
* Virtual methods with default parameters create possible ambiguity
* because a derived class may implement the same method with a different
* type or value of default parameter.
*
* So we make this non-virtual method to avoid possible overrides of
* default parameters. See Scott Meyers or other books on C++ to understand
* this pattern, or possibly just this:
*
* http://stackoverflow.com/questions/12139786/good-pratice-default-arguments-for-pure-virtual-method
*/
int start (bool for_latency_measurement=false) {
return _start (for_latency_measurement);
}
/** Stop using the device currently in use.
*
@ -270,20 +333,6 @@ class AudioBackend : public PortEngine {
*/
virtual int stop () = 0;
/** Temporarily cease using the device named in the most recent call to set_parameters().
*
* If the function is successfully called, no subsequent calls to the
* process_callback() of @param engine will be made after the function
* returns, until start() is called again.
*
* The backend will retain its existing parameter configuration after a successful
* return, and does NOT require any calls to set hardware parameters before it can be
* start()-ed again.
*
* Return zero if successful, 1 if the device is not in use, negative values on error
*/
virtual int pause () = 0;
/** While remaining connected to the device, and without changing its
* configuration, start (or stop) calling the process_callback() of @param engine
* without waiting for the device. Once process_callback() has returned, it
@ -312,7 +361,7 @@ class AudioBackend : public PortEngine {
* Implementations can feel free to smooth the values returned over
* time (e.g. high pass filtering, or its equivalent).
*/
virtual float cpu_load() const = 0;
virtual float dsp_load() const = 0;
/* Transport Control (JACK is the only audio API that currently offers
the concept of shared transport control)
@ -421,8 +470,25 @@ class AudioBackend : public PortEngine {
virtual void update_latencies () = 0;
/** Set @param speed and @param position to the current speed and position
* indicated by some transport sync signal. Return whether the current
* transport state is pending, or finalized.
*
* Derived classes only need implement this if they provide some way to
* sync to a transport sync signal (e.g. Sony 9 Pin) that is not
* handled by Ardour itself (LTC and MTC are both handled by Ardour).
* The canonical example is JACK Transport.
*/
virtual bool speed_and_position (double& speed, framepos_t& position) {
speed = 0.0;
position = 0;
return false;
}
protected:
AudioEngine& engine;
virtual int _start (bool for_latency_measurement) = 0;
};
struct AudioBackendInfo {

View File

@ -33,17 +33,7 @@ public:
AudioBuffer(size_t capacity);
~AudioBuffer();
void silence (framecnt_t len, framecnt_t offset = 0) {
if (!_silent) {
assert(_capacity > 0);
assert(offset + len <= _capacity);
memset(_data + offset, 0, sizeof (Sample) * len);
if (len == _capacity) {
_silent = true;
}
}
_written = true;
}
void silence (framecnt_t len, framecnt_t offset = 0);
/** Read @a len frames @a src starting at @a src_offset into self starting at @ dst_offset*/
void read_from (const Sample* src, framecnt_t len, framecnt_t dst_offset = 0, framecnt_t src_offset = 0) {
@ -204,10 +194,11 @@ public:
Sample* data (framecnt_t offset = 0) {
assert(offset <= _capacity);
_silent = false;
return _data + offset;
}
bool check_silence (pframes_t, pframes_t&) const;
bool check_silence (pframes_t, bool, pframes_t&) const;
void prepare () { _written = false; _silent = false; }
bool written() const { return _written; }

View File

@ -25,7 +25,7 @@
#include <ostream>
#include <fstream>
#include <boost/utility.hpp>
#include "vamp-sdk/Plugin.h"
#include <vamp-sdk/Plugin.h>
#include "ardour/types.h"
namespace ARDOUR {

View File

@ -70,6 +70,7 @@ public:
int discover_backends();
std::vector<const AudioBackendInfo*> available_backends() const;
std::string current_backend_name () const;
boost::shared_ptr<AudioBackend> set_default_backend ();
boost::shared_ptr<AudioBackend> set_backend (const std::string&, const std::string& arg1, const std::string& arg2);
boost::shared_ptr<AudioBackend> current_backend() const { return _backend; }
bool setup_required () const;
@ -82,11 +83,10 @@ public:
* just forward to a backend implementation.
*/
int start ();
int stop ();
int pause ();
int start (bool for_latency_measurement=false);
int stop (bool for_latency_measurement=false);
int freewheel (bool start_stop);
float get_cpu_load() const ;
float get_dsp_load() const ;
void transport_start ();
void transport_stop ();
TransportState transport_state ();
@ -193,7 +193,7 @@ public:
MTDM* mtdm();
int prepare_for_latency_measurement ();
void start_latency_detection ();
int start_latency_detection ();
void stop_latency_detection ();
void set_latency_input_port (const std::string&);
void set_latency_output_port (const std::string&);
@ -228,7 +228,9 @@ public:
std::string _latency_input_name;
std::string _latency_output_name;
framecnt_t _latency_signal_latency;
bool _stopped_for_latency;
bool _started_for_latency;
bool _in_destructor;
void meter_thread ();
void start_metering_thread ();
@ -236,9 +238,6 @@ public:
static gint m_meter_exit;
void parameter_changed (const std::string&);
PBD::ScopedConnection config_connection;
typedef std::map<std::string,AudioBackendInfo*> BackendMap;
BackendMap _backends;
AudioBackendInfo* backend_discover (const std::string&);

Some files were not shown because too many files have changed in this diff Show More