summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-04-29 17:23:11 +0000
committerDavid Robillard <d@drobilla.net>2007-04-29 17:23:11 +0000
commitb3fe7cfc892f7d5978ad14eb81e9305fa9c14d13 (patch)
tree4c6617c0397fb1ad3bef1f5fced35fb64b022ccb /gtk2_ardour
parent490e18d80a22dda07bdf88dd440f7100897822de (diff)
Merged with trunk R1761
git-svn-id: svn://localhost/ardour2/branches/midi@1762 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour.colors4
-rw-r--r--gtk2_ardour/ardour2_ui.rc1
-rw-r--r--gtk2_ardour/ardour_ui.cc44
-rw-r--r--gtk2_ardour/ardour_ui.h2
-rw-r--r--gtk2_ardour/audio_streamview.cc16
-rw-r--r--gtk2_ardour/audio_streamview.h1
-rw-r--r--gtk2_ardour/automation_time_axis.cc2
-rw-r--r--gtk2_ardour/editor.cc10
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_mixer.cc16
-rw-r--r--gtk2_ardour/editor_mouse.cc57
-rw-r--r--gtk2_ardour/enums.cc6
-rw-r--r--gtk2_ardour/mixer_strip.cc56
-rw-r--r--gtk2_ardour/mixer_strip.h6
-rw-r--r--gtk2_ardour/mixer_ui.cc9
-rw-r--r--gtk2_ardour/new_session_dialog.cc7
-rw-r--r--gtk2_ardour/new_session_dialog.h1
-rw-r--r--gtk2_ardour/route_time_axis.cc7
-rw-r--r--gtk2_ardour/route_time_axis.h2
-rw-r--r--gtk2_ardour/route_ui.h2
-rw-r--r--gtk2_ardour/streamview.cc8
-rw-r--r--gtk2_ardour/time_axis_view_item.cc6
22 files changed, 192 insertions, 72 deletions
diff --git a/gtk2_ardour/ardour.colors b/gtk2_ardour/ardour.colors
index d8a1aa9f77..0bc9565c8a 100644
--- a/gtk2_ardour/ardour.colors
+++ b/gtk2_ardour/ardour.colors
@@ -17,9 +17,9 @@ cTransportMarkerBar 0.60 0.60 0.64 1.0
cTimeStretchFill 0.89 0.71 0.71 0.59
cTimeStretchOutline 0.39 0.39 0.39 0.59
cAutomationLine 0.27 0.74 0.35 1.0
-cLeftPanAutomationLine 0.77 0.24 0.01 1.0
+cLeftPanAutomationLine 0.87 0.44 0.11 1.0
cRightPanAutomationLine 0.03 0.26 0.73 1.0
-cRedirectAutomationLine 0.28 0.34 0.74 1.0
+cRedirectAutomationLine 0.48 0.64 0.98 1.0
cControlPointFill 0 0 0 1.0
cControlPointOutline 0 0 0 1.0
cEnteredControlPointOutline 1.0 0.21 0.21 1.0
diff --git a/gtk2_ardour/ardour2_ui.rc b/gtk2_ardour/ardour2_ui.rc
index ce69b90170..82da69ebf5 100644
--- a/gtk2_ardour/ardour2_ui.rc
+++ b/gtk2_ardour/ardour2_ui.rc
@@ -449,6 +449,7 @@ style "editor_hscrollbar" = "ardour_adjusters"
# make it bigger.
#
GtkRange::slider_width = 27
+ GtkScrollbar::slider_width = 27
}
style "ardour_progressbars" = "default_buttons_menus"
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index e990f5ce20..de006a8fec 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -951,9 +951,30 @@ ARDOUR_UI::filter_ardour_session_dirs (const FileFilter::Info& info)
return S_ISREG (statbuf.st_mode);
}
+bool
+ARDOUR_UI::check_audioengine ()
+{
+ if (engine) {
+ if (!engine->connected()) {
+ MessageDialog msg (_("Ardour is not connected to JACK\n"
+ "You cannot open or close sessions in this condition"));
+ msg.run ();
+ return false;
+ }
+ return true;
+ } else {
+ return false;
+ }
+}
+
void
ARDOUR_UI::open_session ()
{
+ if (!check_audioengine()) {
+ return;
+
+ }
+
/* popup selector window */
if (open_session_selector == 0) {
@@ -1789,9 +1810,7 @@ ARDOUR_UI::new_session (std::string predetermined_path)
string session_name;
string session_path;
- if (!engine->connected()) {
- MessageDialog msg (_("Ardour is not connected to JACK at this time. Creating new sessions is not possible."));
- msg.run ();
+ if (!check_audioengine()) {
return false;
}
@@ -1801,14 +1820,13 @@ ARDOUR_UI::new_session (std::string predetermined_path)
new_session_dialog->set_name (predetermined_path);
new_session_dialog->reset_recent();
new_session_dialog->show();
+ new_session_dialog->set_current_page (0);
do {
response = new_session_dialog->run ();
- if (!engine->connected()) {
+ if (!check_audioengine()) {
new_session_dialog->hide ();
- MessageDialog msg (_("Ardour is not connected to JACK at this time. Creating new sessions is not possible."));
- msg.run ();
return false;
}
@@ -2001,6 +2019,10 @@ ARDOUR_UI::new_session (std::string predetermined_path)
void
ARDOUR_UI::close_session()
{
+ if (!check_audioengine()) {
+ return;
+ }
+
unload_session();
new_session ();
}
@@ -2012,6 +2034,10 @@ ARDOUR_UI::load_session (const string & path, const string & snap_name, string*
int x;
session_loaded = false;
+ if (!check_audioengine()) {
+ return -1;
+ }
+
x = unload_session ();
if (x < 0) {
@@ -2068,8 +2094,14 @@ ARDOUR_UI::build_session (const string & path, const string & snap_name,
Session *new_session;
int x;
+ if (!check_audioengine()) {
+ return -1;
+ }
+
session_loaded = false;
+
x = unload_session ();
+
if (x < 0) {
return -1;
} else if (x > 0) {
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 0b5016ea28..d0c1e7194a 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -263,6 +263,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI
ARDOUR::AudioEngine *engine;
ARDOUR::Session *session;
+ bool check_audioengine();
+
Gtk::Tooltips _tooltips;
void goto_editor_window ();
diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc
index c2a7165c2e..398b9c404b 100644
--- a/gtk2_ardour/audio_streamview.cc
+++ b/gtk2_ardour/audio_streamview.cc
@@ -289,12 +289,26 @@ AudioStreamView::playlist_changed (boost::shared_ptr<Diskstream> ds)
}
void
+AudioStreamView::add_crossfade_weak (boost::weak_ptr<Crossfade> crossfade)
+{
+ boost::shared_ptr<Crossfade> sp (crossfade.lock());
+
+ if (!sp) {
+ return;
+ }
+
+ add_crossfade (sp);
+}
+
+void
AudioStreamView::add_crossfade (boost::shared_ptr<Crossfade> crossfade)
{
AudioRegionView* lview = 0;
AudioRegionView* rview = 0;
+
+ /* we do not allow shared_ptr<T> to be bound to slots */
- ENSURE_GUI_THREAD (bind (mem_fun (*this, &AudioStreamView::add_crossfade), crossfade));
+ ENSURE_GUI_THREAD (bind (mem_fun (*this, &AudioStreamView::add_crossfade_weak), boost::weak_ptr<Crossfade> (crossfade)));
/* first see if we already have a CrossfadeView for this Crossfade */
diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h
index c52a10baeb..9f3630c182 100644
--- a/gtk2_ardour/audio_streamview.h
+++ b/gtk2_ardour/audio_streamview.h
@@ -94,6 +94,7 @@ class AudioStreamView : public StreamView
void playlist_changed (boost::shared_ptr<ARDOUR::Diskstream>);
void add_crossfade (boost::shared_ptr<ARDOUR::Crossfade>);
+ void add_crossfade_weak (boost::weak_ptr<ARDOUR::Crossfade>);
void remove_crossfade (boost::shared_ptr<ARDOUR::Crossfade>);
void color_handler (ColorID id, uint32_t val);
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index e9657e1f4f..12998ee7d6 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -73,7 +73,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
base_rect = new SimpleRect(*canvas_display);
base_rect->property_x1() = 0.0;
base_rect->property_y1() = 0.0;
- base_rect->property_x2() = max_frames;
+ base_rect->property_x2() = editor.frame_to_pixel (max_frames);
base_rect->property_outline_color_rgba() = color_map[cAutomationTrackOutline];
/* outline ends and bottom */
base_rect->property_outline_what() = (guint32) (0x1|0x2|0x8);
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 8ea8aaf87d..e56acc0114 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -27,7 +27,7 @@
#include <pbd/convert.h>
#include <pbd/error.h>
-#include <pbd/stacktrace.h>
+#include <pbd/enumwriter.h>
#include <pbd/memento_command.h>
#include <glibmm/miscutils.h>
@@ -2042,6 +2042,10 @@ Editor::set_state (const XMLNode& node)
edit_cursor->set_position (0);
}
+ if ((prop = node.property ("mixer-width"))) {
+ editor_mixer_strip_width = Width (string_2_enum (prop->value(), editor_mixer_strip_width));
+ }
+
if ((prop = node.property ("zoom-focus"))) {
set_zoom_focus ((ZoomFocus) atoi (prop->value()));
}
@@ -2182,6 +2186,8 @@ Editor::get_state ()
node->add_child_nocopy (*geometry);
}
+ maybe_add_mixer_strip_width (*node);
+
snprintf (buf, sizeof(buf), "%d", (int) zoom_focus);
node->add_property ("zoom-focus", buf);
snprintf (buf, sizeof(buf), "%f", frames_per_unit);
@@ -3777,7 +3783,7 @@ Editor::idle_visual_changer ()
}
}
- return 0;
+ return 0; /* this is always a one-shot call */
}
struct EditorOrderTimeAxisSorter {
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 8748816c31..ccf45bf80d 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -264,6 +264,7 @@ class Editor : public PublicEditor
TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0);
Width editor_mixer_strip_width;
+ void maybe_add_mixer_strip_width (XMLNode&);
void show_editor_mixer (bool yn);
void set_selected_mixer_strip (TimeAxisView&);
void hide_track_in_display (TimeAxisView& tv);
diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc
index de8e6b60dc..5804381102 100644
--- a/gtk2_ardour/editor_mixer.cc
+++ b/gtk2_ardour/editor_mixer.cc
@@ -20,6 +20,9 @@
#include <glibmm/miscutils.h>
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/window_title.h>
+
+#include <pbd/enumwriter.h>
+
#include <ardour/audioengine.h>
#include "editor.h"
@@ -32,6 +35,7 @@
#include "i18n.h"
using namespace Gtkmm2ext;
+using namespace PBD;
void
Editor::editor_mixer_button_toggled ()
@@ -107,8 +111,8 @@ Editor::show_editor_mixer (bool yn)
current_mixer_strip->set_embedded (true);
current_mixer_strip->Hiding.connect (mem_fun(*this, &Editor::current_mixer_strip_hidden));
current_mixer_strip->GoingAway.connect (mem_fun(*this, &Editor::current_mixer_strip_removed));
- current_mixer_strip->set_width (editor_mixer_strip_width);
-
+ current_mixer_strip->set_width (editor_mixer_strip_width, (void*) this);
+
global_hpacker.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK );
global_hpacker.reorder_child (*current_mixer_strip, 0);
@@ -355,3 +359,11 @@ Editor::session_going_away ()
session = 0;
}
+
+void
+Editor::maybe_add_mixer_strip_width (XMLNode& node)
+{
+ if (current_mixer_strip) {
+ node.add_property ("mixer-width", enum_2_string (current_mixer_strip->get_width()));
+ }
+}
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index 4980f16757..8ff4082d60 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -1622,7 +1622,6 @@ Editor::end_grab (ArdourCanvas::Item* item, GdkEvent* event)
stop_canvas_autoscroll ();
if (drag_info.item == 0) {
- cerr << "end grab with no item\n";
return false;
}
@@ -2770,7 +2769,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
drag_info.want_move_threshold = false; // don't copy again
/* duplicate the region(s) */
-
+
vector<RegionView*> new_regionviews;
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i) {
@@ -2804,7 +2803,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
/* reset drag_info data to reflect the fact that we are dragging the copies */
drag_info.data = new_regionviews.front();
-
+
swap_grab (new_regionviews.front()->get_canvas_group (), 0, event->motion.time);
}
@@ -3237,6 +3236,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
RouteTimeAxisView* rtv;
bool regionview_y_movement;
bool regionview_x_movement;
+ vector<RegionView*> copies;
/* first_move is set to false if the regionview has been moved in the
motion handler.
@@ -3244,6 +3244,12 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
if (drag_info.first_move) {
/* just a click */
+
+ if (drag_info.copy) {
+ for (list<RegionView*>::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
+ copies.push_back (*i);
+ }
+ }
goto out;
}
@@ -3257,6 +3263,13 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
if (drag_info.brushing) {
/* all changes were made during motion event handlers */
+
+ if (drag_info.copy) {
+ for (list<RegionView*>::iterator i = selection->regions.begin(); i != selection->regions.end(); ++i) {
+ copies.push_back (*i);
+ }
+ }
+
goto out;
}
@@ -3299,7 +3312,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
vector<RegionView*> new_selection;
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ) {
-
+
RegionView* rv = (*i);
double ix1, ix2, iy1, iy2;
@@ -3335,6 +3348,12 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
session->add_command (new MementoCommand<Playlist>(*from_playlist, &from_playlist->get_state(), 0));
from_playlist->remove_region ((rv->region()));
session->add_command (new MementoCommand<Playlist>(*from_playlist, 0, &from_playlist->get_state()));
+
+ } else {
+
+ /* the regionview we dragged around is a temporary copy, queue it for deletion */
+
+ copies.push_back (rv);
}
latest_regionview = 0;
@@ -3349,11 +3368,6 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
new_selection.push_back (latest_regionview);
}
- if (drag_info.copy) {
- // get rid of the copy
- delete rv;
- }
-
/* OK, this is where it gets tricky. If the playlist was being used by >1 tracks, and the region
was selected in all of them, then removing it from the playlist will have removed all
trace of it from the selection (i.e. there were N regions selected, we removed 1,
@@ -3366,12 +3380,19 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
here. if the region selection is not empty, then restart the loop because we know that
we must have removed at least the region(view) we've just been working on as well as any
that we processed on previous iterations.
+
+ EXCEPT .... if we are doing a copy drag, then the selection hasn't been modified and
+ we can just iterate.
*/
- if (selection->regions.empty()) {
- break;
- } else {
- i = selection->regions.by_layer().begin();
+ if (drag_info.copy) {
+ ++i;
+ } else {
+ if (selection->regions.empty()) {
+ break;
+ } else {
+ i = selection->regions.by_layer().begin();
+ }
}
}
@@ -3465,10 +3486,8 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
session->add_command (new MementoCommand<Playlist>(*to_playlist, 0, &to_playlist->get_state()));
- /* get rid of the copy */
-
if (drag_info.copy) {
- delete rv;
+ copies.push_back (rv);
}
}
}
@@ -3478,6 +3497,10 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
if (!nocommit) {
commit_reversible_command ();
}
+
+ for (vector<RegionView*>::iterator x = copies.begin(); x != copies.end(); ++x) {
+ delete *x;
+ }
}
void
@@ -4764,7 +4787,7 @@ Editor::mouse_rename_region (ArdourCanvas::Item* item, GdkEvent* event)
string str;
prompter.get_result(str);
if (str.length()) {
- clicked_regionview->region()->set_name (str);
+ clicked_regionview->region()->set_name (str);
}
break;
}
diff --git a/gtk2_ardour/enums.cc b/gtk2_ardour/enums.cc
index 9943d52258..e6c81598fb 100644
--- a/gtk2_ardour/enums.cc
+++ b/gtk2_ardour/enums.cc
@@ -20,6 +20,7 @@
#include <pbd/enumwriter.h>
#include "audio_clock.h"
+#include "enums.h"
using namespace std;
using namespace PBD;
@@ -33,6 +34,7 @@ setup_gtk_ardour_enums ()
vector<string> s;
AudioClock::Mode clock_mode;
+ Width width;
#define REGISTER(e) enum_writer.register_distinct (typeid(e).name(), i, s); i.clear(); s.clear()
#define REGISTER_BITS(e) enum_writer.register_bits (typeid(e).name(), i, s); i.clear(); s.clear()
@@ -45,4 +47,8 @@ setup_gtk_ardour_enums ()
REGISTER_CLASS_ENUM (AudioClock, Frames);
REGISTER_CLASS_ENUM (AudioClock, Off);
REGISTER (clock_mode);
+
+ REGISTER_ENUM (Wide);
+ REGISTER_ENUM (Narrow);
+ REGISTER (width);
}
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index bef8ee787f..1a21464bf5 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -22,6 +22,7 @@
#include <sigc++/bind.h>
#include <pbd/convert.h>
+#include <pbd/enumwriter.h>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/utils.h>
@@ -111,6 +112,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr<Route> rt
ignore_speed_adjustment = false;
comment_window = 0;
comment_area = 0;
+ _width_owner = 0;
width_button.add (*(manage (new Gtk::Image (::get_icon("strip_width")))));
hide_button.add (*(manage (new Gtk::Image (::get_icon("hide")))));
@@ -174,7 +176,7 @@ MixerStrip::MixerStrip (Mixer_UI& mx, Session& sess, boost::shared_ptr<Route> rt
bottom_button_table.set_col_spacings (0);
bottom_button_table.set_homogeneous (true);
bottom_button_table.attach (group_button, 0, 1, 0, 1);
-
+
if (is_audio_track()) {
rec_enable_button->signal_button_press_event().connect (mem_fun(*this, &RouteUI::rec_enable_press), false);
@@ -366,22 +368,13 @@ void
MixerStrip::set_stuff_from_route ()
{
XMLProperty *prop;
-
+
ensure_xml_node ();
+ /* if width is not set, it will be set by the MixerUI or editor */
+
if ((prop = xml_node->property ("strip_width")) != 0) {
- if (prop->value() == "wide") {
- set_width (Wide);
- } else if (prop->value() == "narrow") {
- set_width (Narrow);
- }
- else {
- error << string_compose(_("unknown strip width \"%1\" in XML GUI information"), prop->value()) << endmsg;
- set_width (Wide);
- }
- }
- else {
- set_width (Wide);
+ set_width (Width (string_2_enum (prop->value(), _width)), this);
}
if ((prop = xml_node->property ("shown_mixer")) != 0) {
@@ -397,14 +390,17 @@ MixerStrip::set_stuff_from_route ()
}
void
-MixerStrip::set_width (Width w)
+MixerStrip::set_width (Width w, void* owner)
{
/* always set the gpm width again, things may be hidden */
+
gpm.set_width (w);
panners.set_width (w);
pre_redirect_box.set_width (w);
post_redirect_box.set_width (w);
-
+
+ _width_owner = owner;
+
if (_width == w) {
return;
}
@@ -412,11 +408,14 @@ MixerStrip::set_width (Width w)
ensure_xml_node ();
_width = w;
-
+
+ if (_width_owner == this) {
+ xml_node->add_property ("strip_width", enum_2_string (_width));
+ }
+
switch (w) {
case Wide:
set_size_request (-1, -1);
- xml_node->add_property ("strip_width", "wide");
if (rec_enable_button) {
((Gtk::Label*)rec_enable_button->get_child())->set_text (_("record"));
@@ -440,8 +439,6 @@ MixerStrip::set_width (Width w)
break;
case Narrow:
- xml_node->add_property ("strip_width", "narrow");
-
if (rec_enable_button) {
((Gtk::Label*)rec_enable_button->get_child())->set_text (_("Rec"));
}
@@ -562,7 +559,7 @@ MixerStrip::input_press (GdkEventButton *ev)
msg.run ();
return true;
}
-
+
switch (ev->button) {
case 1:
@@ -691,7 +688,7 @@ void
MixerStrip::connect_to_pan ()
{
ENSURE_GUI_THREAD(mem_fun(*this, &MixerStrip::connect_to_pan));
-
+
panstate_connection.disconnect ();
panstyle_connection.disconnect ();
@@ -772,7 +769,8 @@ MixerStrip::output_changed (IOChange change, void *src)
void
-MixerStrip::comment_editor_done_editing() {
+MixerStrip::comment_editor_done_editing()
+{
string str = comment_area->get_buffer()->get_text();
if (_route->comment() != str) {
_route->set_comment (str, this);
@@ -972,12 +970,11 @@ void
MixerStrip::build_route_ops_menu ()
{
using namespace Menu_Helpers;
-
route_ops_menu = manage (new Menu);
route_ops_menu->set_name ("ArdourContextMenu");
MenuList& items = route_ops_menu->items();
-
+
items.push_back (MenuElem (_("Rename"), mem_fun(*this, &RouteUI::route_rename)));
items.push_back (SeparatorElem());
items.push_back (CheckMenuElem (_("Active"), mem_fun (*this, &RouteUI::toggle_route_active)));
@@ -1002,6 +999,11 @@ MixerStrip::name_button_button_press (GdkEventButton* ev)
{
if (ev->button == 1) {
list_route_operations ();
+
+ Menu_Helpers::MenuList& items = route_ops_menu->items();
+ /* do not allow rename if the track is record-enabled */
+ static_cast<MenuItem*> (&items.front())->set_sensitive (!_route->record_enabled());
+
route_ops_menu->popup (1, ev->time);
}
return FALSE;
@@ -1089,10 +1091,10 @@ MixerStrip::width_clicked ()
{
switch (_width) {
case Wide:
- set_width (Narrow);
+ set_width (Narrow, this);
break;
case Narrow:
- set_width (Wide);
+ set_width (Wide, this);
break;
}
}
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index ea2569b644..7e92f83579 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -85,12 +85,13 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
MixerStrip (Mixer_UI&, ARDOUR::Session&, boost::shared_ptr<ARDOUR::Route>, bool in_mixer = true);
~MixerStrip ();
- void set_width (Width);
+ void set_width (Width, void* owner);
Width get_width() const { return _width; }
+ void* width_owner() const { return _width_owner; }
void fast_update ();
void set_embedded (bool);
-
+
ARDOUR::RouteGroup* mix_group() const;
protected:
@@ -107,6 +108,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
bool _embedded;
bool _packed;
Width _width;
+ void* _width_owner;
Gtk::Button hide_button;
Gtk::Button width_button;
diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc
index cbd9cfe083..766db2938f 100644
--- a/gtk2_ardour/mixer_ui.cc
+++ b/gtk2_ardour/mixer_ui.cc
@@ -244,7 +244,7 @@ Mixer_UI::show_window ()
for (ri = rows.begin(); ri != rows.end(); ++ri) {
ms = (*ri)[track_columns.strip];
- ms->set_width (ms->get_width());
+ ms->set_width (ms->get_width(), ms->width_owner());
}
_visible = true;
}
@@ -274,7 +274,10 @@ Mixer_UI::add_strip (Session::RouteList& routes)
strip = new MixerStrip (*this, *session, route);
strips.push_back (strip);
- strip->set_width (_strip_width);
+ if (strip->width_owner() != strip) {
+ strip->set_width (_strip_width, this);
+ }
+
show_strip (strip);
no_track_list_redisplay = true;
@@ -1040,7 +1043,7 @@ Mixer_UI::set_strip_width (Width w)
_strip_width = w;
for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
- (*i)->set_width (w);
+ (*i)->set_width (w, this);
}
}
diff --git a/gtk2_ardour/new_session_dialog.cc b/gtk2_ardour/new_session_dialog.cc
index 74ff9d022c..13d8123836 100644
--- a/gtk2_ardour/new_session_dialog.cc
+++ b/gtk2_ardour/new_session_dialog.cc
@@ -575,7 +575,12 @@ int
NewSessionDialog::get_current_page()
{
return m_notebook->get_current_page();
-
+}
+
+void
+NewSessionDialog::set_current_page(int page)
+{
+ return m_notebook->set_current_page (page);
}
void
diff --git a/gtk2_ardour/new_session_dialog.h b/gtk2_ardour/new_session_dialog.h
index 0d4124f8cc..c22af7561c 100644
--- a/gtk2_ardour/new_session_dialog.h
+++ b/gtk2_ardour/new_session_dialog.h
@@ -82,6 +82,7 @@ public:
bool connect_outs_to_master() const;
bool connect_outs_to_physical() const ;
int get_current_page();
+ void set_current_page (int);
void reset_recent();
// reset everything to default values.
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index b2f9ebf13f..d6ad6af599 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -1776,3 +1776,10 @@ RouteTimeAxisView::reset_redirect_automation_curves ()
}
}
+void
+RouteTimeAxisView::update_rec_display ()
+{
+ RouteUI::update_rec_display ();
+ name_entry.set_sensitive (!_route->record_enabled());
+}
+
diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h
index a72bc5a2cf..cf522df789 100644
--- a/gtk2_ardour/route_time_axis.h
+++ b/gtk2_ardour/route_time_axis.h
@@ -159,6 +159,8 @@ protected:
void route_name_changed (void *);
void name_entry_changed ();
+ void update_rec_display ();
+
virtual void label_view ();
void add_edit_group_menu_item (ARDOUR::RouteGroup *, Gtk::RadioMenuItem::Group*);
diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h
index f7749b0b4b..20cd6f1f28 100644
--- a/gtk2_ardour/route_ui.h
+++ b/gtk2_ardour/route_ui.h
@@ -148,7 +148,7 @@ class RouteUI : public virtual AxisView
void disconnect_input ();
void disconnect_output ();
- void update_rec_display ();
+ virtual void update_rec_display ();
void update_mute_display ();
bool was_solo_safe;
diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc
index 365cfea0d1..d6f2edeba9 100644
--- a/gtk2_ardour/streamview.cc
+++ b/gtk2_ardour/streamview.cc
@@ -112,16 +112,16 @@ StreamView::set_height (gdouble h)
return -1;
}
+ if (canvas_rect->property_y2() == h) {
+ return 0;
+ }
+
canvas_rect->property_y2() = h;
for (RegionViewList::iterator i = region_views.begin(); i != region_views.end(); ++i) {
(*i)->set_height (h);
}
- /*for (CrossfadeViewList::iterator i = crossfade_views.begin(); i != crossfade_views.end(); ++i) {
- (*i)->set_height (h);
- }*/
-
for (vector<RecBoxInfo>::iterator i = rec_rects.begin(); i != rec_rects.end(); ++i) {
RecBoxInfo &recbox = (*i);
recbox.rectangle->property_y2() = h - 1.0;
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index 37daaf9ecc..7830e8f437 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -18,6 +18,7 @@
*/
#include <pbd/error.h>
+#include <pbd/stacktrace.h>
#include <ardour/types.h>
#include <ardour/ardour.h>
@@ -571,7 +572,7 @@ TimeAxisViewItem::set_name_text(const ustring& new_name)
* @param h the new height
*/
void
-TimeAxisViewItem::set_height(double height)
+TimeAxisViewItem::set_height (double height)
{
if (name_highlight) {
if (height < NAME_HIGHLIGHT_THRESH) {
@@ -975,8 +976,7 @@ TimeAxisViewItem::reset_name_width (double pixel_width)
}
if (n == 0) {
- /* nothing will fit */
- name_text->hide ();
+ name_text->property_text() = "";
last_name_text_width = pixel_width;
return;
}