Merge branch 'master' into cairocanvas

This commit is contained in:
Paul Davis 2013-07-09 09:11:52 -04:00
commit 38f2aa51bd
20 changed files with 135 additions and 66 deletions

View file

@ -153,6 +153,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
/* big clock */ /* big clock */
, big_clock (new AudioClock (X_("bigclock"), false, "big", true, true, false, false)) , big_clock (new AudioClock (X_("bigclock"), false, "big", true, true, false, false))
, video_timeline(0)
/* start of private members */ /* start of private members */
@ -903,6 +904,7 @@ If you still wish to quit, please use the\n\n\
} }
delete ARDOUR_UI::instance()->video_timeline; delete ARDOUR_UI::instance()->video_timeline;
ARDOUR_UI::instance()->video_timeline = NULL;
stop_video_server(); stop_video_server();
/* Save state before deleting the session, as that causes some /* Save state before deleting the session, as that causes some

View file

@ -65,14 +65,7 @@ ARDOUR_UI::set_session (Session *s)
{ {
SessionHandlePtr::set_session (s); SessionHandlePtr::set_session (s);
if (audio_port_matrix) { WM::Manager::instance().set_session (s);
audio_port_matrix->set_session (s);
}
if (midi_port_matrix) {
midi_port_matrix->set_session (s);
}
if (!_session) { if (!_session) {
/* Session option editor cannot exist across change-of-session */ /* Session option editor cannot exist across change-of-session */
@ -95,7 +88,6 @@ ARDOUR_UI::set_session (Session *s)
} }
AutomationWatch::instance().set_session (s); AutomationWatch::instance().set_session (s);
WM::Manager::instance().set_session (s);
if (shuttle_box) { if (shuttle_box) {
shuttle_box->set_session (s); shuttle_box->set_session (s);
@ -106,7 +98,6 @@ ARDOUR_UI::set_session (Session *s)
big_clock->set_session (s); big_clock->set_session (s);
time_info_box->set_session (s); time_info_box->set_session (s);
video_timeline->set_session (s); video_timeline->set_session (s);
location_ui->set_session (s);
/* sensitize menu bar options that are now valid */ /* sensitize menu bar options that are now valid */
@ -222,6 +213,9 @@ ARDOUR_UI::unload_session (bool hide_stuff)
editor->hide (); editor->hide ();
mixer->hide (); mixer->hide ();
theme_manager->hide (); theme_manager->hide ();
audio_port_matrix->hide();
midi_port_matrix->hide();
route_params->hide();
} }
second_connection.disconnect (); second_connection.disconnect ();

View file

@ -84,7 +84,6 @@ ArdourWindow::on_unmap ()
bool bool
ArdourWindow::on_delete_event (GdkEventAny*) ArdourWindow::on_delete_event (GdkEventAny*)
{ {
hide ();
return false; return false;
} }

View file

@ -969,7 +969,7 @@ GainMeter::render_metrics (Gtk::Widget& w, vector<DataType> types)
//font = w.get_style()->get_font(); //font = w.get_style()->get_font();
font.set_weight (Pango::WEIGHT_NORMAL); font.set_weight (Pango::WEIGHT_NORMAL);
font.set_size (10.0 * PANGO_SCALE); font.set_size (9.0 * PANGO_SCALE);
font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font)); font_attr = new Pango::AttrFontDesc (Pango::Attribute::create_attr_font_desc (font));
audio_font_attributes.change (*font_attr); audio_font_attributes.change (*font_attr);
delete font_attr; delete font_attr;
@ -1057,10 +1057,11 @@ GainMeter::render_metrics (Gtk::Widget& w, vector<DataType> types)
} }
gint const pos = height - (gint) floor (height * fraction); gint const pos = height - (gint) floor (height * fraction);
float const linepos = min((float) height, (float)(pos + .5f));
cairo_set_line_width (cr, 1.0); cairo_set_line_width (cr, 1.0);
cairo_move_to (cr, 0, pos); cairo_move_to (cr, 0, linepos);
cairo_line_to (cr, 3.5, pos); cairo_line_to (cr, 3.5, linepos);
cairo_stroke (cr); cairo_stroke (cr);
snprintf (buf, sizeof (buf), "%2d", abs (*j)); snprintf (buf, sizeof (buf), "%2d", abs (*j));

View file

@ -235,8 +235,7 @@ bool
IOSelectorWindow::wm_delete (GdkEventAny* /*event*/) IOSelectorWindow::wm_delete (GdkEventAny* /*event*/)
{ {
_selector.Finished (IOSelector::Accepted); _selector.Finished (IOSelector::Accepted);
hide (); return false;
return true;
} }

View file

@ -307,6 +307,10 @@ LocationEditRow::set_location (Location *loc)
end_clock.show(); end_clock.show();
length_clock.show(); length_clock.show();
if (location->is_cd_marker()) {
show_cd_track_details ();
}
ARDOUR_UI::instance()->set_tip (remove_button, _("Remove this range")); ARDOUR_UI::instance()->set_tip (remove_button, _("Remove this range"));
ARDOUR_UI::instance()->set_tip (start_clock, _("Start time - middle click to locate here")); ARDOUR_UI::instance()->set_tip (start_clock, _("Start time - middle click to locate here"));
ARDOUR_UI::instance()->set_tip (end_clock, _("End time - middle click to locate here")); ARDOUR_UI::instance()->set_tip (end_clock, _("End time - middle click to locate here"));
@ -446,6 +450,34 @@ LocationEditRow::clock_changed (LocationPart part)
} }
} }
void
LocationEditRow::show_cd_track_details ()
{
if (location->cd_info.find("isrc") != location->cd_info.end()) {
isrc_entry.set_text(location->cd_info["isrc"]);
}
if (location->cd_info.find("performer") != location->cd_info.end()) {
performer_entry.set_text(location->cd_info["performer"]);
}
if (location->cd_info.find("composer") != location->cd_info.end()) {
composer_entry.set_text(location->cd_info["composer"]);
}
if (location->cd_info.find("scms") != location->cd_info.end()) {
scms_check_button.set_active(true);
}
if (location->cd_info.find("preemph") != location->cd_info.end()) {
preemph_check_button.set_active(true);
}
if (!cd_track_details_hbox.get_parent()) {
item_table.attach (cd_track_details_hbox, 0, 7, 1, 2, FILL | EXPAND, FILL, 4, 0);
}
// item_table.resize(2, 7);
cd_track_details_hbox.show_all();
}
void void
LocationEditRow::cd_toggled () LocationEditRow::cd_toggled ()
{ {
@ -469,27 +501,7 @@ LocationEditRow::cd_toggled ()
if (location->is_cd_marker() && !(location->is_mark())) { if (location->is_cd_marker() && !(location->is_mark())) {
if (location->cd_info.find("isrc") != location->cd_info.end()) { show_cd_track_details ();
isrc_entry.set_text(location->cd_info["isrc"]);
}
if (location->cd_info.find("performer") != location->cd_info.end()) {
performer_entry.set_text(location->cd_info["performer"]);
}
if (location->cd_info.find("composer") != location->cd_info.end()) {
composer_entry.set_text(location->cd_info["composer"]);
}
if (location->cd_info.find("scms") != location->cd_info.end()) {
scms_check_button.set_active(true);
}
if (location->cd_info.find("preemph") != location->cd_info.end()) {
preemph_check_button.set_active(true);
}
if (!cd_track_details_hbox.get_parent()) {
item_table.attach (cd_track_details_hbox, 0, 7, 1, 2, FILL | EXPAND, FILL, 4, 0);
}
// item_table.resize(2, 7);
cd_track_details_hbox.show_all();
} else if (cd_track_details_hbox.get_parent()){ } else if (cd_track_details_hbox.get_parent()){
@ -1153,8 +1165,7 @@ LocationUIWindow::on_map ()
bool bool
LocationUIWindow::on_delete_event (GdkEventAny*) LocationUIWindow::on_delete_event (GdkEventAny*)
{ {
hide (); return false;
return true;
} }
void void

View file

@ -140,6 +140,7 @@ class LocationEditRow : public Gtk::HBox, public ARDOUR::SessionHandlePtr
void position_lock_style_changed (ARDOUR::Location *); void position_lock_style_changed (ARDOUR::Location *);
void set_clock_editable_status (); void set_clock_editable_status ();
void show_cd_track_details ();
PBD::ScopedConnectionList connections; PBD::ScopedConnectionList connections;
}; };

View file

@ -199,7 +199,7 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
v->pack_start (*manage (new Label ("")), true, true); v->pack_start (*manage (new Label ("")), true, true);
v->show (); v->show ();
h->show (); h->show ();
controls_hbox.pack_start(*v); controls_hbox.pack_start(*v, false, false);
controls_ebox.set_name ("MidiTrackControlsBaseUnselected"); controls_ebox.set_name ("MidiTrackControlsBaseUnselected");
controls_base_selected_name = "MidiTrackControlsBaseSelected"; controls_base_selected_name = "MidiTrackControlsBaseSelected";

View file

@ -148,7 +148,6 @@ PluginUIWindow::PluginUIWindow (
set_name ("PluginEditor"); set_name ("PluginEditor");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)), false);
insert->DropReferences.connect (death_connection, invalidator (*this), boost::bind (&PluginUIWindow::plugin_going_away, this), gui_context()); insert->DropReferences.connect (death_connection, invalidator (*this), boost::bind (&PluginUIWindow::plugin_going_away, this), gui_context());
gint h = _pluginui->get_preferred_height (); gint h = _pluginui->get_preferred_height ();

View file

@ -184,7 +184,7 @@ bool
PortInsertWindow::wm_delete (GdkEventAny* /*event*/) PortInsertWindow::wm_delete (GdkEventAny* /*event*/)
{ {
accept (); accept ();
return true; return false;
} }
void void

View file

@ -161,7 +161,6 @@ RegionEditor::RegionEditor (Session* s, boost::shared_ptr<Region> r)
set_name ("RegionEditorWindow"); set_name ("RegionEditorWindow");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK); add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), static_cast<Window *> (this)));
signal_response().connect (sigc::mem_fun (*this, &RegionEditor::handle_response)); signal_response().connect (sigc::mem_fun (*this, &RegionEditor::handle_response));
set_title (string_compose (_("Region '%1'"), _region->name())); set_title (string_compose (_("Region '%1'"), _region->name()));

View file

@ -111,7 +111,6 @@ ReturnUIWindow::ReturnUIWindow (boost::shared_ptr<Return> r, ARDOUR::Session* s)
set_name ("ReturnUIWindow"); set_name ("ReturnUIWindow");
r->DropReferences.connect (going_away_connection, invalidator (*this), boost::bind (&ReturnUIWindow::return_going_away, this), gui_context()); r->DropReferences.connect (going_away_connection, invalidator (*this), boost::bind (&ReturnUIWindow::return_going_away, this), gui_context());
signal_delete_event().connect (sigc::bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window *> (this)));
} }
ReturnUIWindow::~ReturnUIWindow () ReturnUIWindow::~ReturnUIWindow ()

View file

@ -146,11 +146,6 @@ RouteParams_UI::RouteParams_UI ()
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_RELEASE_MASK); add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_RELEASE_MASK);
_plugin_selector = new PluginSelector (PluginManager::instance()); _plugin_selector = new PluginSelector (PluginManager::instance());
_plugin_selector->signal_delete_event().connect (sigc::bind (ptr_fun (just_hide_it),
static_cast<Window *> (_plugin_selector)));
signal_delete_event().connect(sigc::bind(ptr_fun(just_hide_it), static_cast<Gtk::Window *>(this)));
} }
RouteParams_UI::~RouteParams_UI () RouteParams_UI::~RouteParams_UI ()

View file

@ -133,10 +133,6 @@ SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session* session)
hpacker.show (); hpacker.show ();
s->DropReferences.connect (going_away_connection, invalidator (*this), boost::bind (&SendUIWindow::send_going_away, this), gui_context()); s->DropReferences.connect (going_away_connection, invalidator (*this), boost::bind (&SendUIWindow::send_going_away, this), gui_context());
signal_delete_event().connect (sigc::bind (
sigc::ptr_fun (just_hide_it),
reinterpret_cast<Window *> (this)));
} }
SendUIWindow::~SendUIWindow () SendUIWindow::~SendUIWindow ()

View file

@ -236,7 +236,7 @@ Splash::message (const string& msg)
} }
while (!expose_done) { while (!expose_done) {
gtk_main_iteration (); if(gtk_main_iteration ()) return; // quit was called
} }
gdk_display_flush (gdk_display_get_default()); gdk_display_flush (gdk_display_get_default());
} }

View file

@ -149,7 +149,7 @@ bool
StepEditor::step_editor_hidden (GdkEventAny*) StepEditor::step_editor_hidden (GdkEventAny*)
{ {
step_editor_hide (); step_editor_hide ();
return true; return true; // XXX remember position ?!
} }
void void

View file

@ -52,6 +52,10 @@ Manager::Manager ()
{ {
} }
Manager::~Manager ()
{
}
void void
Manager::register_window (ProxyBase* info) Manager::register_window (ProxyBase* info)
{ {
@ -120,11 +124,9 @@ Manager::add_state (XMLNode& root) const
void void
Manager::set_session (ARDOUR::Session* s) Manager::set_session (ARDOUR::Session* s)
{ {
SessionHandlePtr::set_session (s);
for (Windows::const_iterator i = _windows.begin(); i != _windows.end(); ++i) { for (Windows::const_iterator i = _windows.begin(); i != _windows.end(); ++i) {
ARDOUR::SessionHandlePtr* sp = (*i)->session_handle (); (*i)->set_session(s);
if (sp) {
sp->set_session (s);
}
} }
} }
@ -263,8 +265,27 @@ ProxyBase::toggle()
_window->show_all(); _window->show_all();
/* we'd like to just call this and nothing else */ /* we'd like to just call this and nothing else */
_window->present (); _window->present ();
if (_width != -1 && _height != -1) {
_window->set_default_size (_width, _height);
}
if (_x_off != -1 && _y_off != -1) {
_window->move (_x_off, _y_off);
}
} else { } else {
if (_window->is_mapped()) {
save_pos_and_size();
}
vistracker->cycle_visibility (); vistracker->cycle_visibility ();
if (_window->is_mapped()) {
if (_width != -1 && _height != -1) {
_window->set_default_size (_width, _height);
}
if (_x_off != -1 && _y_off != -1) {
_window->move (_x_off, _y_off);
}
}
} }
} }
@ -281,8 +302,10 @@ ProxyBase::get_state () const
/* we have a window, so use current state */ /* we have a window, so use current state */
_visible = vistracker->partially_visible (); _visible = vistracker->partially_visible ();
_window->get_position (_x_off, _y_off); if (_visible) {
_window->get_size (_width, _height); _window->get_position (_x_off, _y_off);
_window->get_size (_width, _height);
}
} }
node->add_property (X_("visible"), _visible? X_("yes") : X_("no")); node->add_property (X_("visible"), _visible? X_("yes") : X_("no"));
@ -325,6 +348,7 @@ ProxyBase::setup ()
assert (_window); assert (_window);
vistracker = new Gtkmm2ext::VisibilityTracker (*_window); vistracker = new Gtkmm2ext::VisibilityTracker (*_window);
_window->signal_delete_event().connect (sigc::mem_fun (*this, &ProxyBase::handle_win_event));
if (_width != -1 || _height != -1 || _x_off != -1 || _y_off != -1) { if (_width != -1 || _height != -1 || _x_off != -1 || _y_off != -1) {
/* cancel any mouse-based positioning */ /* cancel any mouse-based positioning */
@ -338,6 +362,7 @@ ProxyBase::setup ()
if (_x_off != -1 && _y_off != -1) { if (_x_off != -1 && _y_off != -1) {
_window->move (_x_off, _y_off); _window->move (_x_off, _y_off);
} }
set_session(_session);
} }
void void
@ -379,10 +404,25 @@ ProxyBase::hide ()
{ {
Gtk::Window* win = get (false); Gtk::Window* win = get (false);
if (win) { if (win) {
save_pos_and_size();
win->hide (); win->hide ();
} }
} }
bool
ProxyBase::handle_win_event (GdkEventAny *ev)
{
hide();
return true;
}
void
ProxyBase::save_pos_and_size ()
{
Gtk::Window* win = get (false);
win->get_position (_x_off, _y_off);
win->get_size (_width, _height);
}
/*-----------------------*/ /*-----------------------*/
ProxyTemporary::ProxyTemporary (const string& name, Gtk::Window* win) ProxyTemporary::ProxyTemporary (const string& name, Gtk::Window* win)
@ -395,6 +435,7 @@ ProxyTemporary::~ProxyTemporary ()
{ {
} }
ARDOUR::SessionHandlePtr* ARDOUR::SessionHandlePtr*
ProxyTemporary::session_handle() ProxyTemporary::session_handle()
{ {

View file

@ -47,7 +47,7 @@ namespace WM {
class ProxyBase; class ProxyBase;
class Manager class Manager : public ARDOUR::SessionHandlePtr
{ {
public: public:
static Manager& instance(); static Manager& instance();
@ -75,7 +75,7 @@ class Manager
static Manager* _instance; static Manager* _instance;
}; };
class ProxyBase : public sigc::trackable { class ProxyBase : public ARDOUR::SessionHandlePtr, public sigc::trackable {
public: public:
ProxyBase (const std::string& name, const std::string& menu_name); ProxyBase (const std::string& name, const std::string& menu_name);
ProxyBase (const std::string& name, const std::string& menu_name, const XMLNode&); ProxyBase (const std::string& name, const std::string& menu_name, const XMLNode&);
@ -106,7 +106,7 @@ class ProxyBase : public sigc::trackable {
XMLNode& get_state () const; XMLNode& get_state () const;
virtual ARDOUR::SessionHandlePtr* session_handle () = 0; virtual ARDOUR::SessionHandlePtr* session_handle () = 0;
operator bool() const { return _window != 0; } operator bool() const { return _window != 0; }
protected: protected:
@ -120,6 +120,9 @@ class ProxyBase : public sigc::trackable {
mutable int _width; ///< width mutable int _width; ///< width
mutable int _height; ///< height mutable int _height; ///< height
Gtkmm2ext::VisibilityTracker* vistracker; Gtkmm2ext::VisibilityTracker* vistracker;
void save_pos_and_size ();
bool handle_win_event (GdkEventAny *ev);
void setup (); void setup ();
}; };
@ -137,7 +140,7 @@ class ProxyTemporary: public ProxyBase {
Gtk::Window* operator->() { Gtk::Window* operator->() {
return _window; return _window;
} }
ARDOUR::SessionHandlePtr* session_handle (); ARDOUR::SessionHandlePtr* session_handle ();
}; };
@ -175,6 +178,15 @@ class ProxyWithConstructor: public ProxyBase {
return dynamic_cast<T*> (_window); return dynamic_cast<T*> (_window);
} }
void set_session(ARDOUR::Session *s) {
SessionHandlePtr::set_session (s);
ARDOUR::SessionHandlePtr* sp = session_handle ();
if (sp) {
sp->set_session (s);
dynamic_cast<T*>(_window)->set_session(s);
}
}
private: private:
boost::function<T*()> creator; boost::function<T*()> creator;
}; };
@ -213,6 +225,15 @@ class Proxy : public ProxyBase {
return dynamic_cast<T*> (_window); return dynamic_cast<T*> (_window);
} }
void set_session(ARDOUR::Session *s) {
SessionHandlePtr::set_session (s);
ARDOUR::SessionHandlePtr* sp = session_handle ();
if (sp) {
sp->set_session (s);
dynamic_cast<T*>(_window)->set_session(s);
}
}
private: private:
boost::function<T*()> creator; boost::function<T*()> creator;
}; };

View file

@ -137,6 +137,18 @@ PeakMeter::reflect_inputs (const ChanCount& in)
{ {
current_meters = in; current_meters = in;
const size_t limit = min (_peak_power.size(), (size_t) current_meters.n_total ());
const size_t n_midi = min (_peak_power.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;
}
}
reset_max();
ConfigurationChanged (in, in); /* EMIT SIGNAL */ ConfigurationChanged (in, in); /* EMIT SIGNAL */
} }

View file

@ -945,6 +945,6 @@ Track::set_monitoring (MonitorChoice mc)
MeterState MeterState
Track::metering_state () const Track::metering_state () const
{ {
return _diskstream->record_enabled() ? MeteringInput : MeteringRoute; return (_diskstream->record_enabled() || _meter_point == MeterInput) ? MeteringInput : MeteringRoute;
} }