13
0

Merge branch 'master' into windows

This commit is contained in:
Paul Davis 2013-07-14 08:27:22 -04:00
commit 0aac62e013
19 changed files with 101 additions and 48 deletions

View File

@ -903,8 +903,7 @@ If you still wish to quit, please use the\n\n\
second_connection.disconnect ();
point_one_second_connection.disconnect ();
point_oh_five_second_connection.disconnect ();
point_zero_one_second_connection.disconnect();
point_zero_something_second_connection.disconnect();
}
delete ARDOUR_UI::instance()->video_timeline;
@ -1034,9 +1033,9 @@ ARDOUR_UI::every_point_one_seconds ()
}
gint
ARDOUR_UI::every_point_zero_one_seconds ()
ARDOUR_UI::every_point_zero_something_seconds ()
{
// august 2007: actual update frequency: 40Hz, not 100Hz
// august 2007: actual update frequency: 25Hz (40ms), not 100Hz
SuperRapidScreenUpdate(); /* EMIT_SIGNAL */
return TRUE;

View File

@ -177,10 +177,17 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
static PublicEditor* _instance;
static sigc::signal<void,bool> Blink;
/** point_zero_one_seconds -- 10Hz ^= 100ms */
static sigc::signal<void> RapidScreenUpdate;
/** point_zero_something_seconds -- currently 25Hz ^= 40ms */
static sigc::signal<void> SuperRapidScreenUpdate;
/** Emitted frequently with the audible frame, false, and the edit point as
* parameters respectively.
*
* (either RapidScreenUpdate || SuperRapidScreenUpdate - user-config)
*/
static sigc::signal<void, framepos_t, bool, framepos_t> Clock;
@ -521,12 +528,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
gint every_second ();
gint every_point_one_seconds ();
gint every_point_zero_one_seconds ();
gint every_point_zero_something_seconds ();
sigc::connection second_connection;
sigc::connection point_one_second_connection;
sigc::connection point_oh_five_second_connection;
sigc::connection point_zero_one_second_connection;
sigc::connection point_zero_something_second_connection;
void open_session ();
void open_recent_session ();

View File

@ -183,7 +183,7 @@ ARDOUR_UI::set_session (Session *s)
second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_second), 1000);
point_one_second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_one_seconds), 100);
point_zero_one_second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_zero_one_seconds), 40);
point_zero_something_second_connection = Glib::signal_timeout().connect (sigc::mem_fun(*this, &ARDOUR_UI::every_point_zero_something_seconds), 40);
update_format ();
}
@ -223,8 +223,7 @@ ARDOUR_UI::unload_session (bool hide_stuff)
second_connection.disconnect ();
point_one_second_connection.disconnect ();
point_oh_five_second_connection.disconnect ();
point_zero_one_second_connection.disconnect();
point_zero_something_second_connection.disconnect();
ActionManager::set_sensitive (ActionManager::session_sensitive_actions, false);

View File

@ -31,9 +31,15 @@ ConfigInfoDialog::ConfigInfoDialog ()
text.get_buffer()->set_text (std::string (ARDOUR::ardour_config_info));
text.set_wrap_mode (Gtk::WRAP_WORD);
text.show ();
text.set_size_request (300, 800);
get_vbox()->pack_start (text, true, true);
scroller.set_shadow_type(Gtk::SHADOW_NONE);
scroller.set_border_width(0);
scroller.add (text);
scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
scroller.show();
get_vbox()->pack_start (scroller, true, true);
set_size_request (400, 600);
add_button (Gtk::Stock::CLOSE, Gtk::RESPONSE_ACCEPT);
}

View File

@ -18,6 +18,7 @@
*/
#include <gtkmm/textview.h>
#include <gtkmm/scrolledwindow.h>
#include "ardour_dialog.h"
@ -28,4 +29,5 @@ class ConfigInfoDialog : public ArdourDialog
private:
Gtk::TextView text;
Gtk::ScrolledWindow scroller;
};

View File

@ -1086,7 +1086,7 @@ GainMeter::meter_configuration_changed (ChanCount c)
set_meter_strip_name ("AudioMidiTrackMetricsInactive");
}
}
meter_clear_pattern_cache(); // XXX only once
meter_clear_pattern_cache(4);
}
void

View File

@ -659,7 +659,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
control_ui->display_label->set_name ("ParameterValueDisplay");
control_ui->display->add (*control_ui->display_label);
Gtkmm2ext::set_size_request_to_display_given_text (*control_ui->display, "-99,99", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (*control_ui->display, "-888.8g", 2, 6);
control_ui->display->show_all ();
@ -669,7 +669,17 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
MeterInfo * info = new MeterInfo(port_index);
control_ui->meterinfo = info;
info->meter = new FastMeter (5, 5, FastMeter::Vertical);
info->meter = new FastMeter (
5, 5, FastMeter::Vertical, 0,
0x0000aaff,
0x008800ff, 0x008800ff,
0x00ff00ff, 0x00ff00ff,
0xcccc00ff, 0xcccc00ff,
0xffaa00ff, 0xffaa00ff,
0xff0000ff,
ARDOUR_UI::config()->canvasvar_MeterBackgroundBot.get(),
ARDOUR_UI::config()->canvasvar_MeterBackgroundTop.get()
);
info->min_unbound = desc.min_unbound;
info->max_unbound = desc.max_unbound;
@ -680,6 +690,9 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
control_ui->vbox = manage (new VBox);
control_ui->hbox = manage (new HBox);
control_ui->hbox->set_spacing(1);
control_ui->vbox->set_spacing(3);
control_ui->label.set_angle(90);
control_ui->hbox->pack_start (control_ui->label, false, false);
control_ui->hbox->pack_start (*info->meter, false, false);
@ -834,7 +847,7 @@ GenericPluginUI::start_updating (GdkEventAny*)
{
if (output_controls.size() > 0 ) {
screen_update_connection.disconnect();
screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect
screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect
(sigc::mem_fun(*this, &GenericPluginUI::output_update));
}
return false;

View File

@ -144,7 +144,7 @@ LV2PluginUI::start_updating(GdkEventAny*)
{
if (!_output_ports.empty()) {
_screen_update_connection.disconnect();
_screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect
_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect
(sigc::mem_fun(*this, &LV2PluginUI::output_update));
}
return false;
@ -322,7 +322,7 @@ LV2PluginUI::lv2ui_instantiate(const std::string& title)
if (_lv2->has_message_output()) {
_lv2->enable_ui_emmission();
ARDOUR_UI::instance()->RapidScreenUpdate.connect(
ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect(
sigc::mem_fun(*this, &LV2PluginUI::update_timeout));
}
}
@ -432,7 +432,7 @@ LV2PluginUI::on_window_show(const std::string& title)
LV2_EXTERNAL_UI_SHOW(_external_ui_ptr);
_screen_update_connection.disconnect();
_screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect
_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect
(sigc::mem_fun(*this, &LV2PluginUI::output_update));
return false;
} else {

View File

@ -485,9 +485,34 @@ gint meter_expose_metrics (GdkEventExpose *ev, std::vector<ARDOUR::DataType> typ
return true;
}
void meter_clear_pattern_cache() {
// TODO allow to clear meterbridge "*Left|Right" patterns independenly
metric_patterns.clear();
ticks_patterns.clear();
void meter_clear_pattern_cache(int which) {
MetricPatterns::iterator i = metric_patterns.begin();
TickPatterns::iterator j = ticks_patterns.begin();
while (i != metric_patterns.end()) {
int m = 4;
std::string n = i->first;
if (n.substr(n.length() - 4) == "Left") { m = 1; }
if (n.substr(n.length() - 5) == "Right") { m = 2; }
if (which & m) {
cairo_pattern_destroy(i->second);
metric_patterns.erase(i++);
} else {
++i;
}
}
while (j != ticks_patterns.end()) {
int m = 4;
std::string n = j->first;
if (n.substr(n.length() - 4) == "Left") { m = 1; }
if (n.substr(n.length() - 5) == "Right") { m = 2; }
if (which & m) {
cairo_pattern_destroy(j->second);
ticks_patterns.erase(j++);
} else {
++j;
}
}
RedrawMetrics();
}

View File

@ -40,7 +40,7 @@ cairo_pattern_t* meter_render_metrics (Gtk::Widget& w, std::vector<ARDOUR::DataT
gint meter_expose_ticks (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types, Gtk::DrawingArea *mta);
gint meter_expose_metrics (GdkEventExpose *ev, std::vector<ARDOUR::DataType> types, Gtk::DrawingArea *mma);
void meter_clear_pattern_cache();
void meter_clear_pattern_cache(int which=7);
#endif

View File

@ -372,14 +372,12 @@ MeterStrip::meter_configuration_changed (ChanCount c)
void
MeterStrip::on_size_request (Gtk::Requisition* r)
{
meter_clear_pattern_cache();
VBox::on_size_request(r);
}
void
MeterStrip::on_size_allocate (Gtk::Allocation& a)
{
meter_clear_pattern_cache();
const int wh = a.get_height();
int nh = ceilf(wh * .11f);
if (nh < 52) nh = 52;

View File

@ -309,6 +309,7 @@ Meterbridge::on_scroll_event (GdkEventScroll* ev)
void
Meterbridge::scroll_left ()
{
if (!scroller.get_hscrollbar()) return;
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
/* stupid GTK: can't rely on clamping across versions */
scroller.get_hscrollbar()->set_value (max (adj->get_lower(), adj->get_value() - adj->get_step_increment()));
@ -317,6 +318,7 @@ Meterbridge::scroll_left ()
void
Meterbridge::scroll_right ()
{
if (!scroller.get_hscrollbar()) return;
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
/* stupid GTK: can't rely on clamping across versions */
scroller.get_hscrollbar()->set_value (min (adj->get_upper(), adj->get_value() + adj->get_step_increment()));
@ -325,6 +327,7 @@ Meterbridge::scroll_right ()
void
Meterbridge::on_size_request (Gtk::Requisition* r)
{
meter_clear_pattern_cache(3);
Gtk::Window::on_size_request(r);
Gdk::Geometry geom;

View File

@ -1666,6 +1666,7 @@ Mixer_UI::pane_allocation_handler (Allocation&, Gtk::Paned* which)
void
Mixer_UI::scroll_left ()
{
if (!scroller.get_hscrollbar()) return;
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
/* stupid GTK: can't rely on clamping across versions */
scroller.get_hscrollbar()->set_value (max (adj->get_lower(), adj->get_value() - adj->get_step_increment()));
@ -1674,6 +1675,7 @@ Mixer_UI::scroll_left ()
void
Mixer_UI::scroll_right ()
{
if (!scroller.get_hscrollbar()) return;
Adjustment* adj = scroller.get_hscrollbar()->get_adjustment();
/* stupid GTK: can't rely on clamping across versions */
scroller.get_hscrollbar()->set_value (min (adj->get_upper(), adj->get_value() + adj->get_step_increment()));

View File

@ -591,7 +591,7 @@ ArdourStartup::setup_initial_choice_page ()
ic_vbox.show_all ();
initial_choice_index = append_page (ic_vbox);
set_page_title (ic_vbox, _("What would you like to do ?"));
set_page_title (ic_vbox, string_compose("%1 %2", PROGRAM_NAME, VERSIONSTRING));
set_page_header_image (ic_vbox, icon_pixbuf);
/* user could just click on "Forward" if default

View File

@ -468,6 +468,12 @@ BarController::expose (GdkEventExpose* /*event*/)
break;
}
if (!darea.get_sensitive()) {
rounded_rectangle (context, 0, 0, darea.get_width(), darea.get_height(), 3);
context->set_source_rgba (0.505, 0.517, 0.525, 0.6);
context->fill ();
}
/* draw label */
double xpos = -1;

View File

@ -53,7 +53,6 @@ FastMeter::FastMeter (long hold, unsigned long dimen, Orientation o, int len,
{
orientation = o;
hold_cnt = hold;
resized = true;
hold_state = 0;
bright_hold = false;
current_peak = 0;
@ -353,7 +352,6 @@ FastMeter::on_size_allocate (Gtk::Allocation &alloc)
}
DrawingArea::on_size_allocate (alloc);
resized = true;
}
bool
@ -372,16 +370,13 @@ FastMeter::vertical_expose (GdkEventExpose* ev)
cairo_t* cr = gdk_cairo_create (get_window ()->gobj());
if (resized) {
cairo_set_source_rgb (cr, 0, 0, 0); // black
rounded_rectangle (cr, 0, 0, pixrect.width + 2, pixheight + 2, 2);
cairo_stroke (cr);
//cairo_fill (cr);
//resized = false;
}
cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
cairo_clip (cr);
cairo_set_source_rgb (cr, 0, 0, 0); // black
rounded_rectangle (cr, 0, 0, pixrect.width + 2, pixheight + 2, 2);
cairo_stroke (cr);
top_of_meter = (gint) floor (pixheight * current_level);
/* reset the height & origin of the rect that needs to show the pixbuf
@ -464,11 +459,10 @@ FastMeter::set (float lvl, float peak)
current_level = lvl;
if (current_level == old_level && current_peak == old_peak && hold_state == 0) {
if (current_level == old_level && current_peak == old_peak && (hold_state == 0 || peak != -1)) {
return;
}
Glib::RefPtr<Gdk::Window> win;
if ((win = get_window()) == 0) {
@ -565,7 +559,6 @@ FastMeter::set_highlight (bool onoff)
}
highlight = onoff;
bgpattern = request_vertical_background (request_width, pixheight, highlight ? _bgh : _bgc, highlight);
resized = true;
queue_draw ();
}

View File

@ -351,7 +351,7 @@ private:
/* dropped from ourselves onto ourselves */
T* child = *((T **) selection_data.get_data());
T* child = *((T * const *) selection_data.get_data());
if (drop.first == 0) {
_internal_vbox.reorder_child (child->widget(), -1);

View File

@ -91,7 +91,6 @@ private:
float current_level;
float current_peak;
float current_user_level;
bool resized;
bool highlight;
bool vertical_expose (GdkEventExpose*);

View File

@ -292,13 +292,15 @@ PixFader::on_expose_event (GdkEventExpose* ev)
pango_cairo_show_layout (cr, _layout->gobj());
}
// if (Config->get_widget_prelight()) { //pixfader does not have access to config
if (_hovering) {
Gtkmm2ext::rounded_rectangle (cr, 0, 0, get_width(), get_height(), 3);
cairo_set_source_rgba (cr, 0.905, 0.917, 0.925, 0.1);
cairo_fill (cr);
}
// }
if (!get_sensitive()) {
Gtkmm2ext::rounded_rectangle (cr, 0, 0, get_width(), get_height(), 3);
cairo_set_source_rgba (cr, 0.505, 0.517, 0.525, 0.4);
cairo_fill (cr);
} else if (_hovering) {
Gtkmm2ext::rounded_rectangle (cr, 0, 0, get_width(), get_height(), 3);
cairo_set_source_rgba (cr, 0.905, 0.917, 0.925, 0.1);
cairo_fill (cr);
}
last_drawn = ds;