mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
fix conflicts after merge with master
This commit is contained in:
commit
616f2a0370
116 changed files with 3621 additions and 1742 deletions
|
|
@ -42,6 +42,7 @@ using namespace Gtk;
|
|||
using namespace std;
|
||||
using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
using namespace VideoUtils;
|
||||
|
||||
#define PREVIEW_WIDTH (240)
|
||||
#define PREVIEW_HEIGHT (180)
|
||||
|
|
@ -482,7 +483,7 @@ AddVideoDialog::harvid_request(std::string u)
|
|||
|
||||
harvid_list->clear();
|
||||
|
||||
char *res = curl_http_get(url, &status);
|
||||
char *res = a3_curl_http_get(url, &status);
|
||||
if (status != 200) {
|
||||
printf("request failed\n"); // XXX
|
||||
harvid_path.set_text(" - request failed -");
|
||||
|
|
@ -662,7 +663,7 @@ AddVideoDialog::request_preview(std::string u)
|
|||
, (long long) (video_duration * seek_slider.get_value() / 1000.0)
|
||||
, clip_width, clip_height, u.c_str());
|
||||
|
||||
char *data = curl_http_get(url, NULL);
|
||||
char *data = a3_curl_http_get(url, NULL);
|
||||
if (!data) {
|
||||
printf("image preview request failed %s\n", url);
|
||||
imgbuf->fill(RGBA_TO_UINT(0,0,0,255));
|
||||
|
|
|
|||
|
|
@ -989,3 +989,25 @@ style "default_toggle_button"
|
|||
bg[ACTIVE] = @@COLPREFIX@_contrasting_indicator
|
||||
fg[ACTIVE] = @@COLPREFIX@_darkest
|
||||
}
|
||||
|
||||
|
||||
style "meter_strip_dpm" = "default"
|
||||
{
|
||||
}
|
||||
|
||||
style "meter_strip_ppm" = "default"
|
||||
{
|
||||
bg[NORMAL] = { 0.1, 0.1, 0.1 }
|
||||
fg[NORMAL] = { 1.0, 1.0, 1.0 }
|
||||
}
|
||||
|
||||
style "meter_strip_vu" = "default"
|
||||
{
|
||||
bg[NORMAL] = { .84, .77, .58 }
|
||||
fg[NORMAL] = { 0.0, 0.0, 0.0 }
|
||||
}
|
||||
|
||||
style "meter_strip_sep" = "default"
|
||||
{
|
||||
bg[NORMAL] = { 0.0, 0.0, 0.0 }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,7 +221,8 @@
|
|||
<Option name="solo safe: led active" value="ff0000ff"/>
|
||||
<Option name="solo safe: text" value="c7c7d8ff"/>
|
||||
<Option name="solo safe: text active" value="c8c8d9ff"/>
|
||||
<Option name="meterbridge peaklabel" value="cc4422ff"/>
|
||||
<Option name="meterbridge peaklabel" value="ff1111ff"/>
|
||||
<Option name="meter color BBC" value="ffa500ff"/>
|
||||
<Option name="meterbridge peakindicator: fill start" value="444444ff"/>
|
||||
<Option name="meterbridge peakindicator: fill end" value="333333ff"/>
|
||||
<Option name="meterbridge peakindicator on: fill start" value="ff0000ff"/>
|
||||
|
|
|
|||
|
|
@ -290,6 +290,11 @@ widget "*PluginLoadButton" style:highest "small_button"
|
|||
widget "*PluginLoadButton*" style:highest "small_button"
|
||||
widget "*PluginEditorButton" style:highest "default_toggle_button"
|
||||
|
||||
widget "*meterstripPPM" style:highest "meter_strip_ppm"
|
||||
widget "*meterstripDPM" style:highest "meter_strip_dpm"
|
||||
widget "*meterstripVU" style:highest "meter_strip_vu"
|
||||
widget "*BlackSeparator" style:highest "meter_strip_sep"
|
||||
|
||||
widget "*MetricDialogFrame" style:highest "base_frame"
|
||||
widget "*MetricEntry" style:highest "medium_bold_entry"
|
||||
widget "*MetricButton" style:highest "default_button"
|
||||
|
|
|
|||
|
|
@ -182,6 +182,9 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
|||
, solo_alert_button (_("solo"))
|
||||
, feedback_alert_button (_("feedback"))
|
||||
|
||||
, editor_meter(0)
|
||||
, editor_meter_peak_display()
|
||||
|
||||
, speaker_config_window (X_("speaker-config"), _("Speaker Configuration"))
|
||||
, theme_manager (X_("theme-manager"), _("Theme Manager"))
|
||||
, key_editor (X_("key-editor"), _("Key Bindings"))
|
||||
|
|
@ -1020,6 +1023,15 @@ ARDOUR_UI::every_point_zero_something_seconds ()
|
|||
// august 2007: actual update frequency: 25Hz (40ms), not 100Hz
|
||||
|
||||
SuperRapidScreenUpdate(); /* EMIT_SIGNAL */
|
||||
if (editor_meter && Config->get_show_editor_meter()) {
|
||||
float mpeak = editor_meter->update_meters();
|
||||
if (mpeak > editor_meter_max_peak) {
|
||||
if (mpeak >= Config->get_meter_peak()) {
|
||||
editor_meter_peak_display.set_name ("meterbridge peakindicator on");
|
||||
editor_meter_peak_display.set_elements((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body));
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -3479,7 +3491,10 @@ ARDOUR_UI::add_video (Gtk::Window* float_window)
|
|||
return;
|
||||
}
|
||||
if (!transcode_video_dialog->get_audiofile().empty()) {
|
||||
editor->embed_audio_from_video(transcode_video_dialog->get_audiofile());
|
||||
editor->embed_audio_from_video(
|
||||
transcode_video_dialog->get_audiofile(),
|
||||
video_timeline->get_offset()
|
||||
);
|
||||
}
|
||||
switch (transcode_video_dialog->import_option()) {
|
||||
case VTL_IMPORT_TRANSCODED:
|
||||
|
|
@ -3543,6 +3558,10 @@ ARDOUR_UI::remove_video ()
|
|||
video_timeline->close_session();
|
||||
editor->toggle_ruler_video(false);
|
||||
|
||||
/* reset state */
|
||||
video_timeline->set_offset_locked(false);
|
||||
video_timeline->set_offset(0);
|
||||
|
||||
/* delete session state */
|
||||
XMLNode* node = new XMLNode(X_("Videotimeline"));
|
||||
_session->add_extra_xml(*node);
|
||||
|
|
@ -4080,3 +4099,32 @@ ARDOUR_UI::session_format_mismatch (std::string xml_path, std::string backup_pat
|
|||
|
||||
msg.run ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ARDOUR_UI::reset_peak_display ()
|
||||
{
|
||||
if (!_session || !_session->master_out() || !editor_meter) return;
|
||||
editor_meter->clear_meters();
|
||||
editor_meter_max_peak = -INFINITY;
|
||||
editor_meter_peak_display.set_name ("meterbridge peakindicator");
|
||||
editor_meter_peak_display.set_elements((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body));
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::reset_group_peak_display (RouteGroup* group)
|
||||
{
|
||||
if (!_session || !_session->master_out()) return;
|
||||
if (group == _session->master_out()->route_group()) {
|
||||
reset_peak_display ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::reset_route_peak_display (Route* route)
|
||||
{
|
||||
if (!_session || !_session->master_out()) return;
|
||||
if (_session->master_out().get() == route) {
|
||||
reset_peak_display ();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ class SpeakerDialog;
|
|||
class ThemeManager;
|
||||
class TimeInfoBox;
|
||||
class MidiTracer;
|
||||
class LevelMeterHBox;
|
||||
class GlobalPortMatrixWindow;
|
||||
class GUIObjectState;
|
||||
|
||||
|
|
@ -281,6 +282,10 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
void get_process_buffers ();
|
||||
void drop_process_buffers ();
|
||||
|
||||
void reset_peak_display ();
|
||||
void reset_route_peak_display (ARDOUR::Route*);
|
||||
void reset_group_peak_display (ARDOUR::RouteGroup*);
|
||||
|
||||
const std::string& announce_string() const { return _announce_string; }
|
||||
|
||||
protected:
|
||||
|
|
@ -444,6 +449,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
|||
ArdourButton feedback_alert_button;
|
||||
|
||||
Gtk::VBox alert_box;
|
||||
Gtk::VBox meter_box;
|
||||
LevelMeterHBox * editor_meter;
|
||||
float editor_meter_max_peak;
|
||||
ArdourButton editor_meter_peak_display;
|
||||
bool editor_meter_peak_button_release (GdkEventButton*);
|
||||
|
||||
void solo_blink (bool);
|
||||
void sync_blink (bool);
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ ARDOUR_UI::setup_tooltips ()
|
|||
set_tip (feedback_alert_button, _("When active, there is a feedback loop."));
|
||||
set_tip (primary_clock, _("<b>Primary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
|
||||
set_tip (secondary_clock, _("<b>Secondary Clock</b> right-click to set display mode. Click to edit, click+drag a digit or mouse-over+scroll wheel to modify.\nText edits: right-to-left overwrite <tt>Esc</tt>: cancel; <tt>Enter</tt>: confirm; postfix the edit with '+' or '-' to enter delta times.\n"));
|
||||
set_tip (editor_meter_peak_display, _("Reset Level Meter"));
|
||||
|
||||
synchronize_sync_source_and_video_pullup ();
|
||||
|
||||
|
|
@ -417,6 +418,8 @@ ARDOUR_UI::setup_transport ()
|
|||
transport_tearoff_hbox.pack_start (_editor_transport_box, false, false);
|
||||
}
|
||||
transport_tearoff_hbox.pack_start (alert_box, false, false);
|
||||
transport_tearoff_hbox.pack_start (meter_box, false, false);
|
||||
transport_tearoff_hbox.pack_start (editor_meter_peak_display, false, false);
|
||||
|
||||
if (Profile->get_sae()) {
|
||||
Image* img = manage (new Image ((::get_icon (X_("sae")))));
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "keyeditor.h"
|
||||
#include "location_ui.h"
|
||||
#include "main_clock.h"
|
||||
#include "meter_patterns.h"
|
||||
#include "midi_tracer.h"
|
||||
#include "mixer_ui.h"
|
||||
#include "public_editor.h"
|
||||
|
|
@ -52,6 +53,8 @@
|
|||
#include "theme_manager.h"
|
||||
#include "time_info_box.h"
|
||||
|
||||
#include <gtkmm2ext/keyboard.h>
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
using namespace ARDOUR;
|
||||
|
|
@ -186,6 +189,45 @@ ARDOUR_UI::set_session (Session *s)
|
|||
point_zero_something_second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_zero_something_seconds), 40);
|
||||
|
||||
update_format ();
|
||||
|
||||
if (editor_meter) {
|
||||
meter_box.remove(*editor_meter);
|
||||
delete editor_meter;
|
||||
editor_meter = 0;
|
||||
editor_meter_peak_display.hide();
|
||||
}
|
||||
|
||||
if (_session && _session->master_out()) {
|
||||
editor_meter = new LevelMeterHBox(_session);
|
||||
editor_meter->set_meter (_session->master_out()->shared_peak_meter().get());
|
||||
editor_meter->clear_meters();
|
||||
editor_meter->set_type (_session->master_out()->meter_type());
|
||||
editor_meter->setup_meters (30, 12, 6);
|
||||
editor_meter->show();
|
||||
meter_box.pack_start(*editor_meter);
|
||||
|
||||
ArdourMeter::ResetAllPeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_peak_display));
|
||||
ArdourMeter::ResetRoutePeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_route_peak_display));
|
||||
ArdourMeter::ResetGroupPeakDisplays.connect (sigc::mem_fun(*this, &ARDOUR_UI::reset_group_peak_display));
|
||||
|
||||
editor_meter_peak_display.set_name ("meterbridge peakindicator");
|
||||
editor_meter_peak_display.set_elements((ArdourButton::Element) (ArdourButton::Edge|ArdourButton::Body));
|
||||
editor_meter_peak_display.unset_flags (Gtk::CAN_FOCUS);
|
||||
editor_meter_peak_display.set_size_request(6, -1);
|
||||
editor_meter_peak_display.set_corner_radius(2);
|
||||
|
||||
editor_meter_max_peak = -INFINITY;
|
||||
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()) {
|
||||
meter_box.show();
|
||||
editor_meter_peak_display.show();
|
||||
} else {
|
||||
meter_box.hide();
|
||||
editor_meter_peak_display.hide();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -225,6 +267,13 @@ ARDOUR_UI::unload_session (bool hide_stuff)
|
|||
point_one_second_connection.disconnect ();
|
||||
point_zero_something_second_connection.disconnect();
|
||||
|
||||
if (editor_meter) {
|
||||
meter_box.remove(*editor_meter);
|
||||
delete editor_meter;
|
||||
editor_meter = 0;
|
||||
editor_meter_peak_display.hide();
|
||||
}
|
||||
|
||||
ActionManager::set_sensitive (ActionManager::session_sensitive_actions, false);
|
||||
|
||||
rec_button.set_sensitive (false);
|
||||
|
|
@ -497,3 +546,18 @@ ARDOUR_UI::main_window_state_event_handler (GdkEventWindowState* ev, bool window
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
ARDOUR_UI::editor_meter_peak_button_release (GdkEventButton* ev)
|
||||
{
|
||||
if (ev->button == 1 && Gtkmm2ext::Keyboard::modifier_state_equals (ev->state, Gtkmm2ext::Keyboard::PrimaryModifier|Gtkmm2ext::Keyboard::TertiaryModifier)) {
|
||||
ArdourMeter::ResetAllPeakDisplays ();
|
||||
} else if (ev->button == 1 && Gtkmm2ext::Keyboard::modifier_state_equals (ev->state, Gtkmm2ext::Keyboard::PrimaryModifier)) {
|
||||
if (_session->master_out()) {
|
||||
ArdourMeter::ResetGroupPeakDisplays (_session->master_out()->route_group());
|
||||
}
|
||||
} else if (_session->master_out()) {
|
||||
ArdourMeter::ResetRoutePeakDisplays (_session->master_out().get());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -413,6 +413,15 @@ ARDOUR_UI::parameter_changed (std::string p)
|
|||
} else if (p == "super-rapid-clock-update") {
|
||||
stop_clocking ();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2013,7 +2013,7 @@ framepos_t
|
|||
AudioClock::frame_duration_from_bbt_string (framepos_t pos, const string& str) const
|
||||
{
|
||||
if (_session == 0) {
|
||||
error << "AudioClock::current_time() called with BBT mode but without session!" << endmsg;
|
||||
error << "AudioClock::frame_duration_from_bbt_string() called with BBT mode but without session!" << endmsg;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ CANVAS_VARIABLE(canvasvar_MeasureLineBar, "measure line bar")
|
|||
CANVAS_VARIABLE(canvasvar_MeasureLineBeat, "measure line beat")
|
||||
CANVAS_VARIABLE(canvasvar_MeterBar, "meter bar")
|
||||
CANVAS_VARIABLE(canvasvar_MeterBridgePeakLabel, "meterbridge peaklabel")
|
||||
CANVAS_VARIABLE(canvasvar_MeterColorBBC, "meter color BBC")
|
||||
CANVAS_VARIABLE(canvasvar_MeterColor0, "meter fill: 0")
|
||||
CANVAS_VARIABLE(canvasvar_MeterColor1, "meter fill: 1")
|
||||
CANVAS_VARIABLE(canvasvar_MeterColor2, "meter fill: 2")
|
||||
|
|
|
|||
|
|
@ -1665,7 +1665,7 @@ VideoTimeLineDrag::motion (GdkEvent* event, bool first_move)
|
|||
}
|
||||
|
||||
framecnt_t dt = adjusted_current_frame (event) - raw_grab_frame() + _pointer_frame_offset;
|
||||
dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(dt);
|
||||
dt = ARDOUR_UI::instance()->video_timeline->quantify_frames_to_apv(_startdrag_video_offset+dt) - _startdrag_video_offset;
|
||||
|
||||
if (_max_backwards_drag >= 0 && dt <= - _max_backwards_drag) {
|
||||
dt = - _max_backwards_drag;
|
||||
|
|
@ -2373,6 +2373,7 @@ CursorDrag::fake_locate (framepos_t t)
|
|||
framepos_t const f = _editor->playhead_cursor->current_frame;
|
||||
s->send_mmc_locate (f);
|
||||
s->send_full_time_code (f);
|
||||
s->send_song_position_pointer (f);
|
||||
}
|
||||
|
||||
show_verbose_cursor_time (t);
|
||||
|
|
|
|||
|
|
@ -6950,7 +6950,7 @@ Editor::uncombine_regions ()
|
|||
void
|
||||
Editor::toggle_midi_input_active (bool flip_others)
|
||||
{
|
||||
bool onoff;
|
||||
bool onoff = false;
|
||||
boost::shared_ptr<RouteList> rl (new RouteList);
|
||||
|
||||
for (TrackSelection::iterator i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
|
||||
|
|
|
|||
|
|
@ -111,8 +111,12 @@ EngineControl::EngineControl ()
|
|||
|
||||
strings.clear ();
|
||||
strings.push_back (_("None"));
|
||||
#ifdef __APPLE__
|
||||
strings.push_back (_("coremidi"));
|
||||
#else
|
||||
strings.push_back (_("seq"));
|
||||
strings.push_back (_("raw"));
|
||||
#endif
|
||||
set_popdown_strings (midi_driver_combo, strings);
|
||||
midi_driver_combo.set_active_text (strings.front ());
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ using namespace Gtk;
|
|||
using namespace std;
|
||||
using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
using namespace VideoUtils;
|
||||
|
||||
ExportVideoDialog::ExportVideoDialog (PublicEditor& ed, Session* s)
|
||||
: ArdourDialog (_("Export Video File "))
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ GainMeterBase::GainMeterBase (Session* s, bool horizontal, int fader_length, int
|
|||
gain_slider = manage (new VSliderController (&gain_adjustment, fader_length, fader_girth, false));
|
||||
}
|
||||
|
||||
level_meter = new LevelMeter(_session);
|
||||
level_meter = new LevelMeterHBox(_session);
|
||||
|
||||
level_meter->ButtonPress.connect_same_thread (_level_meter_connection, boost::bind (&GainMeterBase::level_meter_button_press, this, _1));
|
||||
meter_metric_area.signal_button_press_event().connect (sigc::mem_fun (*this, &GainMeterBase::level_meter_button_press));
|
||||
|
|
@ -526,9 +526,12 @@ GainMeterBase::gain_changed ()
|
|||
void
|
||||
GainMeterBase::set_meter_strip_name (const char * name)
|
||||
{
|
||||
char tmp[256];
|
||||
meter_metric_area.set_name (name);
|
||||
meter_ticks1_area.set_name (name);
|
||||
meter_ticks2_area.set_name (name);
|
||||
sprintf(tmp, "Mark%sLeft", name);
|
||||
meter_ticks1_area.set_name (tmp);
|
||||
sprintf(tmp, "Mark%sRight", name);
|
||||
meter_ticks2_area.set_name (tmp);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -1019,21 +1022,30 @@ GainMeter::get_gm_width ()
|
|||
gint
|
||||
GainMeter::meter_metrics_expose (GdkEventExpose *ev)
|
||||
{
|
||||
assert(_route);
|
||||
if (!_route) {
|
||||
if (_types.empty()) { _types.push_back(DataType::AUDIO); }
|
||||
return meter_expose_metrics(ev, MeterPeak, _types, &meter_metric_area);
|
||||
}
|
||||
return meter_expose_metrics(ev, _route->meter_type(), _types, &meter_metric_area);
|
||||
}
|
||||
|
||||
gint
|
||||
GainMeter::meter_ticks1_expose (GdkEventExpose *ev)
|
||||
{
|
||||
assert(_route);
|
||||
if (!_route) {
|
||||
if (_types.empty()) { _types.push_back(DataType::AUDIO); }
|
||||
return meter_expose_ticks(ev, MeterPeak, _types, &meter_ticks1_area);
|
||||
}
|
||||
return meter_expose_ticks(ev, _route->meter_type(), _types, &meter_ticks1_area);
|
||||
}
|
||||
|
||||
gint
|
||||
GainMeter::meter_ticks2_expose (GdkEventExpose *ev)
|
||||
{
|
||||
assert(_route);
|
||||
if (!_route) {
|
||||
if (_types.empty()) { _types.push_back(DataType::AUDIO); }
|
||||
return meter_expose_ticks(ev, MeterPeak, _types, &meter_ticks2_area);
|
||||
}
|
||||
return meter_expose_ticks(ev, _route->meter_type(), _types, &meter_ticks2_area);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class GainMeterBase : virtual public sigc::trackable, ARDOUR::SessionHandlePtr
|
|||
|
||||
boost::shared_ptr<PBD::Controllable> get_controllable();
|
||||
|
||||
LevelMeter& get_level_meter() const { return *level_meter; }
|
||||
LevelMeterHBox& get_level_meter() const { return *level_meter; }
|
||||
Gtkmm2ext::SliderController& get_gain_slider() const { return *gain_slider; }
|
||||
|
||||
/** Emitted in the GUI thread when a button is pressed over the level meter;
|
||||
|
|
@ -117,7 +117,7 @@ class GainMeterBase : virtual public sigc::trackable, ARDOUR::SessionHandlePtr
|
|||
Gtk::DrawingArea meter_metric_area;
|
||||
Gtk::DrawingArea meter_ticks1_area;
|
||||
Gtk::DrawingArea meter_ticks2_area;
|
||||
LevelMeter *level_meter;
|
||||
LevelMeterHBox *level_meter;
|
||||
|
||||
sigc::connection gain_watching;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
#include "ardour/meter.h"
|
||||
|
||||
#include <gtkmm2ext/utils.h>
|
||||
#include <gtkmm2ext/fastmeter.h>
|
||||
#include <gtkmm2ext/barcontroller.h>
|
||||
#include "midi++/manager.h"
|
||||
#include "pbd/fastlog.h"
|
||||
|
|
@ -44,27 +43,29 @@ using namespace Gtkmm2ext;
|
|||
using namespace Gtk;
|
||||
using namespace std;
|
||||
|
||||
LevelMeter::LevelMeter (Session* s)
|
||||
: _meter (0)
|
||||
LevelMeterBase::LevelMeterBase (Session* s, PBD::EventLoop::InvalidationRecord* ir, FastMeter::Orientation o)
|
||||
: parent_invalidator(ir)
|
||||
, _meter (0)
|
||||
, _meter_orientation(o)
|
||||
, regular_meter_width (6)
|
||||
, meter_length (0)
|
||||
, thin_meter_width(2)
|
||||
{
|
||||
set_session (s);
|
||||
set_spacing (1);
|
||||
Config->ParameterChanged.connect (_parameter_connection, invalidator (*this), boost::bind (&LevelMeter::parameter_changed, this, _1), gui_context());
|
||||
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &LevelMeter::on_theme_changed));
|
||||
ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeter::color_handler));
|
||||
Config->ParameterChanged.connect (_parameter_connection, parent_invalidator, boost::bind (&LevelMeterBase::parameter_changed, this, _1), gui_context());
|
||||
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &LevelMeterBase::on_theme_changed));
|
||||
ColorsChanged.connect (sigc::mem_fun (*this, &LevelMeterBase::color_handler));
|
||||
max_peak = minus_infinity();
|
||||
meter_type = MeterPeak;
|
||||
}
|
||||
|
||||
void
|
||||
LevelMeter::on_theme_changed()
|
||||
LevelMeterBase::on_theme_changed()
|
||||
{
|
||||
style_changed = true;
|
||||
}
|
||||
|
||||
LevelMeter::~LevelMeter ()
|
||||
LevelMeterBase::~LevelMeterBase ()
|
||||
{
|
||||
for (vector<MeterInfo>::iterator i = meters.begin(); i != meters.end(); i++) {
|
||||
delete (*i).meter;
|
||||
|
|
@ -72,7 +73,7 @@ LevelMeter::~LevelMeter ()
|
|||
}
|
||||
|
||||
void
|
||||
LevelMeter::set_meter (PeakMeter* meter)
|
||||
LevelMeterBase::set_meter (PeakMeter* meter)
|
||||
{
|
||||
_configuration_connection.disconnect();
|
||||
_meter_type_connection.disconnect();
|
||||
|
|
@ -80,13 +81,13 @@ LevelMeter::set_meter (PeakMeter* meter)
|
|||
_meter = meter;
|
||||
|
||||
if (_meter) {
|
||||
_meter->ConfigurationChanged.connect (_configuration_connection, invalidator (*this), boost::bind (&LevelMeter::configuration_changed, this, _1, _2), gui_context());
|
||||
_meter->TypeChanged.connect (_meter_type_connection, invalidator (*this), boost::bind (&LevelMeter::meter_type_changed, this, _1), gui_context());
|
||||
_meter->ConfigurationChanged.connect (_configuration_connection, parent_invalidator, boost::bind (&LevelMeterBase::configuration_changed, this, _1, _2), gui_context());
|
||||
_meter->TypeChanged.connect (_meter_type_connection, parent_invalidator, boost::bind (&LevelMeterBase::meter_type_changed, this, _1), gui_context());
|
||||
}
|
||||
}
|
||||
|
||||
static float meter_lineup(float offset) {
|
||||
switch (Config->get_meter_line_up_level()) {
|
||||
static float meter_lineup_cfg(MeterLineUp lul, float offset) {
|
||||
switch (lul) {
|
||||
case MeteringLineUp24:
|
||||
return offset + 6.0;
|
||||
case MeteringLineUp20:
|
||||
|
|
@ -101,20 +102,27 @@ static float meter_lineup(float offset) {
|
|||
return offset;
|
||||
}
|
||||
|
||||
static float meter_lineup(float offset) {
|
||||
return meter_lineup_cfg(Config->get_meter_line_up_level(), offset);
|
||||
}
|
||||
|
||||
static float vu_standard() {
|
||||
// note - default meter config is +2dB (france)
|
||||
switch (Config->get_meter_vu_standard()) {
|
||||
case MeteringVUfrench: // +2dB
|
||||
default:
|
||||
case MeteringVUfrench: // 0VU = -2dBu
|
||||
return 0;
|
||||
case MeteringVUamerican: // 0dB
|
||||
case MeteringVUamerican: // 0VU = 0dBu
|
||||
return -2;
|
||||
case MeteringVUstandard: // -4dB
|
||||
case MeteringVUstandard: // 0VU = +4dBu
|
||||
return -6;
|
||||
case MeteringVUeight: // 0VU = +8dBu
|
||||
return -10;
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
LevelMeter::update_meters ()
|
||||
LevelMeterBase::update_meters ()
|
||||
{
|
||||
vector<MeterInfo>::iterator i;
|
||||
uint32_t n;
|
||||
|
|
@ -130,7 +138,7 @@ LevelMeter::update_meters ()
|
|||
const float mpeak = _meter->meter_level(n, MeterMaxPeak);
|
||||
if (mpeak > (*i).max_peak) {
|
||||
(*i).max_peak = mpeak;
|
||||
(*i).meter->set_highlight(mpeak > Config->get_meter_peak());
|
||||
(*i).meter->set_highlight(mpeak >= Config->get_meter_peak());
|
||||
}
|
||||
if (mpeak > max_peak) {
|
||||
max_peak = mpeak;
|
||||
|
|
@ -145,7 +153,7 @@ LevelMeter::update_meters ()
|
|||
} else if (meter_type == MeterIEC1NOR) {
|
||||
(*i).meter->set (meter_deflect_nordic (peak + meter_lineup(0)));
|
||||
} else if (meter_type == MeterIEC1DIN) {
|
||||
(*i).meter->set (meter_deflect_din (peak + meter_lineup(3.0)));
|
||||
(*i).meter->set (meter_deflect_din (peak + meter_lineup_cfg(Config->get_meter_line_up_din(), 3.0)));
|
||||
} else if (meter_type == MeterIEC2BBC || meter_type == MeterIEC2EBU) {
|
||||
(*i).meter->set (meter_deflect_ppm (peak + meter_lineup(0)));
|
||||
} else if (meter_type == MeterVU) {
|
||||
|
|
@ -164,9 +172,9 @@ LevelMeter::update_meters ()
|
|||
}
|
||||
|
||||
void
|
||||
LevelMeter::parameter_changed (string p)
|
||||
LevelMeterBase::parameter_changed (string p)
|
||||
{
|
||||
ENSURE_GUI_THREAD (*this, &LevelMeter::parameter_changed, p)
|
||||
ENSURE_GUI_THREAD (*this, &LevelMeterBase::parameter_changed, p)
|
||||
|
||||
if (p == "meter-hold") {
|
||||
vector<MeterInfo>::iterator i;
|
||||
|
|
@ -180,6 +188,10 @@ LevelMeter::parameter_changed (string p)
|
|||
color_changed = true;
|
||||
setup_meters (meter_length, regular_meter_width, thin_meter_width);
|
||||
}
|
||||
else if (p == "meter-style-led") {
|
||||
color_changed = true;
|
||||
setup_meters (meter_length, regular_meter_width, thin_meter_width);
|
||||
}
|
||||
else if (p == "meter-peak") {
|
||||
vector<MeterInfo>::iterator i;
|
||||
uint32_t n;
|
||||
|
|
@ -191,14 +203,14 @@ LevelMeter::parameter_changed (string p)
|
|||
}
|
||||
|
||||
void
|
||||
LevelMeter::configuration_changed (ChanCount /*in*/, ChanCount /*out*/)
|
||||
LevelMeterBase::configuration_changed (ChanCount /*in*/, ChanCount /*out*/)
|
||||
{
|
||||
color_changed = true;
|
||||
setup_meters (meter_length, regular_meter_width, thin_meter_width);
|
||||
}
|
||||
|
||||
void
|
||||
LevelMeter::meter_type_changed (MeterType t)
|
||||
LevelMeterBase::meter_type_changed (MeterType t)
|
||||
{
|
||||
meter_type = t;
|
||||
color_changed = true;
|
||||
|
|
@ -207,18 +219,18 @@ LevelMeter::meter_type_changed (MeterType t)
|
|||
}
|
||||
|
||||
void
|
||||
LevelMeter::hide_all_meters ()
|
||||
LevelMeterBase::hide_all_meters ()
|
||||
{
|
||||
for (vector<MeterInfo>::iterator i = meters.begin(); i != meters.end(); ++i) {
|
||||
if ((*i).packed) {
|
||||
remove (*((*i).meter));
|
||||
mtr_remove (*((*i).meter));
|
||||
(*i).packed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LevelMeter::setup_meters (int len, int initial_width, int thin_width)
|
||||
LevelMeterBase::setup_meters (int len, int initial_width, int thin_width)
|
||||
{
|
||||
hide_all_meters ();
|
||||
|
||||
|
|
@ -248,11 +260,17 @@ LevelMeter::setup_meters (int len, int initial_width, int thin_width)
|
|||
meters.push_back (MeterInfo());
|
||||
}
|
||||
|
||||
//cerr << "LevelMeter::setup_meters() called color_changed = " << color_changed << " colors: " << endl;//DEBUG
|
||||
//cerr << "LevelMeterBase::setup_meters() called color_changed = " << color_changed << " colors: " << endl;//DEBUG
|
||||
|
||||
for (int32_t n = nmeters-1; nmeters && n >= 0 ; --n) {
|
||||
uint32_t c[10];
|
||||
uint32_t b[4];
|
||||
float stp[4];
|
||||
int styleflags = Config->get_meter_style_led() ? 3 : 1;
|
||||
b[0] = ARDOUR_UI::config()->canvasvar_MeterBackgroundBot.get();
|
||||
b[1] = ARDOUR_UI::config()->canvasvar_MeterBackgroundTop.get();
|
||||
b[2] = 0x991122ff; // red highlight gradient Bot
|
||||
b[3] = 0x551111ff; // red highlight gradient Top
|
||||
if (n < nmidi) {
|
||||
c[0] = ARDOUR_UI::config()->canvasvar_MidiMeterColor0.get();
|
||||
c[1] = ARDOUR_UI::config()->canvasvar_MidiMeterColor1.get();
|
||||
|
|
@ -303,30 +321,44 @@ LevelMeter::setup_meters (int len, int initial_width, int thin_width)
|
|||
c[6] = c[7] = 0xffff00ff;
|
||||
c[8] = c[9] = 0xff0000ff;
|
||||
break;
|
||||
case MeterIEC2EBU:
|
||||
case MeterIEC2BBC:
|
||||
stp[0] = 115.0 * meter_deflect_ppm(-18);
|
||||
stp[1] = 115.0 * meter_deflect_ppm(-14);
|
||||
stp[2] = 115.0 * meter_deflect_ppm(-10);
|
||||
stp[3] = 115.0 * meter_deflect_ppm( -8);
|
||||
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");
|
||||
stp[0] = stp[1] = stp[2] = stp[3] = 115.0;
|
||||
break;
|
||||
case MeterIEC2EBU:
|
||||
stp[0] = 115.0 * meter_deflect_ppm(-24); // ignored
|
||||
stp[1] = 115.0 * meter_deflect_ppm(-18);
|
||||
stp[2] = 115.0 * meter_deflect_ppm( -9);
|
||||
stp[3] = 115.0 * meter_deflect_ppm( 0); // ignored
|
||||
c[3] = c[2] = c[1];
|
||||
c[6] = c[7] = c[8] = c[9];
|
||||
break;
|
||||
case MeterIEC1NOR:
|
||||
stp[0] = 115.0 * meter_deflect_nordic(-18);
|
||||
stp[1] = 115.0 * meter_deflect_nordic(-15);
|
||||
stp[0] = 115.0 * meter_deflect_nordic(-30); // ignored
|
||||
stp[1] = 115.0 * meter_deflect_nordic(-18);
|
||||
stp[2] = 115.0 * meter_deflect_nordic(-12);
|
||||
stp[3] = 115.0 * meter_deflect_nordic( -9);
|
||||
stp[3] = 115.0 * meter_deflect_nordic( -9); // ignored
|
||||
//c[2] = c[3] = c[1]; // dark-green
|
||||
c[0] = c[1] = c[2]; // bright-green
|
||||
c[6] = c[7] = c[8] = c[9];
|
||||
break;
|
||||
case MeterIEC1DIN:
|
||||
stp[0] = 115.0 * meter_deflect_din(-29);
|
||||
stp[0] = 115.0 * meter_deflect_din(-29); // ignored
|
||||
stp[1] = 115.0 * meter_deflect_din(-18);
|
||||
stp[2] = 115.0 * meter_deflect_din(-15);
|
||||
stp[2] = 115.0 * meter_deflect_din(-15); // ignored
|
||||
stp[3] = 115.0 * meter_deflect_din( -9);
|
||||
c[0] = c[1] = c[2] = c[3] = 0x00aa00ff;
|
||||
c[4] = c[6];
|
||||
c[5] = c[7];
|
||||
break;
|
||||
case MeterVU:
|
||||
stp[0] = 115.0 * meter_deflect_vu(-26); // -6
|
||||
stp[1] = 115.0 * meter_deflect_vu(-23); // -3
|
||||
stp[2] = 115.0 * meter_deflect_vu(-20); // 0
|
||||
stp[3] = 115.0 * meter_deflect_vu(-18); // +2
|
||||
c[0] = c[1] = c[2] = c[3] = c[4] = c[5] = 0x00aa00ff;
|
||||
c[6] = c[7] = c[8] = c[9] = 0xff8800ff;
|
||||
break;
|
||||
default: // PEAK, RMS
|
||||
stp[1] = 77.5; // 115 * log_meter(-10)
|
||||
|
|
@ -349,56 +381,61 @@ LevelMeter::setup_meters (int len, int initial_width, int thin_width)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (meters[n].width != width || meters[n].length != len || color_changed) {
|
||||
if (meters[n].width != width || meters[n].length != len || color_changed || meter_type != visible_meter_type) {
|
||||
bool hl = meters[n].meter ? meters[n].meter->get_highlight() : false;
|
||||
meters[n].packed = false;
|
||||
delete meters[n].meter;
|
||||
meters[n].meter = new FastMeter ((uint32_t) floor (Config->get_meter_hold()), width, FastMeter::Vertical, len,
|
||||
meters[n].meter = new FastMeter ((uint32_t) floor (Config->get_meter_hold()), width, _meter_orientation, len,
|
||||
c[0], c[1], c[2], c[3], c[4],
|
||||
c[5], c[6], c[7], c[8], c[9],
|
||||
ARDOUR_UI::config()->canvasvar_MeterBackgroundBot.get(),
|
||||
ARDOUR_UI::config()->canvasvar_MeterBackgroundTop.get(),
|
||||
0x991122ff, 0x551111ff,
|
||||
stp[0], stp[1], stp[2], stp[3]
|
||||
b[0], b[1], b[2], b[3],
|
||||
stp[0], stp[1], stp[2], stp[3],
|
||||
styleflags
|
||||
);
|
||||
meters[n].meter->set_highlight(hl);
|
||||
meters[n].width = width;
|
||||
meters[n].length = len;
|
||||
meters[n].meter->add_events (Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK);
|
||||
meters[n].meter->signal_button_press_event().connect (sigc::mem_fun (*this, &LevelMeter::meter_button_press));
|
||||
meters[n].meter->signal_button_release_event().connect (sigc::mem_fun (*this, &LevelMeter::meter_button_release));
|
||||
meters[n].meter->signal_button_press_event().connect (sigc::mem_fun (*this, &LevelMeterBase::meter_button_press));
|
||||
meters[n].meter->signal_button_release_event().connect (sigc::mem_fun (*this, &LevelMeterBase::meter_button_release));
|
||||
}
|
||||
|
||||
pack_end (*meters[n].meter, false, false);
|
||||
//pack_end (*meters[n].meter, false, false);
|
||||
mtr_pack (*meters[n].meter);
|
||||
meters[n].meter->show_all ();
|
||||
meters[n].packed = true;
|
||||
}
|
||||
show();
|
||||
//show();
|
||||
color_changed = false;
|
||||
visible_meter_type = meter_type;
|
||||
}
|
||||
|
||||
void
|
||||
LevelMeter::set_type(MeterType t)
|
||||
LevelMeterBase::set_type(MeterType t)
|
||||
{
|
||||
meter_type = t;
|
||||
_meter->set_type(t);
|
||||
}
|
||||
|
||||
bool
|
||||
LevelMeter::meter_button_press (GdkEventButton* ev)
|
||||
LevelMeterBase::meter_button_press (GdkEventButton* ev)
|
||||
{
|
||||
return ButtonPress (ev); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
bool
|
||||
LevelMeter::meter_button_release (GdkEventButton* ev)
|
||||
LevelMeterBase::meter_button_release (GdkEventButton* ev)
|
||||
{
|
||||
if (ev->button == 1) {
|
||||
clear_meters (false);
|
||||
}
|
||||
ButtonRelease(ev);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void LevelMeter::clear_meters (bool reset_highlight)
|
||||
void LevelMeterBase::clear_meters (bool reset_highlight)
|
||||
{
|
||||
for (vector<MeterInfo>::iterator i = meters.begin(); i < meters.end(); i++) {
|
||||
(*i).meter->clear();
|
||||
|
|
@ -409,14 +446,53 @@ void LevelMeter::clear_meters (bool reset_highlight)
|
|||
max_peak = minus_infinity();
|
||||
}
|
||||
|
||||
void LevelMeter::hide_meters ()
|
||||
void LevelMeterBase::hide_meters ()
|
||||
{
|
||||
hide_all_meters();
|
||||
}
|
||||
|
||||
void
|
||||
LevelMeter::color_handler ()
|
||||
LevelMeterBase::color_handler ()
|
||||
{
|
||||
color_changed = true;
|
||||
setup_meters (meter_length, regular_meter_width, thin_meter_width);
|
||||
}
|
||||
|
||||
LevelMeterHBox::LevelMeterHBox(Session* s)
|
||||
: LevelMeterBase(s, invalidator(*this))
|
||||
{
|
||||
set_spacing(1);
|
||||
show();
|
||||
}
|
||||
|
||||
|
||||
LevelMeterHBox::~LevelMeterHBox() {}
|
||||
|
||||
void
|
||||
LevelMeterHBox::mtr_pack(Gtk::Widget &w) {
|
||||
pack_end (w, false, false);
|
||||
}
|
||||
|
||||
void
|
||||
LevelMeterHBox::mtr_remove(Gtk::Widget &w) {
|
||||
remove (w);
|
||||
}
|
||||
|
||||
|
||||
LevelMeterVBox::LevelMeterVBox(Session* s)
|
||||
: LevelMeterBase(s, invalidator(*this), FastMeter::Horizontal)
|
||||
{
|
||||
set_spacing(1);
|
||||
show();
|
||||
}
|
||||
LevelMeterVBox::~LevelMeterVBox() {}
|
||||
|
||||
void
|
||||
LevelMeterVBox::mtr_pack(Gtk::Widget &w) {
|
||||
pack_end (w, false, false);
|
||||
}
|
||||
|
||||
void
|
||||
LevelMeterVBox::mtr_remove(Gtk::Widget &w) {
|
||||
remove (w);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#include <gtkmm2ext/click_box.h>
|
||||
#include <gtkmm2ext/focus_entry.h>
|
||||
#include <gtkmm2ext/slider_controller.h>
|
||||
#include <gtkmm2ext/fastmeter.h>
|
||||
|
||||
#include "enums.h"
|
||||
|
||||
|
|
@ -44,18 +45,16 @@ namespace ARDOUR {
|
|||
class Session;
|
||||
class PeakMeter;
|
||||
}
|
||||
namespace Gtkmm2ext {
|
||||
class FastMeter;
|
||||
}
|
||||
namespace Gtk {
|
||||
class Menu;
|
||||
}
|
||||
|
||||
class LevelMeter : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
||||
class LevelMeterBase : public ARDOUR::SessionHandlePtr
|
||||
{
|
||||
public:
|
||||
LevelMeter (ARDOUR::Session*);
|
||||
~LevelMeter ();
|
||||
LevelMeterBase (ARDOUR::Session*, PBD::EventLoop::InvalidationRecord* ir,
|
||||
Gtkmm2ext::FastMeter::Orientation o = Gtkmm2ext::FastMeter::Vertical);
|
||||
virtual ~LevelMeterBase ();
|
||||
|
||||
virtual void set_meter (ARDOUR::PeakMeter* meter);
|
||||
|
||||
|
|
@ -72,10 +71,17 @@ class LevelMeter : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
|||
|
||||
/** Emitted in the GUI thread when a button is pressed over the meter */
|
||||
PBD::Signal1<bool, GdkEventButton *> ButtonPress;
|
||||
PBD::Signal1<bool, GdkEventButton *> ButtonRelease;
|
||||
PBD::Signal1<void, ARDOUR::MeterType> MeterTypeChanged;
|
||||
|
||||
protected:
|
||||
virtual void mtr_pack(Gtk::Widget &w) = 0;
|
||||
virtual void mtr_remove(Gtk::Widget &w) = 0;
|
||||
|
||||
private:
|
||||
PBD::EventLoop::InvalidationRecord* parent_invalidator;
|
||||
ARDOUR::PeakMeter* _meter;
|
||||
Gtkmm2ext::FastMeter::Orientation _meter_orientation;
|
||||
|
||||
Width _width;
|
||||
|
||||
|
|
@ -101,6 +107,7 @@ class LevelMeter : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
|||
std::vector<MeterInfo> meters;
|
||||
float max_peak;
|
||||
ARDOUR::MeterType meter_type;
|
||||
ARDOUR::MeterType visible_meter_type;
|
||||
|
||||
PBD::ScopedConnection _configuration_connection;
|
||||
PBD::ScopedConnection _meter_type_connection;
|
||||
|
|
@ -120,5 +127,27 @@ class LevelMeter : public Gtk::HBox, public ARDOUR::SessionHandlePtr
|
|||
void color_handler ();
|
||||
};
|
||||
|
||||
class LevelMeterHBox : public LevelMeterBase, public Gtk::HBox
|
||||
{
|
||||
public:
|
||||
LevelMeterHBox (ARDOUR::Session*);
|
||||
~LevelMeterHBox();
|
||||
|
||||
protected:
|
||||
void mtr_pack(Gtk::Widget &w);
|
||||
void mtr_remove(Gtk::Widget &w);
|
||||
};
|
||||
|
||||
class LevelMeterVBox : public LevelMeterBase, public Gtk::VBox
|
||||
{
|
||||
public:
|
||||
LevelMeterVBox (ARDOUR::Session*);
|
||||
~LevelMeterVBox();
|
||||
|
||||
protected:
|
||||
void mtr_pack(Gtk::Widget &w);
|
||||
void mtr_remove(Gtk::Widget &w);
|
||||
};
|
||||
|
||||
#endif /* __ardour_gtk_track_meter_h__ */
|
||||
|
||||
|
|
|
|||
|
|
@ -35,16 +35,16 @@ alt_log_meter (float power)
|
|||
#endif
|
||||
|
||||
/* prototypes - avoid compiler warning */
|
||||
inline float log_meter (float db);
|
||||
inline float meter_deflect_ppm (float);
|
||||
inline float meter_deflect_din (float);
|
||||
inline float meter_deflect_nordic (float);
|
||||
inline float meter_deflect_vu (float);
|
||||
inline float meter_deflect_k (float, float);
|
||||
static inline float log_meter (float db);
|
||||
static inline float meter_deflect_ppm (float);
|
||||
static inline float meter_deflect_din (float);
|
||||
static inline float meter_deflect_nordic (float);
|
||||
static inline float meter_deflect_vu (float);
|
||||
static inline float meter_deflect_k (float, float);
|
||||
|
||||
|
||||
|
||||
inline float
|
||||
static inline float
|
||||
log_meter (float db)
|
||||
{
|
||||
gfloat def = 0.0f; /* Meter deflection %age */
|
||||
|
|
@ -75,7 +75,7 @@ log_meter (float db)
|
|||
return def/115.0f;
|
||||
}
|
||||
|
||||
inline float
|
||||
static inline float
|
||||
meter_deflect_ppm (float db)
|
||||
{
|
||||
if (db < -30) {
|
||||
|
|
@ -91,7 +91,7 @@ meter_deflect_ppm (float db)
|
|||
}
|
||||
}
|
||||
|
||||
inline float
|
||||
static inline float
|
||||
meter_deflect_din (float db)
|
||||
{
|
||||
float rv = dB_to_coefficient(db);
|
||||
|
|
@ -103,7 +103,7 @@ meter_deflect_din (float db)
|
|||
}
|
||||
}
|
||||
|
||||
inline float
|
||||
static inline float
|
||||
meter_deflect_nordic (float db)
|
||||
{
|
||||
if (db < -60) {
|
||||
|
|
@ -118,7 +118,7 @@ meter_deflect_nordic (float db)
|
|||
}
|
||||
}
|
||||
|
||||
inline float
|
||||
static inline float
|
||||
meter_deflect_vu (float db)
|
||||
{
|
||||
const float rv = 6.77165f * dB_to_coefficient(db);
|
||||
|
|
@ -126,7 +126,7 @@ meter_deflect_vu (float db)
|
|||
return rv;
|
||||
}
|
||||
|
||||
inline float
|
||||
static inline float
|
||||
meter_deflect_k (float db, float krange)
|
||||
{
|
||||
db+=krange;
|
||||
|
|
|
|||
|
|
@ -184,11 +184,19 @@ LV2PluginUI::LV2PluginUI(boost::shared_ptr<PluginInsert> pi,
|
|||
, _pi(pi)
|
||||
, _lv2(lv2p)
|
||||
, _gui_widget(NULL)
|
||||
, _ardour_buttons_box(NULL)
|
||||
, _values(NULL)
|
||||
, _external_ui_ptr(NULL)
|
||||
, _inst(NULL)
|
||||
{
|
||||
_ardour_buttons_box.set_spacing (6);
|
||||
_ardour_buttons_box.set_border_width (6);
|
||||
_ardour_buttons_box.pack_end (focus_button, false, false);
|
||||
_ardour_buttons_box.pack_end (bypass_button, false, false, 10);
|
||||
_ardour_buttons_box.pack_end (delete_button, false, false);
|
||||
_ardour_buttons_box.pack_end (save_button, false, false);
|
||||
_ardour_buttons_box.pack_end (add_button, false, false);
|
||||
_ardour_buttons_box.pack_end (_preset_combo, false, false);
|
||||
_ardour_buttons_box.pack_end (_preset_modified, false, false);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -219,18 +227,11 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
|
|||
features[features_count - 1] = &_external_ui_feature;
|
||||
features[features_count] = NULL;
|
||||
} else {
|
||||
_ardour_buttons_box = manage (new Gtk::HBox);
|
||||
_ardour_buttons_box->set_spacing (6);
|
||||
_ardour_buttons_box->set_border_width (6);
|
||||
_ardour_buttons_box->pack_end (focus_button, false, false);
|
||||
_ardour_buttons_box->pack_end (bypass_button, false, false, 10);
|
||||
_ardour_buttons_box->pack_end (delete_button, false, false);
|
||||
_ardour_buttons_box->pack_end (save_button, false, false);
|
||||
_ardour_buttons_box->pack_end (add_button, false, false);
|
||||
_ardour_buttons_box->pack_end (_preset_combo, false, false);
|
||||
_ardour_buttons_box->pack_end (_preset_modified, false, false);
|
||||
_ardour_buttons_box->show_all();
|
||||
pack_start(*_ardour_buttons_box, false, false);
|
||||
if (_ardour_buttons_box.get_parent()) {
|
||||
_ardour_buttons_box.get_parent()->remove(_ardour_buttons_box);
|
||||
}
|
||||
pack_start(_ardour_buttons_box, false, false);
|
||||
_ardour_buttons_box.show_all();
|
||||
|
||||
_gui_widget = Gtk::manage((container = new Gtk::Alignment()));
|
||||
pack_start(*_gui_widget, true, true);
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class LV2PluginUI : public PlugUIBase, public Gtk::VBox
|
|||
sigc::connection _screen_update_connection;
|
||||
Gtk::Widget* _gui_widget;
|
||||
/** a box containing the focus, bypass, delete, save / add preset buttons etc. */
|
||||
Gtk::HBox* _ardour_buttons_box;
|
||||
Gtk::HBox _ardour_buttons_box;
|
||||
float* _values;
|
||||
std::vector<ControllableRef> _controllables;
|
||||
struct lv2_external_ui_host _external_ui_host;
|
||||
|
|
|
|||
|
|
@ -52,15 +52,17 @@ sigc::signal<void, int, ARDOUR::RouteGroup*, ARDOUR::MeterType> ArdourMeter::Set
|
|||
/* pattern cache */
|
||||
|
||||
struct MeterMatricsMapKey {
|
||||
MeterMatricsMapKey (std::string n, MeterType t)
|
||||
MeterMatricsMapKey (std::string n, MeterType t, int dt)
|
||||
: _n(n)
|
||||
, _t(t)
|
||||
, _dt(dt)
|
||||
{}
|
||||
inline bool operator<(const MeterMatricsMapKey& rhs) const {
|
||||
return (_n < rhs._n) || (_n == rhs._n && _t < rhs._t);
|
||||
return (_n < rhs._n) || (_n == rhs._n && _t < rhs._t) || (_n == rhs._n && _t == rhs._t && _dt < rhs._dt);
|
||||
}
|
||||
std::string _n;
|
||||
MeterType _t;
|
||||
int _dt;
|
||||
};
|
||||
|
||||
namespace ArdourMeter {
|
||||
|
|
@ -108,6 +110,14 @@ ArdourMeter::meter_type_string (ARDOUR::MeterType mt)
|
|||
}
|
||||
}
|
||||
|
||||
static inline int types_to_bit (vector<ARDOUR::DataType> types) {
|
||||
int rv = 0;
|
||||
for (vector<DataType>::const_iterator i = types.begin(); i != types.end(); ++i) {
|
||||
rv |= 1 << (*i);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
static inline float mtr_col_and_fract(
|
||||
cairo_t* cr, Gdk::Color const * const c, const uint32_t peakcolor, const MeterType mt, const float val)
|
||||
{
|
||||
|
|
@ -130,18 +140,12 @@ static inline float mtr_col_and_fract(
|
|||
case MeterIEC2BBC:
|
||||
case MeterIEC2EBU:
|
||||
fraction = meter_deflect_ppm(val);
|
||||
if (val >= -10.0) {
|
||||
cairo_set_source_rgb (cr,
|
||||
UINT_RGBA_R_FLT(peakcolor),
|
||||
UINT_RGBA_G_FLT(peakcolor),
|
||||
UINT_RGBA_B_FLT(peakcolor));
|
||||
} else {
|
||||
cairo_set_source_rgb (cr, c->get_red_p(), c->get_green_p(), c->get_blue_p());
|
||||
}
|
||||
cairo_set_source_rgb (cr, c->get_red_p(), c->get_green_p(), c->get_blue_p());
|
||||
break;
|
||||
case MeterIEC1NOR:
|
||||
fraction = meter_deflect_nordic(val);
|
||||
if (val >= -12.0) {
|
||||
#if 0
|
||||
if (val == -18.0) {
|
||||
cairo_set_source_rgb (cr,
|
||||
UINT_RGBA_R_FLT(peakcolor),
|
||||
UINT_RGBA_G_FLT(peakcolor),
|
||||
|
|
@ -149,10 +153,13 @@ static inline float mtr_col_and_fract(
|
|||
} else {
|
||||
cairo_set_source_rgb (cr, c->get_red_p(), c->get_green_p(), c->get_blue_p());
|
||||
}
|
||||
#else
|
||||
cairo_set_source_rgb (cr, c->get_red_p(), c->get_green_p(), c->get_blue_p());
|
||||
#endif
|
||||
break;
|
||||
case MeterIEC1DIN:
|
||||
fraction = meter_deflect_din(val);
|
||||
if (val >= -9.0) {
|
||||
if (val == -9.0 || val == -15 || val == -18) {
|
||||
cairo_set_source_rgb (cr,
|
||||
UINT_RGBA_R_FLT(peakcolor),
|
||||
UINT_RGBA_G_FLT(peakcolor),
|
||||
|
|
@ -196,6 +203,65 @@ static inline float mtr_col_and_fract(
|
|||
return fraction;
|
||||
}
|
||||
|
||||
static void mtr_red_stripe(cairo_t* cr, float l, float w, int h, float top, float bot) {
|
||||
if (w <= 0) return;
|
||||
int t = h - floorf (h * (top));
|
||||
int b = h - floorf (h * (bot));
|
||||
cairo_set_source_rgba (cr, .75, 0, 0, 0.75);
|
||||
cairo_rectangle (cr, l, t + .5, w, b - t);
|
||||
cairo_fill (cr);
|
||||
}
|
||||
|
||||
static void set_bg_color(Gtk::Widget& w, cairo_t* cr, MeterType type) {
|
||||
float r,g,b;
|
||||
switch(type) {
|
||||
case MeterVU:
|
||||
if (rgba_p_from_style("meterstripVU", &r, &g, &b, "bg")) {
|
||||
cairo_set_source_rgb (cr, r, g, b);
|
||||
} else {
|
||||
cairo_set_source_rgb (cr, 1.0, 1.0, 0.85);
|
||||
}
|
||||
break;
|
||||
case MeterIEC1DIN:
|
||||
case MeterIEC1NOR:
|
||||
case MeterIEC2BBC:
|
||||
case MeterIEC2EBU:
|
||||
case MeterK14:
|
||||
case MeterK20:
|
||||
if (rgba_p_from_style("meterstripPPM", &r, &g, &b, "bg")) {
|
||||
cairo_set_source_rgb (cr, r, g, b);
|
||||
} else {
|
||||
cairo_set_source_rgb (cr, 0.1, 0.1, 0.1);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
Gdk::Color c = w.get_style()->get_bg (Gtk::STATE_ACTIVE);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void set_fg_color(Gtk::Widget&, MeterType type, Gdk::Color * c) {
|
||||
float r,g,b;
|
||||
switch(type) {
|
||||
case MeterVU:
|
||||
if (rgba_p_from_style("meterstripVU", &r, &g, &b)) {
|
||||
c->set_rgb_p(r, g, b);
|
||||
} else {
|
||||
c->set_rgb_p(0.0, 0.0, 0.0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (rgba_p_from_style("meterstripPPM", &r, &g, &b)) {
|
||||
c->set_rgb_p(r, g, b);
|
||||
} else {
|
||||
c->set_rgb_p(1.0, 1.0, 1.0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static cairo_pattern_t*
|
||||
meter_render_ticks (Gtk::Widget& w, MeterType type, vector<ARDOUR::DataType> types)
|
||||
|
|
@ -203,19 +269,45 @@ meter_render_ticks (Gtk::Widget& w, MeterType type, vector<ARDOUR::DataType> typ
|
|||
Glib::RefPtr<Gdk::Window> win (w.get_window());
|
||||
|
||||
bool background;
|
||||
bool tickleft, tickright;
|
||||
gint width, height;
|
||||
win->get_size (width, height);
|
||||
background = types.size() == 0
|
||||
|| w.get_name().substr(w.get_name().length() - 4) == "Left"
|
||||
|| w.get_name().substr(w.get_name().length() - 5) == "Right";
|
||||
tickleft = w.get_name().substr(w.get_name().length() - 4) == "Left";
|
||||
tickright = w.get_name().substr(w.get_name().length() - 5) == "Right";
|
||||
background = types.size() == 0 || tickleft || tickright;
|
||||
|
||||
float box_l=0;
|
||||
float box_w=0;
|
||||
if (tickleft) {
|
||||
if (w.get_name().substr(0, 3) == "Bar") {
|
||||
box_l = width-2; box_w = 2;
|
||||
} else if (w.get_name().substr(0, 4) == "Mark") {
|
||||
box_l = width-2; box_w = 2;
|
||||
background = false;
|
||||
}
|
||||
} else if (tickright) {
|
||||
if (w.get_name().substr(0, 3) == "Bar") {
|
||||
box_l = 0; box_w = 2;
|
||||
} else if (w.get_name().substr(0, 4) == "Mark") {
|
||||
box_l = 0; box_w = 2;
|
||||
background = false;
|
||||
}
|
||||
} else {
|
||||
box_l = 0; box_w = 3;
|
||||
}
|
||||
|
||||
cairo_surface_t* surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, width, height);
|
||||
cairo_t* cr = cairo_create (surface);
|
||||
|
||||
cairo_move_to (cr, 0, 0);
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
{
|
||||
Gdk::Color c = w.get_style()->get_bg (background ? Gtk::STATE_ACTIVE : Gtk::STATE_NORMAL);
|
||||
|
||||
if (background) {
|
||||
/* meterbridge */
|
||||
set_bg_color(w, cr, type);
|
||||
} else {
|
||||
/* mixer */
|
||||
Gdk::Color c = w.get_style()->get_bg (Gtk::STATE_NORMAL);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
}
|
||||
cairo_fill (cr);
|
||||
|
|
@ -226,23 +318,13 @@ meter_render_ticks (Gtk::Widget& w, MeterType type, vector<ARDOUR::DataType> typ
|
|||
for (vector<DataType>::const_iterator i = types.begin(); i != types.end(); ++i) {
|
||||
|
||||
Gdk::Color c;
|
||||
c = w.get_style()->get_fg (Gtk::STATE_NORMAL);
|
||||
|
||||
if (types.size() > 1) {
|
||||
if (types.size() > 1 && (*i) == DataType::MIDI) {
|
||||
/* we're overlaying more than 1 set of marks, so use different colours */
|
||||
switch (*i) {
|
||||
case DataType::AUDIO:
|
||||
c = w.get_style()->get_fg (Gtk::STATE_NORMAL);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
break;
|
||||
case DataType::MIDI:
|
||||
c = w.get_style()->get_fg (Gtk::STATE_ACTIVE);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
break;
|
||||
}
|
||||
c = w.get_style()->get_fg (Gtk::STATE_ACTIVE);
|
||||
} else if (background) {
|
||||
set_fg_color(w, type, &c);
|
||||
} else {
|
||||
c = w.get_style()->get_fg (Gtk::STATE_NORMAL);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
}
|
||||
|
||||
// tick-maker position in dBFS, line-thickness
|
||||
|
|
@ -259,10 +341,11 @@ meter_render_ticks (Gtk::Widget& w, MeterType type, vector<ARDOUR::DataType> typ
|
|||
points.insert (std::pair<float,float>(-24.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-20.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-17.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-14.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-11.0f, 1.0));
|
||||
points.insert (std::pair<float,float>( -8.0f, 1.0));
|
||||
points.insert (std::pair<float,float>( -4.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-14.0f, 1.0)); // 0
|
||||
points.insert (std::pair<float,float>(-11.0f, 1.0)); // +3
|
||||
points.insert (std::pair<float,float>(-10.0f, 0.8)); // +4
|
||||
points.insert (std::pair<float,float>( -8.0f, 1.0)); // +6
|
||||
points.insert (std::pair<float,float>( -4.0f, 1.0)); // +10
|
||||
points.insert (std::pair<float,float>( 0.0f, 1.0));
|
||||
break;
|
||||
case MeterK20:
|
||||
|
|
@ -272,12 +355,13 @@ meter_render_ticks (Gtk::Widget& w, MeterType type, vector<ARDOUR::DataType> typ
|
|||
points.insert (std::pair<float,float>(-30.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-26.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-23.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-20.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-20.0f, 1.0)); // 0
|
||||
points.insert (std::pair<float,float>(-17.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-14.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-16.0f, 0.8));
|
||||
points.insert (std::pair<float,float>(-14.0f, 1.0)); // +6
|
||||
points.insert (std::pair<float,float>(-10.0f, 1.0));
|
||||
points.insert (std::pair<float,float>( -5.0f, 1.0));
|
||||
points.insert (std::pair<float,float>( 0.0f, 1.0));
|
||||
points.insert (std::pair<float,float>( 0.0f, 1.0)); //+20
|
||||
break;
|
||||
case MeterIEC2EBU:
|
||||
points.insert (std::pair<float,float>(-30.0f, 1.0));
|
||||
|
|
@ -291,7 +375,7 @@ meter_render_ticks (Gtk::Widget& w, MeterType type, vector<ARDOUR::DataType> typ
|
|||
points.insert (std::pair<float,float>(-14.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-12.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-10.0f, 1.0));
|
||||
points.insert (std::pair<float,float>( -9.0f, 0.5));
|
||||
points.insert (std::pair<float,float>( -9.0f, 0.8));
|
||||
points.insert (std::pair<float,float>( -8.0f, 0.5));
|
||||
points.insert (std::pair<float,float>( -6.0f, 1.0));
|
||||
break;
|
||||
|
|
@ -315,44 +399,66 @@ meter_render_ticks (Gtk::Widget& w, MeterType type, vector<ARDOUR::DataType> typ
|
|||
points.insert (std::pair<float,float>(-39.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-36.0f, 1.0));
|
||||
|
||||
points.insert (std::pair<float,float>(-33.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-33.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-30.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-27.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-27.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-24.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-21.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-21.0f, 0.5));
|
||||
|
||||
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>(-15.0f, 0.5));
|
||||
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>( -6.0f, 1.0));
|
||||
points.insert (std::pair<float,float>( -6.0f, 0.5));
|
||||
mtr_red_stripe(cr, box_l, box_w, height,
|
||||
meter_deflect_nordic(-6.0f), meter_deflect_nordic(-12.0f));
|
||||
break;
|
||||
case MeterIEC1DIN:
|
||||
points.insert (std::pair<float,float>( -3.0f, 0.5)); // "200%"
|
||||
points.insert (std::pair<float,float>( -4.0f, 1.0)); // "100%"
|
||||
points.insert (std::pair<float,float>( -9.0f, 1.0));
|
||||
points.insert (std::pair<float,float>( -4.0f, 1.0));
|
||||
points.insert (std::pair<float,float>( -5.0f, 0.5));
|
||||
points.insert (std::pair<float,float>( -6.0f, 0.5));
|
||||
points.insert (std::pair<float,float>( -7.0f, 0.5));
|
||||
points.insert (std::pair<float,float>( -8.0f, 0.5));
|
||||
points.insert (std::pair<float,float>( -9.0f, 1.0)); // "100%"
|
||||
points.insert (std::pair<float,float>(-10.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-11.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-12.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-13.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-14.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-15.0f, 0.5)); // "50%"
|
||||
points.insert (std::pair<float,float>(-18.0f, 0.5)); // "-9"
|
||||
points.insert (std::pair<float,float>(-19.0f, 1.0)); // "30%"
|
||||
points.insert (std::pair<float,float>(-29.0f, 1.0)); // "10%"
|
||||
points.insert (std::pair<float,float>(-35.0f, 0.5)); // "5%" " -20"
|
||||
points.insert (std::pair<float,float>(-39.0f, 1.0)); // "3%"
|
||||
points.insert (std::pair<float,float>(-49.0f, 0.5)); // "1%"
|
||||
points.insert (std::pair<float,float>(-15.0f, 0.8)); // "50%"
|
||||
points.insert (std::pair<float,float>(-18.0f, 0.8)); // "-9"
|
||||
points.insert (std::pair<float,float>(-19.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-24.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-29.0f, 1.0)); // "-20", "10%"
|
||||
points.insert (std::pair<float,float>(-34.0f, 0.5)); // -25
|
||||
//points.insert (std::pair<float,float>(-35.0f, 0.5)); // "5%" " -20"
|
||||
points.insert (std::pair<float,float>(-39.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-49.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-54.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-59.0f, 1.0));
|
||||
mtr_red_stripe(cr, box_l, box_w, height,
|
||||
meter_deflect_din(0.0f), meter_deflect_din(-9.0f));
|
||||
break;
|
||||
case MeterVU:
|
||||
points.insert (std::pair<float,float>(-17.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-17.0f, 1.0)); //+3 VU
|
||||
points.insert (std::pair<float,float>(-18.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-19.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-20.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-19.5f, 0.5));
|
||||
points.insert (std::pair<float,float>(-20.0f, 1.0)); // 0 VU
|
||||
points.insert (std::pair<float,float>(-20.5f, 0.5));
|
||||
points.insert (std::pair<float,float>(-21.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-22.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-23.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-23.0f, 1.0)); //-3 VU
|
||||
points.insert (std::pair<float,float>(-24.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-25.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-27.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-26.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-27.0f, 1.0)); //-7 VU
|
||||
points.insert (std::pair<float,float>(-30.0f, 1.0));
|
||||
points.insert (std::pair<float,float>(-35.0f, 0.5));
|
||||
points.insert (std::pair<float,float>(-40.0f, 1.0));
|
||||
mtr_red_stripe(cr, box_l, box_w, height,
|
||||
meter_deflect_vu(-17.0f), meter_deflect_vu(-20.0f));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -433,6 +539,7 @@ meter_render_ticks (Gtk::Widget& w, MeterType type, vector<ARDOUR::DataType> typ
|
|||
fraction = (j->first) / 127.0;
|
||||
pos = 1 + height - (gint) floor (height * fraction);
|
||||
pos = min (pos, height);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
cairo_arc(cr, 1.5, pos + .5, 1.0, 0, 2 * M_PI);
|
||||
cairo_fill(cr);
|
||||
break;
|
||||
|
|
@ -455,6 +562,7 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
|
||||
bool tickleft, tickright;
|
||||
bool background;
|
||||
int overlay_midi = 1;
|
||||
gint width, height;
|
||||
win->get_size (width, height);
|
||||
|
||||
|
|
@ -500,8 +608,12 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
|
||||
cairo_move_to (cr, 0, 0);
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
{
|
||||
Gdk::Color c = w.get_style()->get_bg (background ? Gtk::STATE_ACTIVE : Gtk::STATE_NORMAL);
|
||||
if (background) {
|
||||
/* meterbridge */
|
||||
set_bg_color(w, cr, type);
|
||||
} else {
|
||||
/* mixer */
|
||||
Gdk::Color c = w.get_style()->get_bg (Gtk::STATE_NORMAL);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
}
|
||||
cairo_fill (cr);
|
||||
|
|
@ -510,56 +622,52 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
|
||||
height = min(max_pattern_metric_size, height);
|
||||
uint32_t peakcolor = ARDOUR_UI::config()->color_by_name ("meterbridge peaklabel");
|
||||
Gdk::Color c; // default text color
|
||||
|
||||
for (vector<DataType>::const_iterator i = types.begin(); i != types.end(); ++i) {
|
||||
|
||||
Gdk::Color c;
|
||||
if (types.size() > 1) {
|
||||
/* we're overlaying more than 1 set of marks, so use different colours */
|
||||
switch (*i) {
|
||||
case DataType::AUDIO:
|
||||
c = w.get_style()->get_fg (Gtk::STATE_NORMAL);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
break;
|
||||
case DataType::MIDI:
|
||||
c = w.get_style()->get_fg (Gtk::STATE_ACTIVE);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
c = w.get_style()->get_fg (Gtk::STATE_NORMAL);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
if (types.size() > 1 && (*i) == DataType::MIDI && overlay_midi == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (types.size() > 1 && (*i) == DataType::MIDI) {
|
||||
/* we're overlaying more than 1 set of marks, so use different colours */
|
||||
c = w.get_style()->get_fg (Gtk::STATE_ACTIVE);
|
||||
} else if (background) {
|
||||
set_fg_color(w, type, &c);
|
||||
} else {
|
||||
c = w.get_style()->get_fg (Gtk::STATE_NORMAL);
|
||||
}
|
||||
|
||||
// label-pos in dBFS, label-text
|
||||
std::map<float,string> points;
|
||||
std::map<float,string> points; // map: label-pos in dBFS, label-text
|
||||
|
||||
switch (*i) {
|
||||
case DataType::AUDIO:
|
||||
layout->set_attributes (audio_font_attributes);
|
||||
switch (type) {
|
||||
case MeterK14:
|
||||
overlay_midi = 0;
|
||||
points.insert (std::pair<float,string>(-54.0f, "-40"));
|
||||
points.insert (std::pair<float,string>(-44.0f, "-30"));
|
||||
points.insert (std::pair<float,string>(-34.0f, "-20"));
|
||||
points.insert (std::pair<float,string>(-24.0f, "-10"));
|
||||
points.insert (std::pair<float,string>(-20.0f, "-6"));
|
||||
points.insert (std::pair<float,string>(-17.0f, "-3"));
|
||||
points.insert (std::pair<float,string>(-14.0f, "0"));
|
||||
points.insert (std::pair<float,string>(-14.0f, " 0"));
|
||||
points.insert (std::pair<float,string>(-11.0f, "+3"));
|
||||
points.insert (std::pair<float,string>( -8.0f, "+6"));
|
||||
points.insert (std::pair<float,string>( -4.0f, "+10"));
|
||||
points.insert (std::pair<float,string>( 0.0f, "+14"));
|
||||
break;
|
||||
case MeterK20:
|
||||
overlay_midi = 0;
|
||||
points.insert (std::pair<float,string>(-60.0f, "-40"));
|
||||
points.insert (std::pair<float,string>(-50.0f, "-30"));
|
||||
points.insert (std::pair<float,string>(-40.0f, "-20"));
|
||||
points.insert (std::pair<float,string>(-30.0f, "-10"));
|
||||
points.insert (std::pair<float,string>(-26.0f, "-6"));
|
||||
points.insert (std::pair<float,string>(-23.0f, "-3"));
|
||||
points.insert (std::pair<float,string>(-20.0f, "0"));
|
||||
points.insert (std::pair<float,string>(-20.0f, " 0"));
|
||||
points.insert (std::pair<float,string>(-17.0f, "+3"));
|
||||
points.insert (std::pair<float,string>(-14.0f, "+6"));
|
||||
points.insert (std::pair<float,string>(-10.0f, "+10"));
|
||||
|
|
@ -590,6 +698,7 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
break;
|
||||
|
||||
case MeterIEC2EBU:
|
||||
overlay_midi = 3;
|
||||
points.insert (std::pair<float,string>(-30.0f, "-12"));
|
||||
points.insert (std::pair<float,string>(-26.0f, "-8"));
|
||||
points.insert (std::pair<float,string>(-22.0f, "-4"));
|
||||
|
|
@ -600,6 +709,7 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
break;
|
||||
|
||||
case MeterIEC2BBC:
|
||||
overlay_midi = 3;
|
||||
points.insert (std::pair<float,string>(-30.0f, " 1 "));
|
||||
points.insert (std::pair<float,string>(-26.0f, " 2 "));
|
||||
points.insert (std::pair<float,string>(-22.0f, " 3 "));
|
||||
|
|
@ -610,45 +720,48 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
break;
|
||||
|
||||
case MeterIEC1NOR:
|
||||
overlay_midi = 0;
|
||||
//points.insert (std::pair<float,string>(-60.0f, "-42"));
|
||||
points.insert (std::pair<float,string>(-54.0f, "-36"));
|
||||
points.insert (std::pair<float,string>(-48.0f, "-30"));
|
||||
points.insert (std::pair<float,string>(-42.0f, "-24"));
|
||||
points.insert (std::pair<float,string>(-36.0f, "-18"));
|
||||
|
||||
points.insert (std::pair<float,string>(-33.0f, "-15"));
|
||||
//points.insert (std::pair<float,string>(-33.0f, "-15"));
|
||||
points.insert (std::pair<float,string>(-30.0f, "-12"));
|
||||
points.insert (std::pair<float,string>(-27.0f, "-9"));
|
||||
//points.insert (std::pair<float,string>(-27.0f, "-9"));
|
||||
points.insert (std::pair<float,string>(-24.0f, "-6"));
|
||||
points.insert (std::pair<float,string>(-21.0f, "-3"));
|
||||
//points.insert (std::pair<float,string>(-21.0f, "-3"));
|
||||
|
||||
points.insert (std::pair<float,string>(-18.0f, "TST"));
|
||||
points.insert (std::pair<float,string>(-15.0f, "+3"));
|
||||
//points.insert (std::pair<float,string>(-15.0f, "+3"));
|
||||
points.insert (std::pair<float,string>(-12.0f, "+6"));
|
||||
points.insert (std::pair<float,string>( -9.0f, "+9"));
|
||||
points.insert (std::pair<float,string>( -6.0f, "+12"));
|
||||
//points.insert (std::pair<float,string>( -6.0f, "+12"));
|
||||
break;
|
||||
|
||||
case MeterIEC1DIN:
|
||||
overlay_midi = 2;
|
||||
//points.insert (std::pair<float,string>( -3.0f, "200%"));
|
||||
points.insert (std::pair<float,string>( -4.0f, "+5")); // "100%"
|
||||
points.insert (std::pair<float,string>( -9.0f, "0"));
|
||||
points.insert (std::pair<float,string>( -4.0f, "+5"));
|
||||
points.insert (std::pair<float,string>( -9.0f, "0")); // "100%";
|
||||
points.insert (std::pair<float,string>(-14.0f, "-5"));
|
||||
//points.insert (std::pair<float,string>(-15.0f, "50%"));
|
||||
//points.insert (std::pair<float,string>(-18.0f, "-9"));
|
||||
points.insert (std::pair<float,string>(-19.0f, "-10")); // "30%"
|
||||
points.insert (std::pair<float,string>(-29.0f, "-20")); // "10%"
|
||||
//points.insert (std::pair<float,string>(-35.0f, "-20")); // "5%"
|
||||
points.insert (std::pair<float,string>(-39.0f, "-30")); // "3%"
|
||||
//points.insert (std::pair<float,string>(-35.0f, "5%")); // "5%"
|
||||
points.insert (std::pair<float,string>(-39.0f, "-30"));
|
||||
//points.insert (std::pair<float,string>(-49.0f, "1%"));
|
||||
points.insert (std::pair<float,string>(-59.0f, "-50"));
|
||||
break;
|
||||
|
||||
case MeterVU:
|
||||
overlay_midi = 0;
|
||||
points.insert (std::pair<float,string>(-17.0f, "+3"));
|
||||
points.insert (std::pair<float,string>(-18.0f, "+2"));
|
||||
points.insert (std::pair<float,string>(-19.0f, "+1"));
|
||||
points.insert (std::pair<float,string>(-20.0f, "0"));
|
||||
points.insert (std::pair<float,string>(-20.0f, " 0"));
|
||||
points.insert (std::pair<float,string>(-21.0f, "-1"));
|
||||
points.insert (std::pair<float,string>(-22.0f, "-2"));
|
||||
points.insert (std::pair<float,string>(-23.0f, "-3"));
|
||||
|
|
@ -661,8 +774,8 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
break;
|
||||
case DataType::MIDI:
|
||||
layout->set_attributes (midi_font_attributes);
|
||||
points.insert (std::pair<float,string>( 0, "0"));
|
||||
if (types.size() == 1) {
|
||||
points.insert (std::pair<float,string>( 0, "0"));
|
||||
points.insert (std::pair<float,string>( 16, "16"));
|
||||
points.insert (std::pair<float,string>( 32, "32"));
|
||||
points.insert (std::pair<float,string>( 48, "48"));
|
||||
|
|
@ -672,16 +785,40 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
points.insert (std::pair<float,string>(100, "100"));
|
||||
points.insert (std::pair<float,string>(112, "112"));
|
||||
} else {
|
||||
/* labels that don't overlay with dB */
|
||||
points.insert (std::pair<float,string>( 24, "24"));
|
||||
points.insert (std::pair<float,string>( 48, "48"));
|
||||
points.insert (std::pair<float,string>( 72, "74"));
|
||||
switch (overlay_midi) {
|
||||
case 1:
|
||||
/* labels that don't overlay with dBFS */
|
||||
points.insert (std::pair<float,string>( 0, "0"));
|
||||
points.insert (std::pair<float,string>( 24, "24"));
|
||||
points.insert (std::pair<float,string>( 48, "48"));
|
||||
points.insert (std::pair<float,string>( 72, "72"));
|
||||
points.insert (std::pair<float,string>(127, "127"));
|
||||
break;
|
||||
case 2:
|
||||
/* labels that don't overlay with DIN */
|
||||
points.insert (std::pair<float,string>( 0, "0"));
|
||||
points.insert (std::pair<float,string>( 16, "16"));
|
||||
points.insert (std::pair<float,string>( 40, "40"));
|
||||
points.insert (std::pair<float,string>( 64, "64"));
|
||||
points.insert (std::pair<float,string>(112, "112"));
|
||||
points.insert (std::pair<float,string>(127, "127"));
|
||||
break;
|
||||
case 3:
|
||||
/* labels that don't overlay with BBC nor EBU*/
|
||||
points.insert (std::pair<float,string>( 0, "0"));
|
||||
points.insert (std::pair<float,string>( 16, "16"));
|
||||
points.insert (std::pair<float,string>( 56, "56"));
|
||||
points.insert (std::pair<float,string>( 72, "72"));
|
||||
points.insert (std::pair<float,string>(112, "112"));
|
||||
points.insert (std::pair<float,string>(127, "127"));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
points.insert (std::pair<float,string>(127, "127"));
|
||||
break;
|
||||
}
|
||||
|
||||
gint pos;
|
||||
gint pos = -1;
|
||||
|
||||
for (std::map<float,string>::const_iterator j = points.begin(); j != points.end(); ++j) {
|
||||
float fraction = 0;
|
||||
|
|
@ -708,6 +845,7 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
fraction = (j->first) / 127.0;
|
||||
pos = 1 + height - (gint) rintf (height * fraction);
|
||||
pos = min (pos, height);
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
if (tickleft) {
|
||||
cairo_arc(cr, width - 2.0, pos + .5, 1.0, 0, 2 * M_PI);
|
||||
cairo_fill(cr);
|
||||
|
|
@ -718,6 +856,8 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
break;
|
||||
}
|
||||
|
||||
if (pos < 0) continue;
|
||||
|
||||
layout->set_text(j->second.c_str());
|
||||
|
||||
int tw, th;
|
||||
|
|
@ -732,12 +872,26 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
} else {
|
||||
cairo_move_to (cr, width-3-tw, p);
|
||||
}
|
||||
|
||||
cairo_set_line_width(cr, 0.12);
|
||||
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
|
||||
pango_cairo_layout_path(cr, layout->gobj());
|
||||
cairo_stroke_preserve (cr);
|
||||
cairo_set_line_width(cr, 1.0);
|
||||
|
||||
if ((*i) == DataType::AUDIO) {
|
||||
mtr_col_and_fract(cr, &c, peakcolor, type, j->first);
|
||||
} else {
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
}
|
||||
|
||||
pango_cairo_show_layout (cr, layout->gobj());
|
||||
cairo_new_path(cr);
|
||||
}
|
||||
}
|
||||
|
||||
// add legend
|
||||
if (types.size() == 1) {
|
||||
if (types.size() == 1 || overlay_midi == 0) {
|
||||
int tw, th;
|
||||
layout->set_attributes (unit_font_attributes);
|
||||
switch (types.at(0)) {
|
||||
|
|
@ -777,7 +931,9 @@ meter_render_metrics (Gtk::Widget& w, MeterType type, vector<DataType> types)
|
|||
layout->get_pixel_size(tw, th);
|
||||
break;
|
||||
}
|
||||
Gdk::Color c = w.get_style()->get_fg (Gtk::STATE_ACTIVE);
|
||||
if (!background) {
|
||||
c = w.get_style()->get_fg (Gtk::STATE_ACTIVE);
|
||||
}
|
||||
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
|
||||
if (tickleft) {
|
||||
cairo_move_to (cr, width - 2 - tw, height - th - 0.5);
|
||||
|
|
@ -809,7 +965,7 @@ ArdourMeter::meter_expose_ticks (GdkEventExpose *ev, MeterType type, std::vector
|
|||
cairo_clip (cr);
|
||||
|
||||
cairo_pattern_t* pattern;
|
||||
const MeterMatricsMapKey key (mta->get_name(), type);
|
||||
const MeterMatricsMapKey key (mta->get_name(), type, types_to_bit(types));
|
||||
MetricPatternMap::iterator i = ticks_patterns.find (key);
|
||||
|
||||
if (i == ticks_patterns.end()) {
|
||||
|
|
@ -847,7 +1003,7 @@ ArdourMeter::meter_expose_metrics (GdkEventExpose *ev, MeterType type, std::vect
|
|||
cairo_clip (cr);
|
||||
|
||||
cairo_pattern_t* pattern;
|
||||
const MeterMatricsMapKey key (mma->get_name(), type);
|
||||
const MeterMatricsMapKey key (mma->get_name(), type, types_to_bit(types));
|
||||
MetricPatternMap::iterator i = metric_patterns.find (key);
|
||||
|
||||
if (i == metric_patterns.end()) {
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ using namespace ArdourMeter;
|
|||
|
||||
PBD::Signal1<void,MeterStrip*> MeterStrip::CatchDeletion;
|
||||
PBD::Signal0<void> MeterStrip::MetricChanged;
|
||||
PBD::Signal0<void> MeterStrip::ConfigurationChanged;
|
||||
|
||||
MeterStrip::MeterStrip (int metricmode, MeterType mt)
|
||||
: AxisView(0)
|
||||
|
|
@ -63,9 +64,14 @@ MeterStrip::MeterStrip (int metricmode, MeterType mt)
|
|||
{
|
||||
level_meter = 0;
|
||||
_strip_type = 0;
|
||||
set_spacing(2);
|
||||
_tick_bar = 0;
|
||||
_metricmode = -1;
|
||||
metric_type = MeterPeak;
|
||||
mtr_vbox.set_spacing(2);
|
||||
nfo_vbox.set_spacing(2);
|
||||
peakbx.set_size_request(-1, 14);
|
||||
namebx.set_size_request(18, 52);
|
||||
spacer.set_size_request(-1,0);
|
||||
|
||||
set_metric_mode(metricmode, mt);
|
||||
|
||||
|
|
@ -76,15 +82,30 @@ MeterStrip::MeterStrip (int metricmode, MeterType mt)
|
|||
|
||||
meterbox.pack_start(meter_metric_area, true, false);
|
||||
|
||||
pack_start (peakbx, false, false);
|
||||
pack_start (meterbox, true, true);
|
||||
pack_start (btnbox, false, false);
|
||||
pack_start (namebx, false, false);
|
||||
mtr_vbox.pack_start (peakbx, false, false);
|
||||
mtr_vbox.pack_start (meterbox, true, true);
|
||||
mtr_vbox.pack_start (spacer, false, false);
|
||||
mtr_container.add(mtr_vbox);
|
||||
|
||||
mtr_hsep.set_size_request(-1,1);
|
||||
mtr_hsep.set_name("BlackSeparator");
|
||||
|
||||
nfo_vbox.pack_start (mtr_hsep, false, false);
|
||||
nfo_vbox.pack_start (btnbox, false, false);
|
||||
nfo_vbox.pack_start (namebx, false, false);
|
||||
|
||||
pack_start (mtr_container, true, true);
|
||||
pack_start (nfo_vbox, false, false);
|
||||
|
||||
peakbx.show();
|
||||
btnbox.show();
|
||||
meter_metric_area.show();
|
||||
meterbox.show();
|
||||
spacer.show();
|
||||
mtr_vbox.show();
|
||||
mtr_container.show();
|
||||
mtr_hsep.show();
|
||||
nfo_vbox.show();
|
||||
|
||||
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &MeterStrip::on_theme_changed));
|
||||
ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
|
||||
|
|
@ -97,11 +118,15 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
|||
, _route(rt)
|
||||
, peak_display()
|
||||
{
|
||||
set_spacing(2);
|
||||
mtr_vbox.set_spacing(2);
|
||||
nfo_vbox.set_spacing(2);
|
||||
RouteUI::set_route (rt);
|
||||
SessionHandlePtr::set_session (sess);
|
||||
|
||||
_has_midi = false;
|
||||
_tick_bar = 0;
|
||||
_metricmode = -1;
|
||||
metric_type = MeterPeak;
|
||||
|
||||
int meter_width = 6;
|
||||
if (_route->shared_peak_meter()->input_streams().n_total() == 1) {
|
||||
|
|
@ -109,12 +134,12 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
|||
}
|
||||
|
||||
// level meter + ticks
|
||||
level_meter = new LevelMeter(sess);
|
||||
level_meter = new LevelMeterHBox(sess);
|
||||
level_meter->set_meter (_route->shared_peak_meter().get());
|
||||
level_meter->clear_meters();
|
||||
level_meter->set_type (_route->meter_type());
|
||||
level_meter->setup_meters (220, meter_width, 6);
|
||||
level_meter->ButtonPress.connect_same_thread (level_meter_connection, boost::bind (&MeterStrip::level_meter_button_press, this, _1));
|
||||
level_meter->ButtonRelease.connect_same_thread (level_meter_connection, boost::bind (&MeterStrip::level_meter_button_release, this, _1));
|
||||
level_meter->MeterTypeChanged.connect_same_thread (level_meter_connection, boost::bind (&MeterStrip::meter_type_changed, this, _1));
|
||||
|
||||
meter_align.set(0.5, 0.5, 0.0, 1.0);
|
||||
|
|
@ -147,6 +172,7 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
|||
name_label.set_size_request(18, 50);
|
||||
name_label.set_alignment(-1.0, .5);
|
||||
ARDOUR_UI::instance()->set_tip (name_label, _route->name());
|
||||
ARDOUR_UI::instance()->set_tip (*level_meter, _route->name());
|
||||
|
||||
namebx.set_size_request(18, 52);
|
||||
namebx.pack_start(name_label, true, false, 3);
|
||||
|
|
@ -170,24 +196,42 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
|||
mutebox.set_size_request(16, 16);
|
||||
solobox.set_size_request(16, 16);
|
||||
recbox.set_size_request(16, 16);
|
||||
spacer.set_size_request(-1,0);
|
||||
|
||||
update_button_box();
|
||||
update_name_box();
|
||||
update_background (_route->meter_type());
|
||||
|
||||
mtr_vbox.pack_start (peakbx, false, false);
|
||||
mtr_vbox.pack_start (meterbox, true, true);
|
||||
mtr_vbox.pack_start (spacer, false, false);
|
||||
mtr_container.add(mtr_vbox);
|
||||
|
||||
mtr_hsep.set_size_request(-1,1);
|
||||
mtr_hsep.set_name("BlackSeparator");
|
||||
|
||||
nfo_vbox.pack_start (mtr_hsep, false, false);
|
||||
nfo_vbox.pack_start (btnbox, false, false);
|
||||
nfo_vbox.pack_start (namebx, false, false);
|
||||
|
||||
pack_start (mtr_container, true, true);
|
||||
pack_start (nfo_vbox, false, false);
|
||||
|
||||
pack_start (peakbx, false, false);
|
||||
pack_start (meterbox, true, true);
|
||||
pack_start (btnbox, false, false);
|
||||
pack_start (namebx, false, false);
|
||||
name_label.show();
|
||||
peak_display.show();
|
||||
peakbx.show();
|
||||
meter_ticks1_area.show();
|
||||
meter_ticks2_area.show();
|
||||
meterbox.show();
|
||||
spacer.show();
|
||||
level_meter->show();
|
||||
meter_align.show();
|
||||
peak_align.show();
|
||||
btnbox.show();
|
||||
mtr_vbox.show();
|
||||
mtr_container.show();
|
||||
mtr_hsep.show();
|
||||
nfo_vbox.show();
|
||||
|
||||
_route->shared_peak_meter()->ConfigurationChanged.connect (
|
||||
route_connections, invalidator (*this), boost::bind (&MeterStrip::meter_configuration_changed, this, _1), gui_context()
|
||||
|
|
@ -210,6 +254,7 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
|||
_route->PropertyChanged.connect (route_connections, invalidator (*this), boost::bind (&MeterStrip::strip_property_changed, this, _1), gui_context());
|
||||
|
||||
peak_display.signal_button_release_event().connect (sigc::mem_fun(*this, &MeterStrip::peak_button_release), false);
|
||||
name_label.signal_button_release_event().connect (sigc::mem_fun(*this, &MeterStrip::name_label_button_release), false);
|
||||
|
||||
UI::instance()->theme_changed.connect (sigc::mem_fun(*this, &MeterStrip::on_theme_changed));
|
||||
ColorsChanged.connect (sigc::mem_fun (*this, &MeterStrip::on_theme_changed));
|
||||
|
|
@ -235,8 +280,10 @@ MeterStrip::MeterStrip (Session* sess, boost::shared_ptr<ARDOUR::Route> rt)
|
|||
|
||||
MeterStrip::~MeterStrip ()
|
||||
{
|
||||
delete level_meter;
|
||||
CatchDeletion (this);
|
||||
if (level_meter) {
|
||||
delete level_meter;
|
||||
CatchDeletion (this);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -303,6 +350,9 @@ MeterStrip::strip_property_changed (const PropertyChange& what_changed)
|
|||
ENSURE_GUI_THREAD (*this, &MeterStrip::strip_name_changed, what_changed)
|
||||
name_label.set_text(_route->name());
|
||||
ARDOUR_UI::instance()->set_tip (name_label, _route->name());
|
||||
if (level_meter) {
|
||||
ARDOUR_UI::instance()->set_tip (*level_meter, _route->name());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -347,13 +397,13 @@ MeterStrip::meter_configuration_changed (ChanCount c)
|
|||
if (boost::dynamic_pointer_cast<AudioTrack>(_route) == 0
|
||||
&& boost::dynamic_pointer_cast<MidiTrack>(_route) == 0
|
||||
) {
|
||||
meter_ticks1_area.set_name ("AudioBusMetricsLeft");
|
||||
meter_ticks2_area.set_name ("AudioBusMetricsRight");
|
||||
meter_ticks1_area.set_name ("MyAudioBusMetricsLeft");
|
||||
meter_ticks2_area.set_name ("MyAudioBusMetricsRight");
|
||||
_has_midi = false;
|
||||
}
|
||||
else if (type == (1 << DataType::AUDIO)) {
|
||||
meter_ticks1_area.set_name ("AudioTrackMetricsLeft");
|
||||
meter_ticks2_area.set_name ("AudioTrackMetricsRight");
|
||||
meter_ticks1_area.set_name ("MyAudioTrackMetricsLeft");
|
||||
meter_ticks2_area.set_name ("MyAudioTrackMetricsRight");
|
||||
_has_midi = false;
|
||||
}
|
||||
else if (type == (1 << DataType::MIDI)) {
|
||||
|
|
@ -365,9 +415,40 @@ MeterStrip::meter_configuration_changed (ChanCount c)
|
|||
meter_ticks2_area.set_name ("AudioMidiTrackMetricsRight");
|
||||
_has_midi = true;
|
||||
}
|
||||
set_tick_bar(_tick_bar);
|
||||
|
||||
if (old_has_midi != _has_midi) MetricChanged();
|
||||
on_theme_changed();
|
||||
if (old_has_midi != _has_midi) MetricChanged();
|
||||
else ConfigurationChanged();
|
||||
}
|
||||
|
||||
void
|
||||
MeterStrip::set_tick_bar (int m)
|
||||
{
|
||||
std::string n;
|
||||
_tick_bar = m;
|
||||
if (_tick_bar & 1) {
|
||||
n = meter_ticks1_area.get_name();
|
||||
if (n.substr(0,3) != "Bar") {
|
||||
meter_ticks1_area.set_name("Bar" + n);
|
||||
}
|
||||
} else {
|
||||
n = meter_ticks1_area.get_name();
|
||||
if (n.substr(0,3) == "Bar") {
|
||||
meter_ticks1_area.set_name(n.substr(3,-1));
|
||||
}
|
||||
}
|
||||
if (_tick_bar & 2) {
|
||||
n = meter_ticks2_area.get_name();
|
||||
if (n.substr(0,3) != "Bar") {
|
||||
meter_ticks2_area.set_name("Bar" + n);
|
||||
}
|
||||
} else {
|
||||
n = meter_ticks2_area.get_name();
|
||||
if (n.substr(0,3) == "Bar") {
|
||||
meter_ticks2_area.set_name(n.substr(3,-1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -380,9 +461,31 @@ void
|
|||
MeterStrip::on_size_allocate (Gtk::Allocation& a)
|
||||
{
|
||||
const int wh = a.get_height();
|
||||
int nh = ceilf(wh * .11f);
|
||||
if (nh < 52) nh = 52;
|
||||
if (nh > 148) nh = 148;
|
||||
int nh;
|
||||
int mh = 0;
|
||||
if (_session) {
|
||||
mh = _session->config.get_meterbridge_label_height();
|
||||
}
|
||||
switch (mh) {
|
||||
default:
|
||||
case 0:
|
||||
nh = ceilf(wh * .12f);
|
||||
if (nh < 52) nh = 52;
|
||||
if (nh > 148) nh = 148;
|
||||
break;
|
||||
case 1:
|
||||
nh = 52;
|
||||
break;
|
||||
case 2:
|
||||
nh = 88;
|
||||
break;
|
||||
case 3:
|
||||
nh = 106;
|
||||
break;
|
||||
case 4:
|
||||
nh = 148;
|
||||
break;
|
||||
}
|
||||
namebx.set_size_request(18, nh);
|
||||
if (_route) {
|
||||
name_label.set_size_request(18, nh-2);
|
||||
|
|
@ -404,7 +507,12 @@ MeterStrip::meter_metrics_expose (GdkEventExpose *ev)
|
|||
void
|
||||
MeterStrip::set_metric_mode (int metricmode, ARDOUR::MeterType mt)
|
||||
{
|
||||
if (metric_type == mt && _metricmode == metricmode) {
|
||||
return;
|
||||
}
|
||||
metric_type = mt;
|
||||
_metricmode = metricmode;
|
||||
|
||||
_types.clear ();
|
||||
switch(metricmode) {
|
||||
case 0:
|
||||
|
|
@ -425,10 +533,30 @@ MeterStrip::set_metric_mode (int metricmode, ARDOUR::MeterType mt)
|
|||
_types.push_back (DataType::AUDIO);
|
||||
break;
|
||||
}
|
||||
|
||||
update_background (mt);
|
||||
meter_metric_area.queue_draw ();
|
||||
}
|
||||
|
||||
void
|
||||
MeterStrip::update_background(MeterType type)
|
||||
{
|
||||
switch(type) {
|
||||
case MeterIEC1DIN:
|
||||
case MeterIEC1NOR:
|
||||
case MeterIEC2BBC:
|
||||
case MeterIEC2EBU:
|
||||
case MeterK14:
|
||||
case MeterK20:
|
||||
mtr_container.set_name ("meterstripPPM");
|
||||
break;
|
||||
case MeterVU:
|
||||
mtr_container.set_name ("meterstripVU");
|
||||
break;
|
||||
default:
|
||||
mtr_container.set_name ("meterstripDPM");
|
||||
}
|
||||
}
|
||||
|
||||
MeterType
|
||||
MeterStrip::meter_type()
|
||||
{
|
||||
|
|
@ -556,11 +684,13 @@ MeterStrip::parameter_changed (std::string const & p)
|
|||
else if (p == "show-name-on-meterbridge") {
|
||||
update_name_box();
|
||||
}
|
||||
else if (p == "meterbridge-label-height") {
|
||||
queue_resize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
MeterStrip::level_meter_button_press (GdkEventButton* ev)
|
||||
MeterStrip::level_meter_button_release (GdkEventButton* ev)
|
||||
{
|
||||
if (ev->button == 3) {
|
||||
popup_level_meter_menu (ev);
|
||||
|
|
@ -581,15 +711,15 @@ MeterStrip::popup_level_meter_menu (GdkEventButton* ev)
|
|||
RadioMenuItem::Group group;
|
||||
|
||||
_suspend_menu_callbacks = true;
|
||||
add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterPeak), MeterPeak);
|
||||
add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterKrms), MeterKrms);
|
||||
add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterIEC1DIN), MeterIEC1DIN);
|
||||
add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterIEC1NOR), MeterIEC1NOR);
|
||||
add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterIEC2BBC), MeterIEC2BBC);
|
||||
add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterIEC2EBU), MeterIEC2EBU);
|
||||
add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterK20), MeterK20);
|
||||
add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterK14), MeterK14);
|
||||
add_level_meter_item (items, group, ArdourMeter::meter_type_string(MeterVU), MeterVU);
|
||||
add_level_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterPeak), MeterPeak);
|
||||
add_level_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterKrms), MeterKrms);
|
||||
add_level_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterIEC1DIN), MeterIEC1DIN);
|
||||
add_level_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterIEC1NOR), MeterIEC1NOR);
|
||||
add_level_meter_type_item (items, group, ArdourMeter::meter_type_string(MeterIEC2BBC), MeterIEC2BBC);
|
||||
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(MeterVU), MeterVU);
|
||||
|
||||
MeterType cmt = _route->meter_type();
|
||||
const std::string cmn = ArdourMeter::meter_type_string(cmt);
|
||||
|
|
@ -606,8 +736,53 @@ MeterStrip::popup_level_meter_menu (GdkEventButton* ev)
|
|||
_suspend_menu_callbacks = false;
|
||||
}
|
||||
|
||||
bool
|
||||
MeterStrip::name_label_button_release (GdkEventButton* ev)
|
||||
{
|
||||
if (!_session) return true;
|
||||
if (!_session->config.get_show_name_on_meterbridge()) return true;
|
||||
|
||||
if (ev->button == 3) {
|
||||
popup_name_label_menu (ev);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
MeterStrip::add_level_meter_item (Menu_Helpers::MenuList& items, RadioMenuItem::Group& group, string const & name, MeterType type)
|
||||
MeterStrip::popup_name_label_menu (GdkEventButton* ev)
|
||||
{
|
||||
using namespace Gtk::Menu_Helpers;
|
||||
|
||||
Gtk::Menu* m = manage (new Menu);
|
||||
MenuList& items = m->items ();
|
||||
|
||||
RadioMenuItem::Group group;
|
||||
|
||||
_suspend_menu_callbacks = true;
|
||||
add_label_height_item (items, group, _("Variable height"), 0);
|
||||
add_label_height_item (items, group, _("Short"), 1);
|
||||
add_label_height_item (items, group, _("Tall"), 2);
|
||||
add_label_height_item (items, group, _("Grande"), 3);
|
||||
add_label_height_item (items, group, _("Venti"), 4);
|
||||
|
||||
m->popup (ev->button, ev->time);
|
||||
_suspend_menu_callbacks = false;
|
||||
}
|
||||
|
||||
void
|
||||
MeterStrip::add_label_height_item (Menu_Helpers::MenuList& items, RadioMenuItem::Group& group, string const & name, uint32_t h)
|
||||
{
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
items.push_back (RadioMenuElem (group, name, sigc::bind (sigc::mem_fun (*this, &MeterStrip::set_label_height), h)));
|
||||
RadioMenuItem* i = dynamic_cast<RadioMenuItem *> (&items.back ());
|
||||
i->set_active (_session && _session->config.get_meterbridge_label_height() == h);
|
||||
}
|
||||
|
||||
void
|
||||
MeterStrip::add_level_meter_type_item (Menu_Helpers::MenuList& items, RadioMenuItem::Group& group, string const & name, MeterType type)
|
||||
{
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
|
|
@ -620,15 +795,25 @@ void
|
|||
MeterStrip::set_meter_type (MeterType type)
|
||||
{
|
||||
if (_suspend_menu_callbacks) return;
|
||||
if (_route->meter_type() == type) return;
|
||||
|
||||
level_meter->set_type (type);
|
||||
}
|
||||
|
||||
void
|
||||
MeterStrip::set_label_height (uint32_t h)
|
||||
{
|
||||
if (_suspend_menu_callbacks) return;
|
||||
_session->config.set_meterbridge_label_height(h);
|
||||
}
|
||||
|
||||
void
|
||||
MeterStrip::meter_type_changed (MeterType type)
|
||||
{
|
||||
if (_route->meter_type() != type) {
|
||||
_route->set_meter_type(type);
|
||||
}
|
||||
update_background (type);
|
||||
MetricChanged();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ class MeterStrip : public Gtk::VBox, public RouteUI
|
|||
|
||||
static PBD::Signal1<void,MeterStrip*> CatchDeletion;
|
||||
static PBD::Signal0<void> MetricChanged;
|
||||
static PBD::Signal0<void> ConfigurationChanged;
|
||||
|
||||
void reset_peak_display ();
|
||||
void reset_route_peak_display (ARDOUR::Route*);
|
||||
|
|
@ -64,6 +65,9 @@ class MeterStrip : public Gtk::VBox, public RouteUI
|
|||
void set_meter_type_multi (int, ARDOUR::RouteGroup*, ARDOUR::MeterType);
|
||||
|
||||
void set_metric_mode (int, ARDOUR::MeterType);
|
||||
int get_metric_mode() { return _metricmode; }
|
||||
void set_tick_bar (int);
|
||||
int get_tick_bar() { return _tick_bar; }
|
||||
bool has_midi() { return _has_midi; }
|
||||
bool is_metric_display() { return _strip_type == 0; }
|
||||
ARDOUR::MeterType meter_type();
|
||||
|
|
@ -89,7 +93,12 @@ class MeterStrip : public Gtk::VBox, public RouteUI
|
|||
void set_button_names ();
|
||||
|
||||
private:
|
||||
Gtk::VBox mtr_vbox;
|
||||
Gtk::VBox nfo_vbox;
|
||||
Gtk::EventBox mtr_container;
|
||||
Gtk::HSeparator mtr_hsep;
|
||||
Gtk::HBox meterbox;
|
||||
Gtk::HBox spacer;
|
||||
Gtk::HBox namebx;
|
||||
ArdourButton name_label;
|
||||
Gtk::DrawingArea meter_metric_area;
|
||||
|
|
@ -111,16 +120,17 @@ class MeterStrip : public Gtk::VBox, public RouteUI
|
|||
|
||||
float max_peak;
|
||||
bool _has_midi;
|
||||
int _tick_bar;
|
||||
int _strip_type;
|
||||
int _metricmode;
|
||||
|
||||
LevelMeter *level_meter;
|
||||
LevelMeterHBox *level_meter;
|
||||
|
||||
PBD::ScopedConnection _config_connection;
|
||||
void strip_property_changed (const PBD::PropertyChange&);
|
||||
void meter_configuration_changed (ARDOUR::ChanCount);
|
||||
void meter_type_changed (ARDOUR::MeterType);
|
||||
|
||||
static int max_pattern_metric_size; // == FastMeter::max_pattern_metric_size
|
||||
void update_background (ARDOUR::MeterType);
|
||||
|
||||
bool peak_button_release (GdkEventButton*);
|
||||
|
||||
|
|
@ -130,10 +140,16 @@ class MeterStrip : public Gtk::VBox, public RouteUI
|
|||
void update_name_box ();
|
||||
|
||||
bool _suspend_menu_callbacks;
|
||||
bool level_meter_button_press (GdkEventButton* ev);
|
||||
bool level_meter_button_release (GdkEventButton* ev);
|
||||
void popup_level_meter_menu (GdkEventButton* ev);
|
||||
void add_level_meter_item (Gtk::Menu_Helpers::MenuList& items, Gtk::RadioMenuItem::Group& group, std::string const & name, ARDOUR::MeterType mode);
|
||||
void add_level_meter_type_item (Gtk::Menu_Helpers::MenuList&, Gtk::RadioMenuItem::Group&, std::string const &, ARDOUR::MeterType);
|
||||
|
||||
bool name_label_button_release (GdkEventButton* ev);
|
||||
void popup_name_label_menu (GdkEventButton* ev);
|
||||
void add_label_height_item (Gtk::Menu_Helpers::MenuList&, Gtk::RadioMenuItem::Group&, std::string const &, uint32_t);
|
||||
|
||||
void set_meter_type (ARDOUR::MeterType mode);
|
||||
void set_label_height (uint32_t);
|
||||
};
|
||||
|
||||
#endif /* __ardour_mixer_strip__ */
|
||||
|
|
|
|||
|
|
@ -141,6 +141,7 @@ Meterbridge::Meterbridge ()
|
|||
Route::SyncOrderKeys.connect (*this, invalidator (*this), boost::bind (&Meterbridge::sync_order_keys, this, _1), 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());
|
||||
|
||||
/* work around ScrolledWindowViewport alignment mess Part one */
|
||||
Gtk::HBox * yspc = manage (new Gtk::HBox());
|
||||
|
|
@ -336,9 +337,31 @@ Meterbridge::on_size_request (Gtk::Requisition* r)
|
|||
Gtk::Window::on_size_request(r);
|
||||
|
||||
Gdk::Geometry geom;
|
||||
geom.max_width = meterarea.get_width() + metrics_left.get_width() + metrics_right.get_width();
|
||||
Gtk::Requisition mr = meterarea.size_request();
|
||||
|
||||
geom.max_width = mr.width + metrics_left.get_width() + metrics_right.get_width();
|
||||
geom.max_height = max_height;
|
||||
|
||||
#ifndef GTKOSX
|
||||
/* on OSX this leads to a constant live-loop: show/hide scrollbar
|
||||
* on Linux, the window is resized IFF the scrollbar was not visible
|
||||
*/
|
||||
const Gtk::Scrollbar * hsc = scroller.get_hscrollbar();
|
||||
Glib::RefPtr<Gdk::Screen> screen = get_screen ();
|
||||
Gdk::Rectangle monitor_rect;
|
||||
screen->get_monitor_geometry (0, monitor_rect);
|
||||
const int scr_w = monitor_rect.get_width() - 44;
|
||||
|
||||
if (cur_max_width < geom.max_width
|
||||
&& cur_max_width < scr_w
|
||||
&& !(scroller.get_hscrollbar_visible() && hsc)) {
|
||||
int h = r->height;
|
||||
*r = Gtk::Requisition();
|
||||
r->width = geom.max_width;
|
||||
r->height = h;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (cur_max_width != geom.max_width) {
|
||||
cur_max_width = geom.max_width;
|
||||
geom.height_inc = 16;
|
||||
|
|
@ -353,6 +376,10 @@ Meterbridge::on_size_allocate (Gtk::Allocation& a)
|
|||
const Gtk::Scrollbar * hsc = scroller.get_hscrollbar();
|
||||
|
||||
if (scroller.get_hscrollbar_visible() && hsc) {
|
||||
if (!scroll_connection.connected()) {
|
||||
scroll_connection = scroller.get_hscrollbar()->get_adjustment()->signal_value_changed().connect(sigc::mem_fun (*this, &Meterbridge::on_scroll));
|
||||
scroller.get_hscrollbar()->get_adjustment()->signal_changed().connect(sigc::mem_fun (*this, &Meterbridge::on_scroll));
|
||||
}
|
||||
gint scrollbar_spacing;
|
||||
gtk_widget_style_get (GTK_WIDGET (scroller.gobj()),
|
||||
"scrollbar-spacing", &scrollbar_spacing, NULL);
|
||||
|
|
@ -366,6 +393,41 @@ Meterbridge::on_size_allocate (Gtk::Allocation& a)
|
|||
Gtk::Window::on_size_allocate(a);
|
||||
}
|
||||
|
||||
void
|
||||
Meterbridge::on_scroll()
|
||||
{
|
||||
if (!scroller.get_hscrollbar()) return;
|
||||
|
||||
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
|
||||
int leftend = adj->get_value();
|
||||
int rightend = scroller.get_width() + leftend;
|
||||
|
||||
int mm_left = _mm_left;
|
||||
int mm_right = _mm_right;
|
||||
ARDOUR::MeterType mt_left = _mt_left;
|
||||
ARDOUR::MeterType mt_right = _mt_right;
|
||||
|
||||
for (unsigned int i = 0; i < _metrics.size(); ++i) {
|
||||
int sx, dx, dy;
|
||||
int mm = _metrics[i]->get_metric_mode();
|
||||
sx = (mm & 2) ? _metrics[i]->get_width() : 0;
|
||||
|
||||
_metrics[i]->translate_coordinates(meterarea, sx, 0, dx, dy);
|
||||
|
||||
if (dx < leftend && !(mm&2)) {
|
||||
mm_left = mm;
|
||||
mt_left = _metrics[i]->meter_type();
|
||||
}
|
||||
if (dx > rightend && (mm&2)) {
|
||||
mm_right = mm;
|
||||
mt_right = _metrics[i]->meter_type();
|
||||
break;
|
||||
}
|
||||
}
|
||||
metrics_left.set_metric_mode(mm_left, mt_left);
|
||||
metrics_right.set_metric_mode(mm_right, mt_right);
|
||||
}
|
||||
|
||||
void
|
||||
Meterbridge::set_session (Session* s)
|
||||
{
|
||||
|
|
@ -570,10 +632,12 @@ Meterbridge::remove_strip (MeterStrip* strip)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
resync_order();
|
||||
}
|
||||
|
||||
void
|
||||
Meterbridge::sync_order_keys (RouteSortOrderKey src)
|
||||
Meterbridge::sync_order_keys (RouteSortOrderKey)
|
||||
{
|
||||
Glib::Threads::Mutex::Lock lm (_resync_mutex);
|
||||
|
||||
|
|
@ -582,6 +646,7 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
|
|||
|
||||
int pos = 0;
|
||||
int vis = 0;
|
||||
MeterStrip * last = 0;
|
||||
|
||||
unsigned int metrics = 0;
|
||||
MeterType lmt = MeterPeak;
|
||||
|
|
@ -633,14 +698,24 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
|
|||
vis++;
|
||||
}
|
||||
|
||||
(*i).s->set_tick_bar(0);
|
||||
|
||||
MeterType nmt = (*i).s->meter_type();
|
||||
if (nmt == MeterKrms) nmt = MeterPeak; // identical metrics
|
||||
if (pos == 0) {
|
||||
(*i).s->set_tick_bar(1);
|
||||
}
|
||||
|
||||
if ((*i).visible && nmt != lmt && pos == 0) {
|
||||
lmt = nmt;
|
||||
metrics_left.set_metric_mode(1, lmt);
|
||||
} else if ((*i).visible && nmt != lmt) {
|
||||
|
||||
if (last) {
|
||||
last->set_tick_bar(last->get_tick_bar() | 2);
|
||||
}
|
||||
(*i).s->set_tick_bar((*i).s->get_tick_bar() | 1);
|
||||
|
||||
if (_metrics.size() <= metrics) {
|
||||
_metrics.push_back(new MeterStrip(have_midi ? 2 : 3, lmt));
|
||||
meterarea.pack_start (*_metrics[metrics], false, false);
|
||||
|
|
@ -672,6 +747,13 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
|
|||
}
|
||||
|
||||
meterarea.reorder_child(*((*i).s), pos++);
|
||||
if ((*i).visible) {
|
||||
last = (*i).s;
|
||||
}
|
||||
}
|
||||
|
||||
if (last) {
|
||||
last->set_tick_bar(last->get_tick_bar() | 2);
|
||||
}
|
||||
|
||||
metrics_right.set_metric_mode(have_midi ? 2 : 3, lmt);
|
||||
|
|
@ -681,6 +763,14 @@ Meterbridge::sync_order_keys (RouteSortOrderKey src)
|
|||
delete (_metrics.back());
|
||||
_metrics.pop_back();
|
||||
}
|
||||
|
||||
_mm_left = metrics_left.get_metric_mode();
|
||||
_mt_left = metrics_left.meter_type();
|
||||
_mm_right = metrics_right.get_metric_mode();
|
||||
_mt_right = metrics_right.meter_type();
|
||||
|
||||
on_scroll();
|
||||
queue_resize();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -719,6 +809,9 @@ Meterbridge::parameter_changed (std::string const & p)
|
|||
else if (p == "show-name-on-meterbridge") {
|
||||
scroller.queue_resize();
|
||||
}
|
||||
else if (p == "meterbridge-label-height") {
|
||||
scroller.queue_resize();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -147,6 +147,12 @@ class Meterbridge :
|
|||
|
||||
void parameter_changed (std::string const & p);
|
||||
void on_theme_changed ();
|
||||
|
||||
void on_scroll ();
|
||||
sigc::connection scroll_connection;
|
||||
|
||||
int _mm_left, _mm_right;
|
||||
ARDOUR::MeterType _mt_left, _mt_right;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -300,7 +300,11 @@ MidiTracer::tracer (Parser&, byte* msg, size_t len)
|
|||
s += snprintf (
|
||||
&buf[s], bufsize, " MTC full frame to %02d:%02d:%02d:%02d\n", msg[5] & 0x1f, msg[6], msg[7], msg[8]
|
||||
);
|
||||
} else if (len == 3 && msg[0] == MIDI::position) {
|
||||
|
||||
/* MIDI Song Position */
|
||||
int midi_beats = (msg[2] << 7) | msg[1];
|
||||
s += snprintf (&buf[s], bufsize, "%16s %d\n", "Position", (int) midi_beats);
|
||||
} else {
|
||||
|
||||
/* other sys-ex */
|
||||
|
|
|
|||
|
|
@ -1926,7 +1926,7 @@ void
|
|||
Mixer_UI::toggle_midi_input_active (bool flip_others)
|
||||
{
|
||||
boost::shared_ptr<RouteList> rl (new RouteList);
|
||||
bool onoff;
|
||||
bool onoff = false;
|
||||
|
||||
set_route_targets_for_operation ();
|
||||
|
||||
|
|
|
|||
2508
gtk2_ardour/po/de.po
2508
gtk2_ardour/po/de.po
File diff suppressed because it is too large
Load diff
|
|
@ -564,8 +564,22 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
|
|||
}
|
||||
|
||||
for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
|
||||
if (!extra_other[*i].empty()) {
|
||||
boost::shared_ptr<Bundle> b = make_bundle_from_ports (extra_other[*i], *i, inputs);
|
||||
if (extra_other[*i].empty()) continue;
|
||||
std::string cp;
|
||||
std::vector<std::string> nb;
|
||||
for (uint32_t j = 0; j < extra_other[*i].size(); ++j) {
|
||||
std::string nn = extra_other[*i][j];
|
||||
std::string pf = nn.substr (0, nn.find_first_of (":") + 1);
|
||||
if (pf != cp && !nb.empty()) {
|
||||
boost::shared_ptr<Bundle> b = make_bundle_from_ports (nb, *i, inputs);
|
||||
other->add_bundle (b);
|
||||
nb.clear();
|
||||
}
|
||||
cp = pf;
|
||||
nb.push_back(extra_other[*i][j]);
|
||||
}
|
||||
if (!nb.empty()) {
|
||||
boost::shared_ptr<Bundle> b = make_bundle_from_ports (nb, *i, inputs);
|
||||
other->add_bundle (b);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ PortMatrix::init ()
|
|||
|
||||
/* and also bundles */
|
||||
_session->BundleAdded.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports, this), gui_context());
|
||||
_session->BundleRemoved.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports, this), gui_context());
|
||||
|
||||
/* and also ports */
|
||||
_session->engine().PortRegisteredOrUnregistered.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports, this), gui_context());
|
||||
|
|
@ -180,6 +181,7 @@ PortMatrix::reconnect_to_routes ()
|
|||
boost::shared_ptr<RouteList> routes = _session->get_routes ();
|
||||
for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
|
||||
(*i)->processors_changed.connect (_route_connections, invalidator (*this), boost::bind (&PortMatrix::route_processors_changed, this, _1), gui_context());
|
||||
(*i)->DropReferences.connect (_route_connections, invalidator (*this), boost::bind (&PortMatrix::routes_changed, this), gui_context());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -198,6 +200,7 @@ PortMatrix::route_processors_changed (RouteProcessorChange c)
|
|||
void
|
||||
PortMatrix::routes_changed ()
|
||||
{
|
||||
if (!_session) return;
|
||||
reconnect_to_routes ();
|
||||
setup_global_ports ();
|
||||
}
|
||||
|
|
@ -206,7 +209,10 @@ PortMatrix::routes_changed ()
|
|||
void
|
||||
PortMatrix::setup ()
|
||||
{
|
||||
if (!_session) return; // session went away
|
||||
if (!_session) {
|
||||
_route_connections.drop_connections ();
|
||||
return; // session went away
|
||||
}
|
||||
|
||||
/* this needs to be done first, as the visible_ports() method uses the
|
||||
notebook state to decide which ports are being shown */
|
||||
|
|
@ -330,6 +336,13 @@ PortMatrix::select_arrangement ()
|
|||
_vbox.pack_end (_vnotebook, false, false);
|
||||
_vbox.pack_end (_vspacer, true, true);
|
||||
|
||||
#define REMOVE_FROM_GTK_PARENT(WGT) if ((WGT).get_parent()) { (WGT).get_parent()->remove(WGT);}
|
||||
REMOVE_FROM_GTK_PARENT(*_body)
|
||||
REMOVE_FROM_GTK_PARENT(_vscroll)
|
||||
REMOVE_FROM_GTK_PARENT(_hscroll)
|
||||
REMOVE_FROM_GTK_PARENT(_vbox)
|
||||
REMOVE_FROM_GTK_PARENT(_hbox)
|
||||
|
||||
attach (*_body, 2, 3, 1, 2, FILL | EXPAND, FILL | EXPAND);
|
||||
attach (_vscroll, 3, 4, 1, 2, SHRINK);
|
||||
attach (_hscroll, 2, 3, 3, 4, FILL | EXPAND, SHRINK);
|
||||
|
|
@ -349,6 +362,12 @@ PortMatrix::select_arrangement ()
|
|||
_vbox.pack_end (_vnotebook, false, false);
|
||||
_vbox.pack_end (_vlabel, false, false);
|
||||
|
||||
REMOVE_FROM_GTK_PARENT(*_body)
|
||||
REMOVE_FROM_GTK_PARENT(_vscroll)
|
||||
REMOVE_FROM_GTK_PARENT(_hscroll)
|
||||
REMOVE_FROM_GTK_PARENT(_vbox)
|
||||
REMOVE_FROM_GTK_PARENT(_hbox)
|
||||
|
||||
attach (*_body, 1, 2, 2, 3, FILL | EXPAND, FILL | EXPAND);
|
||||
attach (_vscroll, 3, 4, 2, 3, SHRINK);
|
||||
attach (_hscroll, 1, 2, 3, 4, FILL | EXPAND, SHRINK);
|
||||
|
|
@ -727,7 +746,7 @@ PortMatrix::remove_channel (ARDOUR::BundleChannel b)
|
|||
int const r = io->remove_port (p, this);
|
||||
if (r == -1) {
|
||||
ArdourDialog d (_("Port removal not allowed"));
|
||||
Label l (_("This port cannot be removed, as the first plugin in the track or buss cannot accept the new number of inputs."));
|
||||
Label l (_("This port cannot be removed.\nEither the first plugin in the track or buss cannot accept\nthe new number of inputs or the last plugin has more outputs."));
|
||||
d.get_vbox()->pack_start (l);
|
||||
d.add_button (Stock::OK, RESPONSE_ACCEPT);
|
||||
d.set_modal (true);
|
||||
|
|
|
|||
|
|
@ -1315,6 +1315,14 @@ RCOptionEditor::RCOptionEditor ()
|
|||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_track_meters)
|
||||
));
|
||||
|
||||
add_option (_("Editor"),
|
||||
new BoolOption (
|
||||
"show-editor-meter",
|
||||
_("Display master-meter in the toolbar"),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_editor_meter),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_editor_meter)
|
||||
));
|
||||
|
||||
bco = new BoolComboOption (
|
||||
"use-overlap-equivalency",
|
||||
_("Regions in active edit groups are edited together"),
|
||||
|
|
@ -1933,15 +1941,30 @@ RCOptionEditor::RCOptionEditor ()
|
|||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_line_up_level)
|
||||
);
|
||||
|
||||
mlu->add (MeteringLineUp24, _("-24dBFS"));
|
||||
mlu->add (MeteringLineUp20, _("-20dBFS (SMPTE)"));
|
||||
mlu->add (MeteringLineUp24, _("-24dBFS (SMPTE US: 4dBu = -20dBFS)"));
|
||||
mlu->add (MeteringLineUp20, _("-20dBFS (SMPTE RP.0155)"));
|
||||
mlu->add (MeteringLineUp18, _("-18dBFS (EBU, BBC)"));
|
||||
mlu->add (MeteringLineUp15, _("-15dBFS (DIN)"));
|
||||
|
||||
Gtkmm2ext::UI::instance()->set_tip (mlu->tip_widget(), _("Configure meter-ticks and color-knee point for dBFS scale DPM, set reference/offset level for IEC PPM."));
|
||||
Gtkmm2ext::UI::instance()->set_tip (mlu->tip_widget(), _("Configure meter-marks and color-knee point for dBFS scale DPM, set reference level for IEC1/Nordic, IEC2 PPM and VU meter."));
|
||||
|
||||
add_option (S_("Preferences|GUI"), mlu);
|
||||
|
||||
ComboOption<MeterLineUp>* mld = new ComboOption<MeterLineUp> (
|
||||
"meter-line-up-din",
|
||||
_("IEC1/DIN Meter line-up level; 0dBu"),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::get_meter_line_up_din),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_line_up_din)
|
||||
);
|
||||
|
||||
mld->add (MeteringLineUp24, _("-24dBFS (SMPTE US: 4dBu = -20dBFS)"));
|
||||
mld->add (MeteringLineUp20, _("-20dBFS (SMPTE RP.0155)"));
|
||||
mld->add (MeteringLineUp18, _("-18dBFS (EBU, BBC)"));
|
||||
mld->add (MeteringLineUp15, _("-15dBFS (DIN)"));
|
||||
|
||||
Gtkmm2ext::UI::instance()->set_tip (mld->tip_widget(), _("Reference level for IEC1/DIN meter."));
|
||||
|
||||
add_option (S_("Preferences|GUI"), mld);
|
||||
|
||||
ComboOption<VUMeterStandard>* mvu = new ComboOption<VUMeterStandard> (
|
||||
"meter-vu-standard",
|
||||
|
|
@ -1950,9 +1973,10 @@ RCOptionEditor::RCOptionEditor ()
|
|||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_vu_standard)
|
||||
);
|
||||
|
||||
mvu->add (MeteringVUfrench, _("+2dB (France)"));
|
||||
mvu->add (MeteringVUamerican, _(" 0dB (North America, Australia)"));
|
||||
mvu->add (MeteringVUstandard, _("-4dB (standard)"));
|
||||
mvu->add (MeteringVUfrench, _("0VU = -2dBu (France)"));
|
||||
mvu->add (MeteringVUamerican, _("0VU = 0dBu (North America, Australia)"));
|
||||
mvu->add (MeteringVUstandard, _("0VU = +4dBu (standard)"));
|
||||
mvu->add (MeteringVUeight, _("0VU = +8dBu"));
|
||||
|
||||
add_option (S_("Preferences|GUI"), mvu);
|
||||
|
||||
|
|
@ -1969,6 +1993,15 @@ RCOptionEditor::RCOptionEditor ()
|
|||
_("Specify the audio signal level in dbFS at and above which the meter-peak indicator will flash red."));
|
||||
|
||||
add_option (S_("Preferences|GUI"), mpks);
|
||||
|
||||
add_option (S_("Preferences|GUI"),
|
||||
new BoolOption (
|
||||
"meter-style-led",
|
||||
_("LED meter style"),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::get_meter_style_led),
|
||||
sigc::mem_fun (*_rc_config, &RCConfiguration::set_meter_style_led)
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include "ardour/return.h"
|
||||
#include "ardour/route.h"
|
||||
#include "ardour/send.h"
|
||||
#include "ardour/internal_send.h"
|
||||
|
||||
#include "ardour_ui.h"
|
||||
#include "gui_thread.h"
|
||||
|
|
@ -510,7 +511,12 @@ RouteParams_UI::redirect_selected (boost::shared_ptr<ARDOUR::Processor> proc)
|
|||
boost::shared_ptr<PluginInsert> plugin_insert;
|
||||
boost::shared_ptr<PortInsert> port_insert;
|
||||
|
||||
if ((send = boost::dynamic_pointer_cast<Send> (proc)) != 0) {
|
||||
if ((boost::dynamic_pointer_cast<InternalSend> (proc)) != 0) {
|
||||
cleanup_view();
|
||||
_processor.reset ((Processor*) 0);
|
||||
update_title();
|
||||
return;
|
||||
} else if ((send = boost::dynamic_pointer_cast<Send> (proc)) != 0) {
|
||||
|
||||
SendUI *send_ui = new SendUI (this, send, _session);
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ using namespace ARDOUR;
|
|||
using namespace PBD;
|
||||
|
||||
uint32_t RouteUI::_max_invert_buttons = 3;
|
||||
sigc::signal<void, boost::shared_ptr<Route> > RouteUI::BusSendDisplayChanged;
|
||||
PBD::Signal1<void, boost::shared_ptr<Route> > RouteUI::BusSendDisplayChanged;
|
||||
boost::weak_ptr<Route> RouteUI::_showing_sends_to;
|
||||
|
||||
RouteUI::RouteUI (ARDOUR::Session* sess)
|
||||
|
|
@ -171,7 +171,7 @@ RouteUI::init ()
|
|||
monitor_disk_button->signal_button_press_event().connect (sigc::mem_fun(*this, &RouteUI::monitor_disk_press));
|
||||
monitor_disk_button->signal_button_release_event().connect (sigc::mem_fun(*this, &RouteUI::monitor_disk_release));
|
||||
|
||||
BusSendDisplayChanged.connect (sigc::mem_fun (*this, &RouteUI::bus_send_display_changed));
|
||||
BusSendDisplayChanged.connect_same_thread (*this, boost::bind(&RouteUI::bus_send_display_changed, this, _1));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ class RouteUI : public virtual AxisView
|
|||
* by a click on the `Sends' button. The parameter is the route that the sends are
|
||||
* to, or 0 if no route is now in this mode.
|
||||
*/
|
||||
static sigc::signal<void, boost::shared_ptr<ARDOUR::Route> > BusSendDisplayChanged;
|
||||
static PBD::Signal1<void, boost::shared_ptr<ARDOUR::Route> > BusSendDisplayChanged;
|
||||
|
||||
protected:
|
||||
PBD::ScopedConnectionList route_connections;
|
||||
|
|
|
|||
|
|
@ -724,10 +724,8 @@ SystemExec::start (int stderr_mode)
|
|||
signal(SIGPIPE, SIG_DFL);
|
||||
#endif
|
||||
|
||||
#ifndef __WIN32__
|
||||
int good_fds[1] = { 0 };
|
||||
int good_fds[1] = { -1 };
|
||||
close_allv(good_fds);
|
||||
#endif
|
||||
|
||||
::execve(argp[0], argp, envp);
|
||||
/* if we reach here something went wrong.. */
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "i18n.h"
|
||||
|
||||
using namespace PBD;
|
||||
using namespace VideoUtils;
|
||||
|
||||
TranscodeFfmpeg::TranscodeFfmpeg (std::string f)
|
||||
: infile(f)
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ using namespace Gtk;
|
|||
using namespace std;
|
||||
using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
using namespace VideoUtils;
|
||||
|
||||
TranscodeVideoDialog::TranscodeVideoDialog (Session* s, std::string infile)
|
||||
: ArdourDialog (_("Transcode/Import Video File "))
|
||||
|
|
|
|||
|
|
@ -301,6 +301,53 @@ rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a, s
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
rgba_p_from_style (string style, float *r, float *g, float *b, string attr, int state)
|
||||
{
|
||||
static Gtk::Window* window = 0;
|
||||
assert (r && g && b);
|
||||
|
||||
if (window == 0) {
|
||||
window = new Window (WINDOW_TOPLEVEL);
|
||||
}
|
||||
|
||||
Gtk::EventBox foo;
|
||||
|
||||
window->add (foo);
|
||||
|
||||
foo.set_name (style);
|
||||
foo.ensure_style ();
|
||||
|
||||
GtkRcStyle* rc = foo.get_style()->gobj()->rc_style;
|
||||
|
||||
if (!rc) {
|
||||
warning << string_compose (_("missing RGBA style for \"%1\""), style) << endl;
|
||||
return false;
|
||||
}
|
||||
if (attr == "fg") {
|
||||
*r = rc->fg[state].red / 65535.0;
|
||||
*g = rc->fg[state].green / 65535.0;
|
||||
*b = rc->fg[state].blue / 65535.0;
|
||||
} else if (attr == "bg") {
|
||||
*r = rc->bg[state].red / 65535.0;
|
||||
*g = rc->bg[state].green / 65535.0;
|
||||
*b = rc->bg[state].blue / 65535.0;
|
||||
} else if (attr == "base") {
|
||||
*r = rc->base[state].red / 65535.0;
|
||||
*g = rc->base[state].green / 65535.0;
|
||||
*b = rc->base[state].blue / 65535.0;
|
||||
} else if (attr == "text") {
|
||||
*r = rc->text[state].red / 65535.0;
|
||||
*g = rc->text[state].green / 65535.0;
|
||||
*b = rc->text[state].blue / 65535.0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
window->remove ();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
canvas_item_visible (ArdourCanvas::Item* item)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -56,6 +56,8 @@ Pango::FontDescription get_font_for_style (std::string widgetname);
|
|||
|
||||
uint32_t rgba_from_style (std::string, uint32_t, uint32_t, uint32_t, uint32_t, std::string = "fg", int = Gtk::STATE_NORMAL, bool = true);
|
||||
|
||||
bool rgba_p_from_style (std::string, float*, float*, float*, std::string = "fg", int = Gtk::STATE_NORMAL);
|
||||
|
||||
void decorate (Gtk::Window& w, Gdk::WMDecoration d);
|
||||
|
||||
bool canvas_item_visible (ArdourCanvas::Item* item);
|
||||
|
|
|
|||
|
|
@ -35,9 +35,10 @@ using namespace Gtk;
|
|||
using namespace std;
|
||||
using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
using namespace VideoUtils;
|
||||
|
||||
bool
|
||||
confirm_video_outfn (std::string outfn, std::string docroot)
|
||||
VideoUtils::confirm_video_outfn (std::string outfn, std::string docroot)
|
||||
{
|
||||
/* replace docroot's '/' to G_DIR_SEPARATOR for the comparison */
|
||||
size_t look_here = 0;
|
||||
|
|
@ -77,7 +78,7 @@ confirm_video_outfn (std::string outfn, std::string docroot)
|
|||
}
|
||||
|
||||
std::string
|
||||
video_dest_dir (const std::string sessiondir, const std::string docroot)
|
||||
VideoUtils::video_dest_dir (const std::string sessiondir, const std::string docroot)
|
||||
{
|
||||
std::string dir = docroot;
|
||||
if (dir.empty() || !dir.compare(0, dir.length(), sessiondir, 0, dir.length())) {
|
||||
|
|
@ -92,7 +93,7 @@ video_dest_dir (const std::string sessiondir, const std::string docroot)
|
|||
}
|
||||
|
||||
std::string
|
||||
video_get_docroot (ARDOUR::RCConfiguration* config)
|
||||
VideoUtils::video_get_docroot (ARDOUR::RCConfiguration* config)
|
||||
{
|
||||
if (config->get_video_advanced_setup()) {
|
||||
return config->get_video_server_docroot();
|
||||
|
|
@ -101,7 +102,7 @@ video_get_docroot (ARDOUR::RCConfiguration* config)
|
|||
}
|
||||
|
||||
std::string
|
||||
video_get_server_url (ARDOUR::RCConfiguration* config)
|
||||
VideoUtils::video_get_server_url (ARDOUR::RCConfiguration* config)
|
||||
{
|
||||
if (config->get_video_advanced_setup()) {
|
||||
return config->get_video_server_url();
|
||||
|
|
@ -111,7 +112,7 @@ video_get_server_url (ARDOUR::RCConfiguration* config)
|
|||
|
||||
|
||||
std::string
|
||||
strip_file_extension (const std::string infile)
|
||||
VideoUtils::strip_file_extension (const std::string infile)
|
||||
{
|
||||
std::string rv;
|
||||
char *ext, *bn = strdup(infile.c_str());
|
||||
|
|
@ -126,7 +127,7 @@ strip_file_extension (const std::string infile)
|
|||
}
|
||||
|
||||
std::string
|
||||
get_file_extension (const std::string infile)
|
||||
VideoUtils::get_file_extension (const std::string infile)
|
||||
{
|
||||
std::string rv = "";
|
||||
char *ext, *bn = strdup(infile.c_str());
|
||||
|
|
@ -140,13 +141,13 @@ get_file_extension (const std::string infile)
|
|||
}
|
||||
|
||||
std::string
|
||||
video_dest_file (const std::string dir, const std::string infile)
|
||||
VideoUtils::video_dest_file (const std::string dir, const std::string infile)
|
||||
{
|
||||
return dir + "a3_" + strip_file_extension(Glib::path_get_basename(infile)) + ".avi";
|
||||
}
|
||||
|
||||
std::string
|
||||
video_map_path (std::string server_docroot, std::string filepath)
|
||||
VideoUtils::video_map_path (std::string server_docroot, std::string filepath)
|
||||
{
|
||||
std::string rv = filepath;
|
||||
|
||||
|
|
@ -179,7 +180,7 @@ video_map_path (std::string server_docroot, std::string filepath)
|
|||
}
|
||||
|
||||
void
|
||||
ParseCSV (const std::string &csv, std::vector<std::vector<std::string> > &lines)
|
||||
VideoUtils::ParseCSV (const std::string &csv, std::vector<std::vector<std::string> > &lines)
|
||||
{
|
||||
bool inQuote(false);
|
||||
bool newLine(false);
|
||||
|
|
@ -236,7 +237,7 @@ ParseCSV (const std::string &csv, std::vector<std::vector<std::string> > &lines)
|
|||
}
|
||||
|
||||
bool
|
||||
video_query_info (
|
||||
VideoUtils::video_query_info (
|
||||
std::string video_server_url,
|
||||
std::string filepath,
|
||||
double &video_file_fps,
|
||||
|
|
@ -247,52 +248,32 @@ video_query_info (
|
|||
{
|
||||
char url[2048];
|
||||
|
||||
snprintf(url, sizeof(url), "%s%sinfo/?file=%s&format=plain"
|
||||
snprintf(url, sizeof(url), "%s%sinfo/?file=%s&format=csv"
|
||||
, video_server_url.c_str()
|
||||
, (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
|
||||
, filepath.c_str());
|
||||
char *res = curl_http_get(url, NULL);
|
||||
int pid=0;
|
||||
if (res) {
|
||||
char *pch, *pst;
|
||||
int version;
|
||||
pch = strtok_r(res, "\n", &pst);
|
||||
while (pch) {
|
||||
#if 0 /* DEBUG */
|
||||
printf("VideoFileInfo [%i] -> '%s'\n", pid, pch);
|
||||
#endif
|
||||
switch (pid) {
|
||||
case 0:
|
||||
version = atoi(pch);
|
||||
if (version != 1) break;
|
||||
case 1:
|
||||
video_file_fps = atof(pch);
|
||||
break;
|
||||
case 2:
|
||||
video_duration = atoll(pch);
|
||||
break;
|
||||
case 3:
|
||||
video_start_offset = atof(pch);
|
||||
break;
|
||||
case 4:
|
||||
video_aspect_ratio = atof(pch);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
pch = strtok_r(NULL,"\n", &pst);
|
||||
++pid;
|
||||
}
|
||||
free(res);
|
||||
}
|
||||
if (pid!=5) {
|
||||
char *res = a3_curl_http_get(url, NULL);
|
||||
if (!res) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<std::vector<std::string> > lines;
|
||||
ParseCSV(std::string(res), lines);
|
||||
free(res);
|
||||
|
||||
if (lines.empty() || lines.at(0).empty() || lines.at(0).size() != 6) {
|
||||
return false;
|
||||
}
|
||||
if (atoi(lines.at(0).at(0)) != 1) return false; // version
|
||||
video_start_offset = 0.0;
|
||||
video_aspect_ratio = atof (lines.at(0).at(3));
|
||||
video_file_fps = atof (lines.at(0).at(4));
|
||||
video_duration = atoll(lines.at(0).at(5));
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
video_draw_cross (Glib::RefPtr<Gdk::Pixbuf> img)
|
||||
VideoUtils::video_draw_cross (Glib::RefPtr<Gdk::Pixbuf> img)
|
||||
{
|
||||
|
||||
int rowstride = img->get_rowstride();
|
||||
|
|
@ -319,7 +300,7 @@ video_draw_cross (Glib::RefPtr<Gdk::Pixbuf> img)
|
|||
extern "C" {
|
||||
#include <curl/curl.h>
|
||||
|
||||
struct MemoryStruct {
|
||||
struct A3MemoryStruct {
|
||||
char *data;
|
||||
size_t size;
|
||||
};
|
||||
|
|
@ -327,7 +308,7 @@ extern "C" {
|
|||
static size_t
|
||||
WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data) {
|
||||
size_t realsize = size * nmemb;
|
||||
struct MemoryStruct *mem = (struct MemoryStruct *)data;
|
||||
struct A3MemoryStruct *mem = (struct A3MemoryStruct *)data;
|
||||
|
||||
mem->data = (char *)realloc(mem->data, mem->size + realsize + 1);
|
||||
if (mem->data) {
|
||||
|
|
@ -338,10 +319,10 @@ extern "C" {
|
|||
return realsize;
|
||||
}
|
||||
|
||||
char *curl_http_get (const char *u, int *status) {
|
||||
char *a3_curl_http_get (const char *u, int *status) {
|
||||
CURL *curl;
|
||||
CURLcode res;
|
||||
struct MemoryStruct chunk;
|
||||
struct A3MemoryStruct chunk;
|
||||
long int httpstatus;
|
||||
if (status) *status = 0;
|
||||
//usleep(500000); return NULL; // TEST & DEBUG
|
||||
|
|
@ -370,7 +351,7 @@ extern "C" {
|
|||
if (status) *status = httpstatus;
|
||||
if (res) {
|
||||
#ifdef CURLERRORDEBUG
|
||||
printf("curl_http_get() failed: %s\n", curlerror);
|
||||
printf("a3_curl_http_get() failed: %s\n", curlerror);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
#include "ardour/template_utils.h"
|
||||
#include "ardour_dialog.h"
|
||||
|
||||
namespace VideoUtils {
|
||||
|
||||
bool confirm_video_outfn (std::string, std::string docroot="");
|
||||
std::string video_dest_dir (const std::string, const std::string);
|
||||
std::string video_dest_file (const std::string, const std::string);
|
||||
|
|
@ -52,9 +54,10 @@ bool video_query_info (
|
|||
double &video_start_offset,
|
||||
double &video_aspect_ratio
|
||||
);
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
char *curl_http_get (const char *u, int *status);
|
||||
char *a3_curl_http_get (const char *u, int *status);
|
||||
}
|
||||
|
||||
#endif /* __gtk_ardour_video_utils_h__ */
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace ARDOUR;
|
||||
using namespace VideoUtils;
|
||||
|
||||
VideoImageFrame::VideoImageFrame (PublicEditor& ed, ArdourCanvas::Group& parent, int w, int h, std::string vsurl, std::string vfn)
|
||||
: editor (ed)
|
||||
|
|
@ -196,7 +197,7 @@ http_get_thread (void *arg) {
|
|||
int timeout = 1000; // * 5ms -> 5sec
|
||||
char *res = NULL;
|
||||
do {
|
||||
res=curl_http_get(url, &status);
|
||||
res=a3_curl_http_get(url, &status);
|
||||
if (status == 503) usleep(5000); // try-again
|
||||
} while (status == 503 && --timeout > 0);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ using namespace Gtk;
|
|||
using namespace std;
|
||||
using namespace PBD;
|
||||
using namespace ARDOUR;
|
||||
using namespace VideoUtils;
|
||||
|
||||
VideoServerDialog::VideoServerDialog (Session* s)
|
||||
: ArdourDialog (_("Launch Video Server"))
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ using namespace std;
|
|||
using namespace ARDOUR;
|
||||
using namespace PBD;
|
||||
using namespace Timecode;
|
||||
using namespace VideoUtils;
|
||||
|
||||
VideoTimeLine::VideoTimeLine (PublicEditor *ed, ArdourCanvas::Group *vbg, int initial_height)
|
||||
: editor (ed)
|
||||
|
|
@ -502,14 +503,18 @@ VideoTimeLine::video_file_info (std::string filename, bool local)
|
|||
_session->config.set_timecode_format(timecode_60);
|
||||
break;
|
||||
default:
|
||||
warning << _("Failed to set session-framerate: ") << video_file_fps << _(" does not have a corresponding option setting in Ardour.") << endmsg; /* TODO: gettext arg */
|
||||
warning << string_compose (
|
||||
_("Failed to set session-framerate: '%1' does not have a corresponding option setting in %2."),
|
||||
video_file_fps, PROGRAM_NAME ) << endmsg;
|
||||
break;
|
||||
}
|
||||
_session->config.set_video_pullup(0); /* TODO only set if set_timecode_format() was successful ?!*/
|
||||
}
|
||||
if (floor(video_file_fps*100) != floor(_session->timecode_frames_per_second()*100)) {
|
||||
warning << _("Video file's framerate is not equal to Ardour session timecode's framerate: ")
|
||||
<< video_file_fps << _(" vs ") << _session->timecode_frames_per_second() << endmsg;
|
||||
warning << string_compose(
|
||||
_("Video file's framerate is not equal to %1 session timecode's framerate: '%2' vs '%3'"),
|
||||
PROGRAM_NAME, video_file_fps, _session->timecode_frames_per_second())
|
||||
<< endmsg;
|
||||
}
|
||||
flush_local_cache ();
|
||||
|
||||
|
|
@ -548,7 +553,7 @@ VideoTimeLine::check_server ()
|
|||
, video_server_url.c_str()
|
||||
, (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
|
||||
);
|
||||
char *res=curl_http_get(url, NULL);
|
||||
char *res=a3_curl_http_get(url, NULL);
|
||||
if (res) {
|
||||
if (strstr(res, "status: ok, online.")) { ok = true; }
|
||||
free(res);
|
||||
|
|
@ -570,7 +575,7 @@ VideoTimeLine::check_server_docroot ()
|
|||
, video_server_url.c_str()
|
||||
, (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
|
||||
);
|
||||
char *res=curl_http_get(url, NULL);
|
||||
char *res=a3_curl_http_get(url, NULL);
|
||||
if (!res) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -580,8 +585,8 @@ VideoTimeLine::check_server_docroot ()
|
|||
|| lines.at(0).empty()
|
||||
|| lines.at(0).at(0) != video_get_docroot(Config)) {
|
||||
warning << string_compose(
|
||||
_("Video-server docroot mismatch. Ardour: '%1', video-server: '%2'. This usually means that the video server was not started by ardour and uses a different document-root."),
|
||||
video_get_docroot(Config), lines.at(0).at(0))
|
||||
_("Video-server docroot mismatch. %1: '%2', video-server: '%3'. This usually means that the video server was not started by ardour and uses a different document-root."),
|
||||
PROGRAM_NAME, video_get_docroot(Config), lines.at(0).at(0))
|
||||
<< endmsg;
|
||||
ok = false; // TODO allow to override
|
||||
}
|
||||
|
|
@ -666,7 +671,7 @@ VideoTimeLine::flush_cache () {
|
|||
, video_server_url.c_str()
|
||||
, (video_server_url.length()>0 && video_server_url.at(video_server_url.length()-1) == '/')?"":"/"
|
||||
);
|
||||
char *res=curl_http_get(url, NULL);
|
||||
char *res=a3_curl_http_get(url, NULL);
|
||||
if (res) {
|
||||
free (res);
|
||||
}
|
||||
|
|
@ -814,8 +819,8 @@ VideoTimeLine::terminated_video_monitor () {
|
|||
vmonitor->save_session();
|
||||
delete vmonitor;
|
||||
}
|
||||
GuiUpdate("set-xjadeo-active-off");
|
||||
vmonitor=0;
|
||||
GuiUpdate("set-xjadeo-active-off");
|
||||
if (reopen_vmonitor) {
|
||||
reopen_vmonitor=false;
|
||||
open_video_monitor();
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class VideoTimeLine : public sigc::trackable, public ARDOUR::SessionHandlePtr, p
|
|||
float get_apv(); /* audio frames per video frame; */
|
||||
ARDOUR::framecnt_t get_duration () { return video_duration;}
|
||||
ARDOUR::frameoffset_t get_offset () { return video_offset;}
|
||||
ARDOUR::frameoffset_t quantify_frames_to_apv (ARDOUR::frameoffset_t offset) { return floor(offset/get_apv())*get_apv(); }
|
||||
ARDOUR::frameoffset_t quantify_frames_to_apv (ARDOUR::frameoffset_t offset) { return rint(offset/get_apv())*get_apv(); }
|
||||
void set_offset (ARDOUR::frameoffset_t offset) { video_offset = quantify_frames_to_apv(offset); } // this function does not update video_offset_p, call save_undo() to finalize changes to this! - this fn is currently only used from editor_drag.cc
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ Amp::display_name() const
|
|||
}
|
||||
|
||||
bool
|
||||
Amp::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
Amp::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
out = in;
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public:
|
|||
|
||||
bool visible () const;
|
||||
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
|
||||
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ class AudioDiskstream : public Diskstream
|
|||
friend class AudioTrack;
|
||||
|
||||
int process (BufferSet&, framepos_t transport_frame, pframes_t nframes, framecnt_t &, bool need_disk_signal);
|
||||
frameoffset_t calculate_playback_distance (pframes_t nframes);
|
||||
bool commit (framecnt_t);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class AUPlugin : public ARDOUR::Plugin
|
|||
|
||||
bool has_editor () const;
|
||||
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
ChanCount output_streams() const;
|
||||
ChanCount input_streams() const;
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class CapturingProcessor : public Processor
|
|||
int set_block_size (pframes_t nframes);
|
||||
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool result_required);
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
virtual XMLNode& state (bool);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public:
|
|||
std::string display_name() const;
|
||||
|
||||
Role role() const { return _role; }
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
|
||||
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
|
||||
|
|
|
|||
|
|
@ -193,6 +193,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
|
|||
friend class Track;
|
||||
|
||||
virtual int process (BufferSet&, framepos_t transport_frame, pframes_t nframes, framecnt_t &, bool need_disk_signal) = 0;
|
||||
virtual frameoffset_t calculate_playback_distance (pframes_t nframes) = 0;
|
||||
virtual bool commit (framecnt_t) = 0;
|
||||
|
||||
//private:
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class InternalReturn : public Return
|
|||
|
||||
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
|
||||
bool configure_io (ChanCount, ChanCount);
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
|
||||
void add_send (InternalSend *);
|
||||
void remove_send (InternalSend *);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class InternalSend : public Send
|
|||
void cycle_start (pframes_t);
|
||||
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
|
||||
bool feeds (boost::shared_ptr<Route> other) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
int set_block_size (pframes_t);
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public:
|
|||
void reset ();
|
||||
void reset_max ();
|
||||
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
|
||||
/* special method for meter, to ensure that it can always handle the maximum
|
||||
|
|
@ -75,6 +75,9 @@ public:
|
|||
/** Compute peaks */
|
||||
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
|
||||
|
||||
void activate () { }
|
||||
void deactivate () { }
|
||||
|
||||
ChanCount input_streams () const { return current_meters; }
|
||||
ChanCount output_streams () const { return current_meters; }
|
||||
|
||||
|
|
|
|||
|
|
@ -125,6 +125,7 @@ class MidiDiskstream : public Diskstream
|
|||
friend class MidiTrack;
|
||||
|
||||
int process (BufferSet&, framepos_t transport_frame, pframes_t nframes, framecnt_t &, bool need_diskstream);
|
||||
frameoffset_t calculate_playback_distance (pframes_t nframes);
|
||||
bool commit (framecnt_t nframes);
|
||||
static framecnt_t midi_readahead;
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ public:
|
|||
int set_state (const XMLNode&, int /* version */);
|
||||
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
|
||||
void set_cut_all (bool);
|
||||
void set_dim_all (bool);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public:
|
|||
|
||||
std::string describe_parameter (Evoral::Parameter param);
|
||||
|
||||
bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) const { return true; };
|
||||
bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) { return true; };
|
||||
void configure_io (ChanCount in, ChanCount out);
|
||||
|
||||
/// The fundamental Panner function
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ class Plugin : public PBD::StatefulDestructible, public Latent
|
|||
/* specific types of plugins can overload this. As of September 2008, only
|
||||
AUPlugin does this.
|
||||
*/
|
||||
virtual bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) const { return false; }
|
||||
virtual bool can_support_io_configuration (const ChanCount& /*in*/, ChanCount& /*out*/) { return false; }
|
||||
virtual ChanCount output_streams() const;
|
||||
virtual ChanCount input_streams() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class PluginInsert : public Processor
|
|||
bool set_count (uint32_t num);
|
||||
uint32_t get_count () const { return _plugins.size(); }
|
||||
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
|
||||
bool has_no_inputs() const;
|
||||
|
|
@ -160,6 +160,8 @@ class PluginInsert : public Processor
|
|||
BufferSet _signal_analysis_inputs;
|
||||
BufferSet _signal_analysis_outputs;
|
||||
|
||||
ChanCount midi_bypass;
|
||||
|
||||
/** Description of how we can match our plugin's IO to our own insert IO */
|
||||
struct Match {
|
||||
Match () : method (Impossible), plugins (0) {}
|
||||
|
|
@ -170,7 +172,7 @@ class PluginInsert : public Processor
|
|||
ChanCount hide; ///< number of channels to hide
|
||||
};
|
||||
|
||||
Match private_can_support_io_configuration (ChanCount const &, ChanCount &) const;
|
||||
Match private_can_support_io_configuration (ChanCount const &, ChanCount &);
|
||||
|
||||
/** details of the match currently being used */
|
||||
Match _match;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class PortInsert : public IOProcessor
|
|||
|
||||
bool set_name (const std::string& name);
|
||||
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
|
||||
void activate ();
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ public:
|
|||
*/
|
||||
|
||||
static BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
|
||||
static BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO);
|
||||
static BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = false);
|
||||
static BufferSet& get_route_buffers (ChanCount count = ChanCount::ZERO, bool silence = false);
|
||||
static BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO);
|
||||
static gain_t* gain_automation_buffer ();
|
||||
static gain_t* send_gain_automation_buffer ();
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class Processor : public SessionObject, public Automatable, public Latent
|
|||
|
||||
/* Derived classes should override these, or processor appears as an in-place pass-through */
|
||||
|
||||
virtual bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const = 0;
|
||||
virtual bool can_support_io_configuration (const ChanCount& in, ChanCount& out) = 0;
|
||||
virtual ChanCount input_streams () const { return _configured_input; }
|
||||
virtual ChanCount output_streams() const { return _configured_output; }
|
||||
|
||||
|
|
|
|||
|
|
@ -148,10 +148,13 @@ CONFIG_VARIABLE (bool, super_rapid_clock_update, "super-rapid-clock-update", fal
|
|||
/* metering */
|
||||
|
||||
CONFIG_VARIABLE (float, meter_hold, "meter-hold", 100.0f)
|
||||
CONFIG_VARIABLE (float, meter_falloff, "meter-falloff", 32.0f)
|
||||
CONFIG_VARIABLE (VUMeterStandard, meter_vu_standard, "meter-vu-standard", MeteringVUfrench)
|
||||
CONFIG_VARIABLE (float, meter_falloff, "meter-falloff", 13.3f)
|
||||
CONFIG_VARIABLE (VUMeterStandard, meter_vu_standard, "meter-vu-standard", MeteringVUstandard)
|
||||
CONFIG_VARIABLE (MeterLineUp, meter_line_up_level, "meter-line-up-level", MeteringLineUp18)
|
||||
CONFIG_VARIABLE (MeterLineUp, meter_line_up_din, "meter-line-up-din", MeteringLineUp15)
|
||||
CONFIG_VARIABLE (float, meter_peak, "meter-peak", 0.0f)
|
||||
CONFIG_VARIABLE (bool, meter_style_led, "meter-style-led", true)
|
||||
CONFIG_VARIABLE (bool, show_editor_meter, "show-editor-meter", true)
|
||||
|
||||
/* miscellany */
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public:
|
|||
|
||||
uint32_t pans_required() const { return _configured_input.n_audio(); }
|
||||
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
|
||||
static uint32_t how_many_returns();
|
||||
|
|
|
|||
|
|
@ -530,6 +530,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
|
|||
void silence_unlocked (framecnt_t);
|
||||
|
||||
ChanCount processor_max_streams;
|
||||
ChanCount processor_out_streams;
|
||||
|
||||
uint32_t pans_required() const;
|
||||
ChanCount n_process_buffers ();
|
||||
|
|
@ -553,8 +554,10 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
|
|||
void output_change_handler (IOChange, void *src);
|
||||
|
||||
bool input_port_count_changing (ChanCount);
|
||||
bool output_port_count_changing (ChanCount);
|
||||
|
||||
bool _in_configure_processors;
|
||||
bool _initial_io_setup;
|
||||
|
||||
int configure_processors_unlocked (ProcessorStreams*);
|
||||
std::list<std::pair<ChanCount, ChanCount> > try_configure_processors (ChanCount, ProcessorStreams *);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class Send : public Delivery
|
|||
|
||||
void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool);
|
||||
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const;
|
||||
bool can_support_io_configuration (const ChanCount& in, ChanCount& out);
|
||||
bool configure_io (ChanCount in, ChanCount out);
|
||||
|
||||
void activate ();
|
||||
|
|
|
|||
|
|
@ -200,7 +200,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
void process (pframes_t nframes);
|
||||
|
||||
BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
|
||||
BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO);
|
||||
BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = true );
|
||||
BufferSet& get_route_buffers (ChanCount count = ChanCount::ZERO, bool silence = true);
|
||||
BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO);
|
||||
|
||||
bool have_rec_enabled_track () const;
|
||||
|
|
@ -813,6 +814,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
|
||||
void send_mmc_locate (framepos_t);
|
||||
int send_full_time_code (framepos_t);
|
||||
void send_song_position_pointer (framepos_t);
|
||||
|
||||
bool step_editing() const { return (_step_editors > 0); }
|
||||
|
||||
|
|
@ -1209,6 +1211,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
|||
double ltc_enc_cnt;
|
||||
framepos_t ltc_enc_off;
|
||||
bool restarting;
|
||||
framepos_t ltc_prev_cycle;
|
||||
|
||||
framepos_t ltc_timecode_offset;
|
||||
bool ltc_timecode_negative_offset;
|
||||
|
|
|
|||
|
|
@ -64,3 +64,4 @@ CONFIG_VARIABLE (bool, show_rec_on_meterbridge, "show-rec-on-meterbridge", true)
|
|||
CONFIG_VARIABLE (bool, show_mute_on_meterbridge, "show-mute-on-meterbridge", false)
|
||||
CONFIG_VARIABLE (bool, show_solo_on_meterbridge, "show-solo-on-meterbridge", false)
|
||||
CONFIG_VARIABLE (bool, show_name_on_meterbridge, "show-name-on-meterbridge", true)
|
||||
CONFIG_VARIABLE (uint32_t, meterbridge_label_height, "meterbridge-label-height", 0)
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public:
|
|||
|
||||
BufferSet* silent_buffers;
|
||||
BufferSet* scratch_buffers;
|
||||
BufferSet* route_buffers;
|
||||
BufferSet* mix_buffers;
|
||||
gain_t* gain_automation_buffer;
|
||||
gain_t* send_gain_automation_buffer;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
#include "pbd/signals.h"
|
||||
|
||||
|
|
@ -42,7 +43,7 @@ class MidiClockTicker : public SessionHandlePtr, boost::noncopyable
|
|||
{
|
||||
public:
|
||||
MidiClockTicker ();
|
||||
virtual ~MidiClockTicker() {};
|
||||
virtual ~MidiClockTicker();
|
||||
|
||||
void tick (const framepos_t& transport_frames);
|
||||
|
||||
|
|
@ -63,6 +64,9 @@ public:
|
|||
/// slot for the signal session::TransportLooped
|
||||
void transport_looped();
|
||||
|
||||
/// slot for the signal session::Located
|
||||
void session_located();
|
||||
|
||||
/// pulses per quarter note (default 24)
|
||||
void set_ppqn(int ppqn) { _ppqn = ppqn; }
|
||||
|
||||
|
|
@ -71,12 +75,16 @@ private:
|
|||
int _ppqn;
|
||||
double _last_tick;
|
||||
|
||||
class Position;
|
||||
boost::scoped_ptr<Position> _pos;
|
||||
|
||||
double one_ppqn_in_frames (framepos_t transport_position);
|
||||
|
||||
void send_midi_clock_event (pframes_t offset);
|
||||
void send_start_event (pframes_t offset);
|
||||
void send_continue_event (pframes_t offset);
|
||||
void send_stop_event (pframes_t offset);
|
||||
void send_position_event (uint32_t midi_clocks, pframes_t offset);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -384,9 +384,10 @@ namespace ARDOUR {
|
|||
};
|
||||
|
||||
enum VUMeterStandard {
|
||||
MeteringVUfrench, // + 2
|
||||
MeteringVUamerican, // +-0
|
||||
MeteringVUstandard // -4
|
||||
MeteringVUfrench, // 0VU = -2dBu
|
||||
MeteringVUamerican, // 0VU = 0dBu
|
||||
MeteringVUstandard, // 0VU = +4dBu
|
||||
MeteringVUeight // 0VU = +8dBu
|
||||
};
|
||||
|
||||
enum MeterLineUp {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
bool can_support_io_configuration (const ChanCount &, ChanCount &) const {
|
||||
bool can_support_io_configuration (const ChanCount &, ChanCount &) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -700,6 +700,31 @@ AudioDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
|
|||
return 0;
|
||||
}
|
||||
|
||||
frameoffset_t
|
||||
AudioDiskstream::calculate_playback_distance (pframes_t nframes)
|
||||
{
|
||||
frameoffset_t playback_distance = nframes;
|
||||
|
||||
if (record_enabled()) {
|
||||
playback_distance = nframes;
|
||||
} else if (_actual_speed != 1.0f && _actual_speed != -1.0f) {
|
||||
interpolation.set_speed (_target_speed);
|
||||
boost::shared_ptr<ChannelList> c = channels.reader();
|
||||
int channel = 0;
|
||||
for (ChannelList::iterator chan = c->begin(); chan != c->end(); ++chan, ++channel) {
|
||||
playback_distance = interpolation.interpolate (channel, nframes, NULL, NULL);
|
||||
}
|
||||
} else {
|
||||
playback_distance = nframes;
|
||||
}
|
||||
|
||||
if (_actual_speed < 0.0) {
|
||||
return -playback_distance;
|
||||
} else {
|
||||
return playback_distance;
|
||||
}
|
||||
}
|
||||
|
||||
/** Update various things including playback_sample, read pointer on each channel's playback_buf
|
||||
* and write pointer on each channel's capture_buf. Also wout whether the butler is needed.
|
||||
* @return true if the butler is required.
|
||||
|
|
@ -900,7 +925,7 @@ AudioDiskstream::internal_playback_seek (framecnt_t distance)
|
|||
boost::shared_ptr<ChannelList> c = channels.reader();
|
||||
|
||||
for (chan = c->begin(); chan != c->end(); ++chan) {
|
||||
(*chan)->playback_buf->increment_read_ptr (distance);
|
||||
(*chan)->playback_buf->increment_read_ptr (llabs(distance));
|
||||
}
|
||||
|
||||
if (first_recordable_frame < max_framepos) {
|
||||
|
|
|
|||
|
|
@ -313,6 +313,12 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram
|
|||
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
|
||||
|
||||
if (!lm.locked()) {
|
||||
boost::shared_ptr<AudioDiskstream> diskstream = audio_diskstream();
|
||||
framecnt_t playback_distance = diskstream->calculate_playback_distance(nframes);
|
||||
if (can_internal_playback_seek(llabs(playback_distance))) {
|
||||
/* TODO should declick */
|
||||
internal_playback_seek(playback_distance);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -353,7 +359,7 @@ AudioTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_fram
|
|||
_silent = false;
|
||||
_amp->apply_gain_automation(false);
|
||||
|
||||
BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers ());
|
||||
BufferSet& bufs = _session.get_route_buffers (n_process_buffers ());
|
||||
|
||||
fill_buffers_with_input (bufs, _input, nframes);
|
||||
|
||||
|
|
|
|||
|
|
@ -998,7 +998,7 @@ AUPlugin::output_streams() const
|
|||
}
|
||||
|
||||
bool
|
||||
AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
AUPlugin::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
// Note: We never attempt to multiply-instantiate plugins to meet io configurations.
|
||||
|
||||
|
|
@ -1824,7 +1824,6 @@ AUPlugin::do_save_preset (string preset_name)
|
|||
CFPropertyListRef propertyList;
|
||||
vector<Glib::ustring> v;
|
||||
Glib::ustring user_preset_path;
|
||||
bool ret = true;
|
||||
|
||||
std::string m = maker();
|
||||
std::string n = name();
|
||||
|
|
@ -1843,12 +1842,12 @@ AUPlugin::do_save_preset (string preset_name)
|
|||
|
||||
if (g_mkdir_with_parents (user_preset_path.c_str(), 0775) < 0) {
|
||||
error << string_compose (_("Cannot create user plugin presets folder (%1)"), user_preset_path) << endmsg;
|
||||
return false;
|
||||
return string();
|
||||
}
|
||||
|
||||
DEBUG_TRACE (DEBUG::AudioUnits, "get current preset\n");
|
||||
if (unit->GetAUPreset (propertyList) != noErr) {
|
||||
return false;
|
||||
return string();
|
||||
}
|
||||
|
||||
// add the actual preset name */
|
||||
|
|
@ -1863,7 +1862,7 @@ AUPlugin::do_save_preset (string preset_name)
|
|||
|
||||
if (save_property_list (propertyList, user_preset_path)) {
|
||||
error << string_compose (_("Saving plugin state to %1 failed"), user_preset_path) << endmsg;
|
||||
ret = false;
|
||||
return string();
|
||||
}
|
||||
|
||||
CFRelease(propertyList);
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ AudioSource::touch_peakfile ()
|
|||
struct utimbuf tbuf;
|
||||
|
||||
tbuf.actime = statbuf.st_atime;
|
||||
tbuf.modtime = time ((time_t) 0);
|
||||
tbuf.modtime = time ((time_t*) 0);
|
||||
|
||||
utime (peakpath.c_str(), &tbuf);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ CapturingProcessor::configure_io (ChanCount in, ChanCount out)
|
|||
}
|
||||
|
||||
bool
|
||||
CapturingProcessor::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
CapturingProcessor::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
out = in;
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ Delivery::display_name () const
|
|||
}
|
||||
|
||||
bool
|
||||
Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
Delivery::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
if (_role == Main) {
|
||||
|
||||
|
|
|
|||
|
|
@ -226,6 +226,7 @@ setup_enum_writer ()
|
|||
REGISTER_ENUM (MeteringVUfrench);
|
||||
REGISTER_ENUM (MeteringVUamerican);
|
||||
REGISTER_ENUM (MeteringVUstandard);
|
||||
REGISTER_ENUM (MeteringVUeight);
|
||||
REGISTER (_VUMeterStandard);
|
||||
|
||||
REGISTER_ENUM (MeteringLineUp24);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ InternalReturn::get_state()
|
|||
}
|
||||
|
||||
bool
|
||||
InternalReturn::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
InternalReturn::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
out = in;
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ InternalSend::connect_when_legal ()
|
|||
}
|
||||
|
||||
bool
|
||||
InternalSend::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
InternalSend::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
out = in;
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -49,45 +49,37 @@ void Kmeterdsp::process (float *p, int n)
|
|||
// p : pointer to sample buffer
|
||||
// n : number of samples to process
|
||||
|
||||
float s, t, z1, z2;
|
||||
float s, z1, z2;
|
||||
|
||||
// Get filter state.
|
||||
z1 = _z1;
|
||||
z2 = _z2;
|
||||
|
||||
// Process n samples. Find digital peak value for this
|
||||
// period and perform filtering. The second filter is
|
||||
// evaluated only every 4th sample - this is just an
|
||||
// optimisation.
|
||||
t = 0;
|
||||
// Perform filtering. The second filter is evaluated
|
||||
// only every 4th sample - this is just an optimisation.
|
||||
n /= 4; // Loop is unrolled by 4.
|
||||
while (n--)
|
||||
{
|
||||
s = *p++;
|
||||
s *= s;
|
||||
if (t < s) t = s; // Update digital peak.
|
||||
z1 += _omega * (s - z1); // Update first filter.
|
||||
s = *p++;
|
||||
s *= s;
|
||||
if (t < s) t = s; // Update digital peak.
|
||||
z1 += _omega * (s - z1); // Update first filter.
|
||||
s = *p++;
|
||||
s *= s;
|
||||
if (t < s) t = s; // Update digital peak.
|
||||
z1 += _omega * (s - z1); // Update first filter.
|
||||
s = *p++;
|
||||
s *= s;
|
||||
if (t < s) t = s; // Update digital peak.
|
||||
z1 += _omega * (s - z1); // Update first filter.
|
||||
z2 += 4 * _omega * (z1 - z2); // Update second filter.
|
||||
}
|
||||
t = sqrtf (t);
|
||||
|
||||
// Save filter state. The added constants avoid denormals.
|
||||
_z1 = z1 + 1e-20f;
|
||||
_z2 = z2 + 1e-20f;
|
||||
|
||||
s = sqrtf (2 * z2);
|
||||
s = sqrtf (2.0f * z2);
|
||||
|
||||
if (_flag) // Display thread has read the rms value.
|
||||
{
|
||||
|
|
|
|||
|
|
@ -562,7 +562,7 @@ LadspaPlugin::connect_and_run (BufferSet& bufs,
|
|||
cycles_t then = get_cycles ();
|
||||
|
||||
BufferSet& silent_bufs = _session.get_silent_buffers(ChanCount(DataType::AUDIO, 1));
|
||||
BufferSet& scratch_bufs = _session.get_silent_buffers(ChanCount(DataType::AUDIO, 1));
|
||||
BufferSet& scratch_bufs = _session.get_scratch_buffers(ChanCount(DataType::AUDIO, 1));
|
||||
|
||||
uint32_t audio_in_index = 0;
|
||||
uint32_t audio_out_index = 0;
|
||||
|
|
|
|||
|
|
@ -970,7 +970,7 @@ LV2Plugin::find_presets()
|
|||
lilv_node_as_string(name))));
|
||||
} else {
|
||||
warning << string_compose(
|
||||
_("Plugin \"%1\% preset \"%2%\" is missing a label\n"),
|
||||
_("Plugin \"%1\" preset \"%2\" is missing a label\n"),
|
||||
lilv_node_as_string(lilv_plugin_get_uri(_impl->plugin)),
|
||||
lilv_node_as_string(preset)) << endmsg;
|
||||
}
|
||||
|
|
@ -1651,7 +1651,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
|
|||
}
|
||||
} else if (!valid) {
|
||||
// Nothing we understand or care about, connect to scratch
|
||||
_ev_buffers[port_index] = silent_bufs.get_lv2_midi(
|
||||
_ev_buffers[port_index] = scratch_bufs.get_lv2_midi(
|
||||
(flags & PORT_INPUT), 0, (flags & PORT_EVENT));
|
||||
}
|
||||
buf = lv2_evbuf_get_buffer(_ev_buffers[port_index]);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ PeakMeter::PeakMeter (Session& s, const std::string& name)
|
|||
Iec1ppmdsp::init(s.nominal_frame_rate());
|
||||
Iec2ppmdsp::init(s.nominal_frame_rate());
|
||||
Vumeterdsp::init(s.nominal_frame_rate());
|
||||
_pending_active = true;
|
||||
_meter_type = MeterPeak;
|
||||
}
|
||||
|
||||
PeakMeter::~PeakMeter ()
|
||||
|
|
@ -163,7 +165,7 @@ PeakMeter::reset_max ()
|
|||
}
|
||||
|
||||
bool
|
||||
PeakMeter::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
PeakMeter::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
out = in;
|
||||
return true;
|
||||
|
|
@ -186,20 +188,20 @@ PeakMeter::configure_io (ChanCount in, ChanCount out)
|
|||
void
|
||||
PeakMeter::reflect_inputs (const ChanCount& in)
|
||||
{
|
||||
current_meters = in;
|
||||
|
||||
const size_t limit = min (_peak_signal.size(), (size_t) current_meters.n_total ());
|
||||
const size_t n_midi = min (_peak_signal.size(), (size_t) current_meters.n_midi());
|
||||
|
||||
for (size_t n = 0; n < limit; ++n) {
|
||||
if (n < n_midi) {
|
||||
_visible_peak_power[n] = 0;
|
||||
} else {
|
||||
_visible_peak_power[n] = -INFINITY;
|
||||
for (uint32_t i = in.n_total(); i < current_meters.n_total(); ++i) {
|
||||
if (i < _peak_signal.size()) {
|
||||
_peak_signal[i] = 0.0f;
|
||||
}
|
||||
}
|
||||
for (uint32_t i = in.n_audio(); i < current_meters.n_audio(); ++i) {
|
||||
if (i >= _kmeter.size()) continue;
|
||||
_kmeter[i]->reset();
|
||||
_iec1meter[i]->reset();
|
||||
_iec2meter[i]->reset();
|
||||
_vumeter[i]->reset();
|
||||
}
|
||||
|
||||
reset();
|
||||
current_meters = in;
|
||||
reset_max();
|
||||
|
||||
ConfigurationChanged (in, in); /* EMIT SIGNAL */
|
||||
|
|
@ -268,7 +270,17 @@ PeakMeter::meter ()
|
|||
return;
|
||||
}
|
||||
|
||||
assert(_visible_peak_power.size() == _peak_signal.size());
|
||||
// TODO block this thread while PeakMeter::reset_max_channels() is
|
||||
// reallocating channels.
|
||||
// (may happen with Session > New: old session not yet closed,
|
||||
// meter-thread still active while new one is initializing and
|
||||
// maybe on other occasions, too)
|
||||
if ( (_visible_peak_power.size() != _peak_signal.size())
|
||||
|| (_max_peak_power.size() != _peak_signal.size())
|
||||
|| (_max_peak_signal.size() != _peak_signal.size())
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const size_t limit = min (_peak_signal.size(), (size_t) current_meters.n_total ());
|
||||
const size_t n_midi = min (_peak_signal.size(), (size_t) current_meters.n_midi());
|
||||
|
|
@ -325,6 +337,8 @@ PeakMeter::meter ()
|
|||
}
|
||||
}
|
||||
|
||||
#define CHECKSIZE(MTR) (n < MTR.size() + n_midi && n >= n_midi)
|
||||
|
||||
float
|
||||
PeakMeter::meter_level(uint32_t n, MeterType type) {
|
||||
switch (type) {
|
||||
|
|
@ -333,7 +347,7 @@ PeakMeter::meter_level(uint32_t n, MeterType type) {
|
|||
case MeterK14:
|
||||
{
|
||||
const uint32_t n_midi = current_meters.n_midi();
|
||||
if ((n - n_midi) < _kmeter.size() && (n - n_midi) >= 0) {
|
||||
if (CHECKSIZE(_kmeter)) {
|
||||
return accurate_coefficient_to_dB (_kmeter[n - n_midi]->read());
|
||||
}
|
||||
}
|
||||
|
|
@ -342,7 +356,7 @@ PeakMeter::meter_level(uint32_t n, MeterType type) {
|
|||
case MeterIEC1NOR:
|
||||
{
|
||||
const uint32_t n_midi = current_meters.n_midi();
|
||||
if ((n - n_midi) < _iec1meter.size() && (n - n_midi) >= 0) {
|
||||
if (CHECKSIZE(_iec1meter)) {
|
||||
return accurate_coefficient_to_dB (_iec1meter[n - n_midi]->read());
|
||||
}
|
||||
}
|
||||
|
|
@ -351,7 +365,7 @@ PeakMeter::meter_level(uint32_t n, MeterType type) {
|
|||
case MeterIEC2EBU:
|
||||
{
|
||||
const uint32_t n_midi = current_meters.n_midi();
|
||||
if ((n - n_midi) < _iec2meter.size() && (n - n_midi) >= 0) {
|
||||
if (CHECKSIZE(_iec2meter)) {
|
||||
return accurate_coefficient_to_dB (_iec2meter[n - n_midi]->read());
|
||||
}
|
||||
}
|
||||
|
|
@ -359,7 +373,7 @@ PeakMeter::meter_level(uint32_t n, MeterType type) {
|
|||
case MeterVU:
|
||||
{
|
||||
const uint32_t n_midi = current_meters.n_midi();
|
||||
if ((n - n_midi) < _vumeter.size() && (n - n_midi) >= 0) {
|
||||
if (CHECKSIZE(_vumeter)) {
|
||||
return accurate_coefficient_to_dB (_vumeter[n - n_midi]->read());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -517,6 +517,20 @@ MidiDiskstream::process (BufferSet& bufs, framepos_t transport_frame, pframes_t
|
|||
return 0;
|
||||
}
|
||||
|
||||
frameoffset_t
|
||||
MidiDiskstream::calculate_playback_distance (pframes_t nframes)
|
||||
{
|
||||
frameoffset_t playback_distance = nframes;
|
||||
|
||||
/* XXX: should be doing varispeed stuff once it's implemented in ::process() above */
|
||||
|
||||
if (_actual_speed < 0.0) {
|
||||
return -playback_distance;
|
||||
} else {
|
||||
return playback_distance;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
MidiDiskstream::commit (framecnt_t playback_distance)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -319,6 +319,12 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
|
|||
{
|
||||
Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
|
||||
if (!lm.locked()) {
|
||||
boost::shared_ptr<MidiDiskstream> diskstream = midi_diskstream();
|
||||
framecnt_t playback_distance = diskstream->calculate_playback_distance(nframes);
|
||||
if (can_internal_playback_seek(llabs(playback_distance))) {
|
||||
/* TODO should declick, and/or note-off */
|
||||
internal_playback_seek(playback_distance);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -353,7 +359,7 @@ MidiTrack::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame
|
|||
return dret;
|
||||
}
|
||||
|
||||
BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
|
||||
BufferSet& bufs = _session.get_route_buffers (n_process_buffers());
|
||||
|
||||
fill_buffers_with_input (bufs, _input, nframes);
|
||||
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ MonitorProcessor::configure_io (ChanCount in, ChanCount out)
|
|||
}
|
||||
|
||||
bool
|
||||
MonitorProcessor::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
MonitorProcessor::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
out = in;
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ Playlist::Playlist (boost::shared_ptr<const Playlist> other, framepos_t start, f
|
|||
plist.add (Properties::layer, region->layer());
|
||||
plist.add (Properties::layering_index, region->layering_index());
|
||||
|
||||
new_region = RegionFactory::RegionFactory::create (region, plist);
|
||||
new_region = RegionFactory::create (region, plist);
|
||||
|
||||
add_region_internal (new_region, position);
|
||||
}
|
||||
|
|
@ -284,7 +284,7 @@ Playlist::copy_regions (RegionList& newlist) const
|
|||
RegionReadLock rlock (const_cast<Playlist *> (this));
|
||||
|
||||
for (RegionList::const_iterator i = regions.begin(); i != regions.end(); ++i) {
|
||||
newlist.push_back (RegionFactory::RegionFactory::create (*i, true));
|
||||
newlist.push_back (RegionFactory::create (*i, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ PluginInsert::output_streams() const
|
|||
ChanCount out = info->n_outputs;
|
||||
// DEBUG_TRACE (DEBUG::Processors, string_compose ("Plugin insert, static output streams = %1 for %2 plugins\n", out, _plugins.size()));
|
||||
out.set_audio (out.n_audio() * _plugins.size());
|
||||
out.set_midi (out.n_midi() * _plugins.size());
|
||||
out.set_midi (out.n_midi() * _plugins.size() + midi_bypass.n_midi());
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
|
@ -448,7 +448,7 @@ PluginInsert::silence (framecnt_t nframes)
|
|||
}
|
||||
|
||||
for (Plugins::iterator i = _plugins.begin(); i != _plugins.end(); ++i) {
|
||||
(*i)->connect_and_run (_session.get_silent_buffers ((*i)->get_info()->n_inputs), in_map, out_map, nframes, 0);
|
||||
(*i)->connect_and_run (_session.get_scratch_buffers ((*i)->get_info()->n_inputs, true), in_map, out_map, nframes, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -465,7 +465,6 @@ PluginInsert::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*end
|
|||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (has_no_audio_inputs()) {
|
||||
|
||||
/* silence all (audio) outputs. Should really declick
|
||||
|
|
@ -704,7 +703,7 @@ PluginInsert::configure_io (ChanCount in, ChanCount out)
|
|||
* @return true if the given IO configuration can be supported.
|
||||
*/
|
||||
bool
|
||||
PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
return private_can_support_io_configuration (in, out).method != Impossible;
|
||||
}
|
||||
|
|
@ -714,9 +713,11 @@ PluginInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
|||
* it can be.
|
||||
*/
|
||||
PluginInsert::Match
|
||||
PluginInsert::private_can_support_io_configuration (ChanCount const & in, ChanCount& out) const
|
||||
PluginInsert::private_can_support_io_configuration (ChanCount const & inx, ChanCount& out)
|
||||
{
|
||||
PluginInfoPtr info = _plugins.front()->get_info();
|
||||
ChanCount in; in += inx;
|
||||
midi_bypass.reset();
|
||||
|
||||
if (info->reconfigurable_io()) {
|
||||
/* Plugin has flexible I/O, so delegate to it */
|
||||
|
|
@ -731,6 +732,15 @@ PluginInsert::private_can_support_io_configuration (ChanCount const & in, ChanCo
|
|||
ChanCount inputs = info->n_inputs;
|
||||
ChanCount outputs = info->n_outputs;
|
||||
|
||||
if (in.get(DataType::MIDI) == 1 && outputs.get(DataType::MIDI) == 0) {
|
||||
DEBUG_TRACE ( DEBUG::Processors, string_compose ("bypassing midi-data around %1\n", name()));
|
||||
midi_bypass.set(DataType::MIDI, 1);
|
||||
}
|
||||
if (in.get(DataType::MIDI) == 1 && inputs.get(DataType::MIDI) == 0) {
|
||||
DEBUG_TRACE ( DEBUG::Processors, string_compose ("hiding midi-port from plugin %1\n", name()));
|
||||
in.set(DataType::MIDI, 0);
|
||||
}
|
||||
|
||||
bool no_inputs = true;
|
||||
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
|
||||
if (inputs.get (*t) != 0) {
|
||||
|
|
@ -741,13 +751,13 @@ PluginInsert::private_can_support_io_configuration (ChanCount const & in, ChanCo
|
|||
|
||||
if (no_inputs) {
|
||||
/* no inputs so we can take any input configuration since we throw it away */
|
||||
out = outputs;
|
||||
out = outputs + midi_bypass;
|
||||
return Match (NoInputs, 1);
|
||||
}
|
||||
|
||||
/* Plugin inputs match requested inputs exactly */
|
||||
if (inputs == in) {
|
||||
out = outputs;
|
||||
out = outputs + midi_bypass;
|
||||
return Match (ExactMatch, 1);
|
||||
}
|
||||
|
||||
|
|
@ -789,6 +799,7 @@ PluginInsert::private_can_support_io_configuration (ChanCount const & in, ChanCo
|
|||
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
|
||||
out.set (*t, outputs.get(*t) * f);
|
||||
}
|
||||
out += midi_bypass;
|
||||
return Match (Replicate, f);
|
||||
}
|
||||
|
||||
|
|
@ -812,7 +823,7 @@ PluginInsert::private_can_support_io_configuration (ChanCount const & in, ChanCo
|
|||
}
|
||||
|
||||
if (can_split) {
|
||||
out = outputs;
|
||||
out = outputs + midi_bypass;
|
||||
return Match (Split, 1);
|
||||
}
|
||||
|
||||
|
|
@ -836,10 +847,11 @@ PluginInsert::private_can_support_io_configuration (ChanCount const & in, ChanCo
|
|||
}
|
||||
|
||||
if (could_hide && !cannot_hide) {
|
||||
out = outputs;
|
||||
out = outputs + midi_bypass;
|
||||
return Match (Hide, 1, hide_channels);
|
||||
}
|
||||
|
||||
midi_bypass.reset();
|
||||
return Match (Impossible, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-06-11 08:49-0400\n"
|
||||
"PO-Revision-Date: 2013-02-05 19:52+0100\n"
|
||||
"POT-Creation-Date: 2013-07-17 11:09+0200\n"
|
||||
"PO-Revision-Date: 2013-07-23 15:04+0200\n"
|
||||
"Last-Translator: Edgar Aichinger <edogawa@aon.at>\n"
|
||||
"Language-Team: German <ardour-dev@lists.ardour.org>\n"
|
||||
"Language: de\n"
|
||||
|
|
@ -218,7 +218,7 @@ msgstr ""
|
|||
msgid "Connect session to engine"
|
||||
msgstr "Verbinde Projekt mit Engine"
|
||||
|
||||
#: audioengine.cc:844
|
||||
#: audioengine.cc:843
|
||||
msgid ""
|
||||
"a port with the name \"%1\" already exists: check for duplicated track/bus "
|
||||
"names"
|
||||
|
|
@ -226,7 +226,7 @@ msgstr ""
|
|||
"Ein Port mit Namen \"%1\" existiert bereits: Prüfen Sie auf doppelte Spur/"
|
||||
"Busnamen"
|
||||
|
||||
#: audioengine.cc:846 session.cc:1698
|
||||
#: audioengine.cc:845 session.cc:1698
|
||||
msgid ""
|
||||
"No more JACK ports are available. You will need to stop %1 and restart JACK "
|
||||
"with more ports if you need this many tracks."
|
||||
|
|
@ -234,35 +234,35 @@ msgstr ""
|
|||
"Keine JACK-Ports mehr verfügbar. Wenn Sie so viele Spuren benötigen, müssen "
|
||||
"Sie %1 stoppen und JACK mit mehr Ports neu starten."
|
||||
|
||||
#: audioengine.cc:849
|
||||
#: audioengine.cc:848
|
||||
msgid "AudioEngine: cannot register port \"%1\": %2"
|
||||
msgstr "AudioEngine: kann Port \"%1\": %2 nicht registrieren"
|
||||
|
||||
#: audioengine.cc:879
|
||||
#: audioengine.cc:878
|
||||
msgid "unable to create port: %1"
|
||||
msgstr "kann Port: %1 nicht erzeugen"
|
||||
|
||||
#: audioengine.cc:933
|
||||
#: audioengine.cc:932
|
||||
msgid "connect called before engine was started"
|
||||
msgstr "Aufruf von connect vor dem Start der Engine"
|
||||
|
||||
#: audioengine.cc:959
|
||||
#: audioengine.cc:958
|
||||
msgid "AudioEngine: cannot connect %1 (%2) to %3 (%4)"
|
||||
msgstr "AudioEngine: kann %1 (%2) nicht mit %3 (%4) verbinden"
|
||||
|
||||
#: audioengine.cc:974 audioengine.cc:1005
|
||||
#: audioengine.cc:973 audioengine.cc:1004
|
||||
msgid "disconnect called before engine was started"
|
||||
msgstr "Aufruf von disconnect vor dem Start der Engine"
|
||||
|
||||
#: audioengine.cc:1053
|
||||
#: audioengine.cc:1052
|
||||
msgid "get_port_by_name() called before engine was started"
|
||||
msgstr "Aufruf von get_port_by_name() vor dem Start der Engine"
|
||||
|
||||
#: audioengine.cc:1105
|
||||
#: audioengine.cc:1104
|
||||
msgid "get_ports called before engine was started"
|
||||
msgstr "Aufruf von get_ports vor dem Start der Engine"
|
||||
|
||||
#: audioengine.cc:1428
|
||||
#: audioengine.cc:1427
|
||||
msgid "failed to connect to JACK"
|
||||
msgstr "Verbindung zu JACK fehlgeschlagen"
|
||||
|
||||
|
|
@ -316,8 +316,8 @@ msgstr "AudioSource: kann Pfad für Peaks (b) \"%1\" nicht öffnen (%2)"
|
|||
msgid ""
|
||||
"AudioSource[%1]: peak read - cannot read %2 samples at offset %3 of %4 (%5)"
|
||||
msgstr ""
|
||||
"AudioSource[%1]: peak read - kann %2 Samples bei Offset %3 von %4 nicht lesen"
|
||||
"(%5)"
|
||||
"AudioSource[%1]: peak read - kann %2 Samples bei Offset %3 von %4 nicht "
|
||||
"lesen(%5)"
|
||||
|
||||
#: audiosource.cc:667
|
||||
msgid "%1: could not write read raw data for peak computation (%2)"
|
||||
|
|
@ -971,21 +971,21 @@ msgstr "R"
|
|||
msgid "%d"
|
||||
msgstr "%d"
|
||||
|
||||
#: ladspa_plugin.cc:87
|
||||
#: ladspa_plugin.cc:88
|
||||
msgid "LADSPA: module has no descriptor function."
|
||||
msgstr "LADSPA: Modul hat keine Beschreibungsfunktion"
|
||||
|
||||
#: ladspa_plugin.cc:92
|
||||
#: ladspa_plugin.cc:93
|
||||
msgid "LADSPA: plugin has gone away since discovery!"
|
||||
msgstr "LADSPA: Plugin ist nicht mehr auffindbar!"
|
||||
|
||||
#: ladspa_plugin.cc:99
|
||||
#: ladspa_plugin.cc:100
|
||||
msgid "LADSPA: \"%1\" cannot be used, since it cannot do inplace processing"
|
||||
msgstr ""
|
||||
"LADSPA: \"%1\" kann nicht verwendet werdeen, da es kein \"inplace processing"
|
||||
"\" beherrscht"
|
||||
|
||||
#: ladspa_plugin.cc:296
|
||||
#: ladspa_plugin.cc:297
|
||||
msgid ""
|
||||
"illegal parameter number used with plugin \"%1\". This may indicate a change "
|
||||
"in the plugin design, and presets may be invalid"
|
||||
|
|
@ -993,35 +993,35 @@ msgstr ""
|
|||
"Falsche Parameterzahl für Plugin \"%1\". Das auf eine Änderung im Plugin-"
|
||||
"Design hindeuten, und Presets sind eventuell ungültig"
|
||||
|
||||
#: ladspa_plugin.cc:373 ladspa_plugin.cc:418
|
||||
#: ladspa_plugin.cc:376 ladspa_plugin.cc:426
|
||||
msgid "Bad node sent to LadspaPlugin::set_state"
|
||||
msgstr "Schlechter Knoten an LadspaPlugin::set_state gesendet"
|
||||
|
||||
#: ladspa_plugin.cc:386 ladspa_plugin.cc:431
|
||||
#: ladspa_plugin.cc:391 ladspa_plugin.cc:440
|
||||
msgid "LADSPA: no ladspa port number"
|
||||
msgstr "LADSPA: keine LADSPA-Portnummer"
|
||||
|
||||
#: ladspa_plugin.cc:392 ladspa_plugin.cc:437
|
||||
#: ladspa_plugin.cc:397 ladspa_plugin.cc:446
|
||||
msgid "LADSPA: no ladspa port data"
|
||||
msgstr "LADSPA: keine LADSPA-Portdaten"
|
||||
|
||||
#: ladspa_plugin.cc:707
|
||||
#: ladspa_plugin.cc:717
|
||||
msgid "LADSPA: cannot load module from \"%1\""
|
||||
msgstr "LADSPA: kann Modul nicht aus \"%1\" laden"
|
||||
|
||||
#: ladspa_plugin.cc:817
|
||||
#: ladspa_plugin.cc:827
|
||||
msgid "Could not locate HOME. Preset not removed."
|
||||
msgstr "Konnte HOME nicht eruieren. Preset nicht entfernt."
|
||||
|
||||
#: ladspa_plugin.cc:854 ladspa_plugin.cc:860
|
||||
#: ladspa_plugin.cc:864 ladspa_plugin.cc:870
|
||||
msgid "Could not create %1. Preset not saved. (%2)"
|
||||
msgstr "Konnte %1 nicht erzeugen. Preset nicht gesichert. (%2)"
|
||||
|
||||
#: ladspa_plugin.cc:867
|
||||
#: ladspa_plugin.cc:877
|
||||
msgid "Error saving presets file %1."
|
||||
msgstr "Fehler beim Sichern der Preset-Datei %1."
|
||||
|
||||
#: ladspa_plugin.cc:905
|
||||
#: ladspa_plugin.cc:915
|
||||
msgid "Could not locate HOME. Preset not saved."
|
||||
msgstr "Konnte HOME nicht eruieren. Preset nicht gesichert."
|
||||
|
||||
|
|
@ -1368,23 +1368,39 @@ msgstr ""
|
|||
"Konnte die Wiedergabeliste nicht aus den Quelldaten des Projekts "
|
||||
"konstruieren!"
|
||||
|
||||
#: plugin.cc:324
|
||||
msgid ""
|
||||
"Plugin presets are not supported in this build of %1. Consider paying for a "
|
||||
"full version"
|
||||
msgstr ""
|
||||
"Pluginpresets werden in diesem %1-Binärpaket nicht unterstützt. Erwägen Sie, "
|
||||
"für die Vollversion zu bezahlen"
|
||||
|
||||
#: plugin.cc:398
|
||||
msgid ""
|
||||
"Saving plugin settings is not supported in this build of %1. Consider paying "
|
||||
"for the full version"
|
||||
msgstr ""
|
||||
"Das Speichern von Pluginpresets werden in diesem %1-Binärpaket nicht "
|
||||
"unterstützt. Erwägen Sie, für die Vollversion zu bezahlen"
|
||||
|
||||
#: plugin_insert.cc:599
|
||||
msgid "programming error: "
|
||||
msgstr "Programmierfehler:"
|
||||
|
||||
#: plugin_insert.cc:908
|
||||
#: plugin_insert.cc:914
|
||||
msgid "XML node describing plugin is missing the `type' field"
|
||||
msgstr "Dem XML-Knoten zur Beschreibung des Plugins fehlt das \"type\"-Feld"
|
||||
|
||||
#: plugin_insert.cc:923
|
||||
#: plugin_insert.cc:929
|
||||
msgid "unknown plugin type %1 in plugin insert state"
|
||||
msgstr "Unbekannter Plugintyp %1 im Einfüge-Status des Plugins"
|
||||
|
||||
#: plugin_insert.cc:951
|
||||
#: plugin_insert.cc:957
|
||||
msgid "Plugin has no unique ID field"
|
||||
msgstr "Das Plugin hat kein Feld für die eindeutige ID"
|
||||
|
||||
#: plugin_insert.cc:960
|
||||
#: plugin_insert.cc:966
|
||||
msgid ""
|
||||
"Found a reference to a plugin (\"%1\") that is unknown.\n"
|
||||
"Perhaps it was removed or moved since it was last used."
|
||||
|
|
@ -1392,15 +1408,15 @@ msgstr ""
|
|||
"Referenz auf ein unbekanntes Plugin (\"%1\") gefunden.\n"
|
||||
"Vielleicht wurde es seit der letzten Verwendung entfernt oder verschoben."
|
||||
|
||||
#: plugin_insert.cc:1076
|
||||
#: plugin_insert.cc:1082
|
||||
msgid "PluginInsert: Auto: no ladspa port number"
|
||||
msgstr "PluginInsert: Auto: keine LADSPA Portnummer"
|
||||
|
||||
#: plugin_insert.cc:1083
|
||||
#: plugin_insert.cc:1089
|
||||
msgid "PluginInsert: Auto: port id out of range"
|
||||
msgstr "PluginInsert: Auto: Port-ID Bereichsüberschreitung"
|
||||
|
||||
#: plugin_insert.cc:1119
|
||||
#: plugin_insert.cc:1125
|
||||
msgid "PluginInsert: automatable control %1 not found - ignored"
|
||||
msgstr ""
|
||||
"PluginInsert: automatisierbares Kontrollelement %1 nicht gefunden - ignoriert"
|
||||
|
|
@ -1550,23 +1566,23 @@ msgstr "Import: Fehler in src_new() : %1"
|
|||
msgid "return %1"
|
||||
msgstr "Rückgabewert: %1"
|
||||
|
||||
#: route.cc:1100 route.cc:2550
|
||||
#: route.cc:1101 route.cc:2557
|
||||
msgid "unknown Processor type \"%1\"; ignored"
|
||||
msgstr "unbekannter Prozessortyp \"%1\"; ignoriert"
|
||||
|
||||
#: route.cc:1112
|
||||
#: route.cc:1113
|
||||
msgid "processor could not be created. Ignored."
|
||||
msgstr "Prozessor konnte nicht erzeugt werden. Ignoriert."
|
||||
|
||||
#: route.cc:1983 route.cc:2203
|
||||
#: route.cc:1986 route.cc:2210
|
||||
msgid "Bad node sent to Route::set_state() [%1]"
|
||||
msgstr "Schlechter Knoten an Route::set_state() gesendet [%1]"
|
||||
|
||||
#: route.cc:2042
|
||||
#: route.cc:2045
|
||||
msgid "Pannable state found for route (%1) without a panner!"
|
||||
msgstr "Pannerziel-Status für Route (%1) ohne Panner gefunden!"
|
||||
|
||||
#: route.cc:2106 route.cc:2110 route.cc:2317 route.cc:2321
|
||||
#: route.cc:2113 route.cc:2117 route.cc:2324 route.cc:2328
|
||||
msgid "badly formed order key string in state file! [%1] ... ignored."
|
||||
msgstr ""
|
||||
"schlecht geformte Zeichenkette für den Schlüssel der Sortierreihenfolge in "
|
||||
|
|
@ -1857,18 +1873,17 @@ msgstr "Session: kann quarter-frame MTC-Nachricht nicht senden (%1)"
|
|||
msgid "Session: cannot create Playlist from XML description."
|
||||
msgstr "Session: kann Wiedergabeliste nicht aus der XML-Beschreibung erzeugen"
|
||||
|
||||
#: session_process.cc:135
|
||||
#: session_process.cc:133
|
||||
msgid "Session: error in no roll for %1"
|
||||
msgstr "Session: Fehler in no_roll für %1"
|
||||
|
||||
#: session_process.cc:1160
|
||||
#: session_process.cc:1158
|
||||
msgid "Programming error: illegal event type in process_event (%1)"
|
||||
msgstr "Programmierfehler: illegaler Ereignistyp in process_event (%1)"
|
||||
|
||||
#: session_state.cc:139
|
||||
#, fuzzy
|
||||
msgid "Could not use path %1 (%2)"
|
||||
msgstr "Konnte Pfad %1 nicht benutzen (%s)"
|
||||
msgstr "Konnte Pfad %1 nicht benutzen (%2)"
|
||||
|
||||
#: session_state.cc:267
|
||||
msgid "solo cut control (dB)"
|
||||
|
|
@ -2406,7 +2421,7 @@ msgstr ""
|
|||
msgid "attempt to write a non-writable audio file source (%1)"
|
||||
msgstr "Versuch, in eine schreibgeschützte Audio-Dateiquelle zu schreiben (%1)"
|
||||
|
||||
#: sndfilesource.cc:396 utils.cc:497 utils.cc:521 utils.cc:535 utils.cc:554
|
||||
#: sndfilesource.cc:396 utils.cc:507 utils.cc:531 utils.cc:545 utils.cc:564
|
||||
msgid "programming error: %1 %2"
|
||||
msgstr "Programmierfehler: %1 %2"
|
||||
|
||||
|
|
@ -2672,11 +2687,11 @@ msgstr "M-Clock"
|
|||
msgid "LTC"
|
||||
msgstr "LTC"
|
||||
|
||||
#: utils.cc:589
|
||||
#: utils.cc:599
|
||||
msgid "programming error: unknown native header format: %1"
|
||||
msgstr "Programmierfehler: unbekanntes natives Dateikopfformat: %1"
|
||||
|
||||
#: utils.cc:604
|
||||
#: utils.cc:614
|
||||
msgid "cannot open directory %1 (%2)"
|
||||
msgstr "kann Verzeichnis %1 nicht öffnen (%2)"
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ PortInsert::configure_io (ChanCount in, ChanCount out)
|
|||
}
|
||||
|
||||
bool
|
||||
PortInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
PortInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
out = in;
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ ProcessThread::get_silent_buffers (ChanCount count)
|
|||
}
|
||||
|
||||
BufferSet&
|
||||
ProcessThread::get_scratch_buffers (ChanCount count)
|
||||
ProcessThread::get_scratch_buffers (ChanCount count, bool silence)
|
||||
{
|
||||
ThreadBuffers* tb = _private_thread_buffers.get();
|
||||
assert (tb);
|
||||
|
|
@ -105,6 +105,41 @@ ProcessThread::get_scratch_buffers (ChanCount count)
|
|||
sb->set_count (sb->available());
|
||||
}
|
||||
|
||||
if (silence) {
|
||||
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
|
||||
for (uint32_t i = 0; i < sb->count().get(*t); ++i) {
|
||||
sb->get(*t, i).clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return *sb;
|
||||
}
|
||||
|
||||
BufferSet&
|
||||
ProcessThread::get_route_buffers (ChanCount count, bool silence)
|
||||
{
|
||||
ThreadBuffers* tb = _private_thread_buffers.get();
|
||||
assert (tb);
|
||||
|
||||
BufferSet* sb = tb->route_buffers;
|
||||
assert (sb);
|
||||
|
||||
if (count != ChanCount::ZERO) {
|
||||
assert(sb->available() >= count);
|
||||
sb->set_count (count);
|
||||
} else {
|
||||
sb->set_count (sb->available());
|
||||
}
|
||||
|
||||
if (silence) {
|
||||
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
|
||||
for (uint32_t i = 0; i < sb->count().get(*t); ++i) {
|
||||
sb->get(*t, i).clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return *sb;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ Return::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pfra
|
|||
}
|
||||
|
||||
bool
|
||||
Return::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
Return::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
out = in + _input->n_ports();
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -98,9 +98,13 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type)
|
|||
, _default_type (default_type)
|
||||
, _remote_control_id (0)
|
||||
, _in_configure_processors (false)
|
||||
, _initial_io_setup (false)
|
||||
, _custom_meter_position_noted (false)
|
||||
, _last_custom_meter_was_at_end (false)
|
||||
{
|
||||
if (is_master()) {
|
||||
_meter_type = MeterK20;
|
||||
}
|
||||
processor_max_streams.reset();
|
||||
}
|
||||
|
||||
|
|
@ -133,6 +137,7 @@ Route::init ()
|
|||
_input->PortCountChanging.connect_same_thread (*this, boost::bind (&Route::input_port_count_changing, this, _1));
|
||||
|
||||
_output->changed.connect_same_thread (*this, boost::bind (&Route::output_change_handler, this, _1, _2));
|
||||
_output->PortCountChanging.connect_same_thread (*this, boost::bind (&Route::output_port_count_changing, this, _1));
|
||||
|
||||
/* add amp processor */
|
||||
|
||||
|
|
@ -540,11 +545,10 @@ Route::process_output_buffers (BufferSet& bufs,
|
|||
if (bufs.count() != (*i)->input_streams()) {
|
||||
DEBUG_TRACE (
|
||||
DEBUG::Processors, string_compose (
|
||||
"%1 bufs = %2 input for %3 = %4\n",
|
||||
"input port mismatch %1 bufs = %2 input for %3 = %4\n",
|
||||
_name, bufs.count(), (*i)->name(), (*i)->input_streams()
|
||||
)
|
||||
);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -568,7 +572,7 @@ void
|
|||
Route::monitor_run (framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick)
|
||||
{
|
||||
assert (is_monitor());
|
||||
BufferSet& bufs (_session.get_scratch_buffers (n_process_buffers()));
|
||||
BufferSet& bufs (_session.get_route_buffers (n_process_buffers()));
|
||||
passthru (bufs, start_frame, end_frame, nframes, declick);
|
||||
}
|
||||
|
||||
|
|
@ -594,7 +598,7 @@ Route::passthru (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame,
|
|||
void
|
||||
Route::passthru_silence (framepos_t start_frame, framepos_t end_frame, pframes_t nframes, int declick)
|
||||
{
|
||||
BufferSet& bufs (_session.get_silent_buffers (n_process_buffers()));
|
||||
BufferSet& bufs (_session.get_route_buffers (n_process_buffers(), true));
|
||||
|
||||
bufs.set_count (_input->n_ports());
|
||||
write_out_of_band_data (bufs, start_frame, end_frame, nframes);
|
||||
|
|
@ -1651,7 +1655,8 @@ Route::try_configure_processors_unlocked (ChanCount in, ProcessorStreams* err)
|
|||
|
||||
if (boost::dynamic_pointer_cast<UnknownProcessor> (*p)) {
|
||||
DEBUG_TRACE (DEBUG::Processors, "--- CONFIGURE ABORTED due to unknown processor.\n");
|
||||
break;
|
||||
DEBUG_TRACE (DEBUG::Processors, "}\n");
|
||||
return list<pair<ChanCount, ChanCount> > ();
|
||||
}
|
||||
|
||||
if ((*p)->can_support_io_configuration(in, out)) {
|
||||
|
|
@ -1701,6 +1706,9 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
|
|||
}
|
||||
|
||||
ChanCount out;
|
||||
bool seen_mains_out = false;
|
||||
processor_out_streams = _input->n_ports();
|
||||
processor_max_streams.reset();
|
||||
|
||||
list< pair<ChanCount,ChanCount> >::iterator c = configuration.begin();
|
||||
for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++c) {
|
||||
|
|
@ -1713,8 +1721,21 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
|
|||
processor_max_streams = ChanCount::max(processor_max_streams, c->first);
|
||||
processor_max_streams = ChanCount::max(processor_max_streams, c->second);
|
||||
out = c->second;
|
||||
|
||||
if (boost::dynamic_pointer_cast<Delivery> (*p)
|
||||
&& boost::dynamic_pointer_cast<Delivery> (*p)->role() == Delivery::Main) {
|
||||
/* main delivery will increase port count to match input.
|
||||
* the Delivery::Main is usually the last processor - followed only by
|
||||
* 'MeterOutput'.
|
||||
*/
|
||||
seen_mains_out = true;
|
||||
}
|
||||
if (!seen_mains_out) {
|
||||
processor_out_streams = out;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (_meter) {
|
||||
_meter->reset_max_channels (processor_max_streams);
|
||||
}
|
||||
|
|
@ -1992,6 +2013,7 @@ Route::set_state (const XMLNode& node, int version)
|
|||
}
|
||||
|
||||
set_id (node);
|
||||
_initial_io_setup = true;
|
||||
|
||||
if ((prop = node.property (X_("flags"))) != 0) {
|
||||
_flags = Flag (string_2_enum (prop->value(), _flags));
|
||||
|
|
@ -2059,6 +2081,8 @@ Route::set_state (const XMLNode& node, int version)
|
|||
_meter_type = MeterType (string_2_enum (prop->value (), _meter_type));
|
||||
}
|
||||
|
||||
_initial_io_setup = false;
|
||||
|
||||
set_processor_state (processor_state);
|
||||
|
||||
// this looks up the internal instrument in processors
|
||||
|
|
@ -2939,6 +2963,9 @@ void
|
|||
Route::output_change_handler (IOChange change, void * /*src*/)
|
||||
{
|
||||
bool need_to_queue_solo_change = true;
|
||||
if (_initial_io_setup) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ((change.type & IOChange::ConfigurationChanged)) {
|
||||
/* This is called with the process lock held if change
|
||||
|
|
@ -3013,7 +3040,7 @@ Route::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
|
|||
*/
|
||||
}
|
||||
|
||||
BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
|
||||
BufferSet& bufs = _session.get_route_buffers (n_process_buffers());
|
||||
|
||||
fill_buffers_with_input (bufs, _input, nframes);
|
||||
|
||||
|
|
@ -3052,7 +3079,7 @@ Route::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, in
|
|||
|
||||
_silent = false;
|
||||
|
||||
BufferSet& bufs = _session.get_scratch_buffers (n_process_buffers());
|
||||
BufferSet& bufs = _session.get_route_buffers (n_process_buffers());
|
||||
|
||||
fill_buffers_with_input (bufs, _input, nframes);
|
||||
|
||||
|
|
@ -3152,9 +3179,6 @@ Route::set_meter_point (MeterPoint p, bool force)
|
|||
*/
|
||||
}
|
||||
|
||||
_meter->reset();
|
||||
_meter->reset_max();
|
||||
|
||||
meter_change (); /* EMIT SIGNAL */
|
||||
|
||||
bool const meter_visibly_changed = (_meter->display_to_user() != meter_was_visible_to_user);
|
||||
|
|
@ -3754,6 +3778,19 @@ Route::input_port_count_changing (ChanCount to)
|
|||
return false;
|
||||
}
|
||||
|
||||
/** Called when there is a proposed change to the output port count */
|
||||
bool
|
||||
Route::output_port_count_changing (ChanCount to)
|
||||
{
|
||||
for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
|
||||
if (processor_out_streams.get(*t) > to.get(*t)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* The change is ok */
|
||||
return false;
|
||||
}
|
||||
|
||||
list<string>
|
||||
Route::unknown_processors () const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ Send::set_state_2X (const XMLNode& node, int /* version */)
|
|||
}
|
||||
|
||||
bool
|
||||
Send::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
|
||||
Send::can_support_io_configuration (const ChanCount& in, ChanCount& out)
|
||||
{
|
||||
/* sends have no impact at all on the channel configuration of the
|
||||
streams passing through the route. so, out == in.
|
||||
|
|
|
|||
|
|
@ -4170,11 +4170,18 @@ Session::get_silent_buffers (ChanCount count)
|
|||
}
|
||||
|
||||
BufferSet&
|
||||
Session::get_scratch_buffers (ChanCount count)
|
||||
Session::get_scratch_buffers (ChanCount count, bool silence)
|
||||
{
|
||||
return ProcessThread::get_scratch_buffers (count);
|
||||
return ProcessThread::get_scratch_buffers (count, silence);
|
||||
}
|
||||
|
||||
BufferSet&
|
||||
Session::get_route_buffers (ChanCount count, bool silence)
|
||||
{
|
||||
return ProcessThread::get_route_buffers (count, silence);
|
||||
}
|
||||
|
||||
|
||||
BufferSet&
|
||||
Session::get_mix_buffers (ChanCount count)
|
||||
{
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue