mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 04:06:26 +01:00
fix track controls height allocation to be font sensitive; fix core dump related to ownership of size menu; add nudge to keybindings; and more
git-svn-id: svn://localhost/trunk/ardour2@275 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
67467c92e1
commit
fe49c8de18
12 changed files with 283 additions and 106 deletions
|
|
@ -17,6 +17,14 @@
|
||||||
(gtk_accel_path "<Actions>/Editor/set-playhead" "p")
|
(gtk_accel_path "<Actions>/Editor/set-playhead" "p")
|
||||||
(gtk_accel_path "<Actions>/Transport/Record" "<shift>r")
|
(gtk_accel_path "<Actions>/Transport/Record" "<shift>r")
|
||||||
|
|
||||||
|
(gtk_accel_path "<Actions>/Editor/nudge-forward" "KP_Add")
|
||||||
|
(gtk_accel_path "<Actions>/Editor/nudge-next-forward" "<control>KP_Add")
|
||||||
|
(gtk_accel_path "<Actions>/Editor/nudge-backward" "KP_Subtract")
|
||||||
|
(gtk_accel_path "<Actions>/Editor/nudge-next-backward" "<control>KP_Subtract")
|
||||||
|
|
||||||
|
(gtk-accel_path "<Actions>/Common/GotoEditor" "<Alt>e")
|
||||||
|
(gtk-accel_path "<Actions>/Common/GotoMixer" "<Alt>m")
|
||||||
|
|
||||||
(gtk_accel_path "<Actions>/Editor/editor-copy" "<Control>c")
|
(gtk_accel_path "<Actions>/Editor/editor-copy" "<Control>c")
|
||||||
(gtk_accel_path "<Actions>/Common/Quit" "<Control>q")
|
(gtk_accel_path "<Actions>/Common/Quit" "<Control>q")
|
||||||
(gtk_accel_path "<Actions>/Editor/redo" "<Control>r")
|
(gtk_accel_path "<Actions>/Editor/redo" "<Control>r")
|
||||||
|
|
@ -25,7 +33,6 @@
|
||||||
(gtk_accel_path "<Actions>/Editor/editor-cut" "<Control>x")
|
(gtk_accel_path "<Actions>/Editor/editor-cut" "<Control>x")
|
||||||
(gtk_accel_path "<Actions>/Editor/undo" "<Control>z")
|
(gtk_accel_path "<Actions>/Editor/undo" "<Control>z")
|
||||||
|
|
||||||
|
|
||||||
(gtk_accel_path "<Actions>/Editor/scroll-tracks-down" "Page_Down")
|
(gtk_accel_path "<Actions>/Editor/scroll-tracks-down" "Page_Down")
|
||||||
(gtk_accel_path "<Actions>/Editor/scroll-tracks-up" "Page_Up")
|
(gtk_accel_path "<Actions>/Editor/scroll-tracks-up" "Page_Up")
|
||||||
(gtk_accel_path "<Actions>/Editor/step-tracks-down" "Down")
|
(gtk_accel_path "<Actions>/Editor/step-tracks-down" "Down")
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,11 @@
|
||||||
<menuitem action='duplicate-region'/>
|
<menuitem action='duplicate-region'/>
|
||||||
<menuitem action='insert-region'/>
|
<menuitem action='insert-region'/>
|
||||||
<menuitem action='normalize-region'/>
|
<menuitem action='normalize-region'/>
|
||||||
|
<separator/>
|
||||||
|
<menuitem action="nudge-forward"/>
|
||||||
|
<menuitem action="nudge-next-forward"/>
|
||||||
|
<menuitem action="nudge-backward"/>
|
||||||
|
<menuitem action="nudge-next-backward"/>
|
||||||
</menu>
|
</menu>
|
||||||
<menu name='View' action = 'View'>
|
<menu name='View' action = 'View'>
|
||||||
<menu name='ZoomFocus' action='ZoomFocus'>
|
<menu name='ZoomFocus' action='ZoomFocus'>
|
||||||
|
|
|
||||||
|
|
@ -126,10 +126,9 @@ style "black_mackie_menu_bar" = "medium_bold_text"
|
||||||
bg[NORMAL] = { 0, 0, 0 }
|
bg[NORMAL] = { 0, 0, 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
style "default_buttons_menus" = "default_base"
|
style "default_buttons_menus" = "small_button"
|
||||||
{
|
{
|
||||||
font_name = "sans 8"
|
font_name = "sans 8"
|
||||||
|
|
||||||
fg[ACTIVE] = { 0, 0, 0 }
|
fg[ACTIVE] = { 0, 0, 0 }
|
||||||
|
|
||||||
bg[NORMAL] = { 0.35, 0.35, 0.35 }
|
bg[NORMAL] = { 0.35, 0.35, 0.35 }
|
||||||
|
|
@ -146,7 +145,6 @@ style "very_small_button" = "default_buttons_menus"
|
||||||
|
|
||||||
style "small_button" = "default_buttons_menus"
|
style "small_button" = "default_buttons_menus"
|
||||||
{
|
{
|
||||||
font_name = "sans 8"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
style "very_small_red_active_and_selected_button" = "very_small_button"
|
style "very_small_red_active_and_selected_button" = "very_small_button"
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,6 @@
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
//using namespace sigc;
|
|
||||||
using namespace LADSPA;
|
using namespace LADSPA;
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
using namespace Editing;
|
using namespace Editing;
|
||||||
|
|
@ -587,7 +586,7 @@ AudioTimeAxisView::set_state (const XMLNode& node)
|
||||||
void
|
void
|
||||||
AudioTimeAxisView::set_height (TrackHeight h)
|
AudioTimeAxisView::set_height (TrackHeight h)
|
||||||
{
|
{
|
||||||
bool height_changed = (h != (TrackHeight)height);
|
bool height_changed = (h != height_style);
|
||||||
|
|
||||||
TimeAxisView::set_height (h);
|
TimeAxisView::set_height (h);
|
||||||
|
|
||||||
|
|
@ -595,31 +594,36 @@ AudioTimeAxisView::set_height (TrackHeight h)
|
||||||
|
|
||||||
view->set_height ((double) height);
|
view->set_height ((double) height);
|
||||||
|
|
||||||
switch (height) {
|
switch (height_style) {
|
||||||
case Largest:
|
case Largest:
|
||||||
xml_node->add_property ("track_height", "largest");
|
xml_node->add_property ("track_height", "largest");
|
||||||
|
show_name_entry ();
|
||||||
|
hide_name_label ();
|
||||||
controls_table.show_all();
|
controls_table.show_all();
|
||||||
name_label.hide ();
|
|
||||||
break;
|
break;
|
||||||
case Large:
|
case Large:
|
||||||
xml_node->add_property ("track_height", "large");
|
xml_node->add_property ("track_height", "large");
|
||||||
|
show_name_entry ();
|
||||||
|
hide_name_label ();
|
||||||
controls_table.show_all();
|
controls_table.show_all();
|
||||||
name_label.hide ();
|
|
||||||
break;
|
break;
|
||||||
case Larger:
|
case Larger:
|
||||||
xml_node->add_property ("track_height", "larger");
|
xml_node->add_property ("track_height", "larger");
|
||||||
|
show_name_entry ();
|
||||||
|
hide_name_label ();
|
||||||
controls_table.show_all();
|
controls_table.show_all();
|
||||||
name_label.hide ();
|
|
||||||
break;
|
break;
|
||||||
case Normal:
|
case Normal:
|
||||||
xml_node->add_property ("track_height", "normal");
|
xml_node->add_property ("track_height", "normal");
|
||||||
|
show_name_entry ();
|
||||||
|
hide_name_label ();
|
||||||
controls_table.show_all();
|
controls_table.show_all();
|
||||||
name_label.hide ();
|
|
||||||
break;
|
break;
|
||||||
case Smaller:
|
case Smaller:
|
||||||
xml_node->add_property ("track_height", "smaller");
|
xml_node->add_property ("track_height", "smaller");
|
||||||
controls_table.show_all ();
|
controls_table.show_all ();
|
||||||
name_label.hide ();
|
show_name_entry ();
|
||||||
|
hide_name_label ();
|
||||||
edit_group_button.hide ();
|
edit_group_button.hide ();
|
||||||
hide_button.hide ();
|
hide_button.hide ();
|
||||||
visual_button.hide ();
|
visual_button.hide ();
|
||||||
|
|
@ -631,9 +635,9 @@ AudioTimeAxisView::set_height (TrackHeight h)
|
||||||
xml_node->add_property ("track_height", "small");
|
xml_node->add_property ("track_height", "small");
|
||||||
controls_table.hide_all ();
|
controls_table.hide_all ();
|
||||||
controls_table.show ();
|
controls_table.show ();
|
||||||
|
hide_name_entry ();
|
||||||
|
show_name_label ();
|
||||||
name_label.set_text (_route.name());
|
name_label.set_text (_route.name());
|
||||||
name_label.show ();
|
|
||||||
name_hbox.show ();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, Route& r, PublicEdit
|
||||||
life easier and remove them.
|
life easier and remove them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
name_hbox.remove (name_entry);
|
hide_name_entry();
|
||||||
|
|
||||||
/* move the name label over a bit */
|
/* move the name label over a bit */
|
||||||
|
|
||||||
|
|
@ -326,7 +326,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
|
||||||
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||||
}
|
}
|
||||||
controls_table.show_all ();
|
controls_table.show_all ();
|
||||||
name_label.show ();
|
hide_name_entry ();
|
||||||
|
show_name_label ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Large:
|
case Large:
|
||||||
|
|
@ -343,7 +344,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
|
||||||
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||||
}
|
}
|
||||||
controls_table.show_all ();
|
controls_table.show_all ();
|
||||||
name_label.show ();
|
hide_name_entry ();
|
||||||
|
show_name_label ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Larger:
|
case Larger:
|
||||||
|
|
@ -360,7 +362,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
|
||||||
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||||
}
|
}
|
||||||
controls_table.show_all ();
|
controls_table.show_all ();
|
||||||
name_label.show ();
|
hide_name_entry ();
|
||||||
|
show_name_label ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Normal:
|
case Normal:
|
||||||
|
|
@ -378,7 +381,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
|
||||||
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||||
}
|
}
|
||||||
controls_table.show_all ();
|
controls_table.show_all ();
|
||||||
name_label.show ();
|
hide_name_entry ();
|
||||||
|
show_name_label ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Smaller:
|
case Smaller:
|
||||||
|
|
@ -392,6 +396,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
|
||||||
}
|
}
|
||||||
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||||
controls_table.hide_all ();
|
controls_table.hide_all ();
|
||||||
|
hide_name_entry ();
|
||||||
|
show_name_label ();
|
||||||
name_hbox.show_all ();
|
name_hbox.show_all ();
|
||||||
controls_table.show ();
|
controls_table.show ();
|
||||||
break;
|
break;
|
||||||
|
|
@ -407,6 +413,8 @@ AutomationTimeAxisView::set_height (TrackHeight h)
|
||||||
}
|
}
|
||||||
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
controls_table.attach (name_hbox, 1, 6, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||||
controls_table.hide_all ();
|
controls_table.hide_all ();
|
||||||
|
hide_name_entry ();
|
||||||
|
show_name_label ();
|
||||||
name_hbox.show_all ();
|
name_hbox.show_all ();
|
||||||
controls_table.show ();
|
controls_table.show ();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,9 @@ main (int argc, char *argv[])
|
||||||
return curvetest (curvetest_file);
|
return curvetest (curvetest_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!use_gtk_theme) {
|
||||||
|
|
||||||
/* desktop standard themes: just say no! */
|
/* desktop standard themes: just say no! */
|
||||||
|
|
||||||
if (getenv("GTK_RC_FILES")) {
|
if (getenv("GTK_RC_FILES")) {
|
||||||
|
|
@ -328,6 +331,7 @@ main (int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
RC::set_default_files (null_file_list);
|
RC::set_default_files (null_file_list);
|
||||||
|
}
|
||||||
|
|
||||||
cout << _("Ardour/GTK ")
|
cout << _("Ardour/GTK ")
|
||||||
<< VERSIONSTRING
|
<< VERSIONSTRING
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ bool GTK_ARDOUR::use_vst = true;
|
||||||
bool GTK_ARDOUR::new_session = false;
|
bool GTK_ARDOUR::new_session = false;
|
||||||
char* GTK_ARDOUR::curvetest_file = 0;
|
char* GTK_ARDOUR::curvetest_file = 0;
|
||||||
bool GTK_ARDOUR::try_hw_optimization = false;
|
bool GTK_ARDOUR::try_hw_optimization = false;
|
||||||
|
bool GTK_ARDOUR::use_gtk_theme = false;
|
||||||
|
|
||||||
using namespace GTK_ARDOUR;
|
using namespace GTK_ARDOUR;
|
||||||
|
|
||||||
|
|
@ -56,6 +57,7 @@ print_help (const char *execname)
|
||||||
#endif
|
#endif
|
||||||
<< _(" [session-name] Name of session to load\n")
|
<< _(" [session-name] Name of session to load\n")
|
||||||
<< _(" -C, --curvetest filename Curve algorithm debugger\n")
|
<< _(" -C, --curvetest filename Curve algorithm debugger\n")
|
||||||
|
<< _(" -g, --gtktheme Allow GTK to load a theme\n")
|
||||||
;
|
;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
|
@ -65,7 +67,7 @@ int
|
||||||
GTK_ARDOUR::parse_opts (int argc, char *argv[])
|
GTK_ARDOUR::parse_opts (int argc, char *argv[])
|
||||||
|
|
||||||
{
|
{
|
||||||
const char *optstring = "U:hbvVnoc:C:N:";
|
const char *optstring = "U:hbvVnoc:C:N:g";
|
||||||
const char *execname = strrchr (argv[0], '/');
|
const char *execname = strrchr (argv[0], '/');
|
||||||
|
|
||||||
if (execname == 0) {
|
if (execname == 0) {
|
||||||
|
|
@ -84,6 +86,7 @@ GTK_ARDOUR::parse_opts (int argc, char *argv[])
|
||||||
{ "new", 1, 0, 'N' },
|
{ "new", 1, 0, 'N' },
|
||||||
{ "use-hw-optimizations", 0, 0, 'o' },
|
{ "use-hw-optimizations", 0, 0, 'o' },
|
||||||
{ "curvetest", 1, 0, 'C' },
|
{ "curvetest", 1, 0, 'C' },
|
||||||
|
{ "gtktheme", 0, 0, 'g' },
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -113,6 +116,10 @@ GTK_ARDOUR::parse_opts (int argc, char *argv[])
|
||||||
show_key_actions = true;
|
show_key_actions = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'g':
|
||||||
|
use_gtk_theme = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
no_splash = false;
|
no_splash = false;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ extern bool use_vst;
|
||||||
extern bool new_session;
|
extern bool new_session;
|
||||||
extern char* curvetest_file;
|
extern char* curvetest_file;
|
||||||
extern bool try_hw_optimization;
|
extern bool try_hw_optimization;
|
||||||
|
extern bool use_gtk_theme;
|
||||||
|
|
||||||
extern int32_t parse_opts (int argc, char *argv[]);
|
extern int32_t parse_opts (int argc, char *argv[]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,8 +111,6 @@ class PluginUI : public PlugUIBase, public Gtk::VBox
|
||||||
Gtk::Viewport scroller_view;
|
Gtk::Viewport scroller_view;
|
||||||
Gtk::Menu* automation_menu;
|
Gtk::Menu* automation_menu;
|
||||||
|
|
||||||
bool setting_name_status;
|
|
||||||
|
|
||||||
gint prefheight;
|
gint prefheight;
|
||||||
bool is_scrollable;
|
bool is_scrollable;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,11 +60,24 @@ using namespace ArdourCanvas;
|
||||||
|
|
||||||
const double trim_handle_size = 6.0; /* pixels */
|
const double trim_handle_size = 6.0; /* pixels */
|
||||||
|
|
||||||
|
uint32_t TimeAxisView::hLargest = 0;
|
||||||
|
uint32_t TimeAxisView::hLarge = 0;
|
||||||
|
uint32_t TimeAxisView::hLarger = 0;
|
||||||
|
uint32_t TimeAxisView::hNormal = 0;
|
||||||
|
uint32_t TimeAxisView::hSmaller = 0;
|
||||||
|
uint32_t TimeAxisView::hSmall = 0;
|
||||||
|
bool TimeAxisView::need_size_info = true;
|
||||||
|
|
||||||
TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* rent, Canvas& canvas)
|
TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* rent, Canvas& canvas)
|
||||||
: AxisView (sess),
|
: AxisView (sess),
|
||||||
editor (ed),
|
editor (ed),
|
||||||
controls_table (2, 9)
|
controls_table (2, 9)
|
||||||
{
|
{
|
||||||
|
if (need_size_info) {
|
||||||
|
compute_controls_size_info ();
|
||||||
|
need_size_info = false;
|
||||||
|
}
|
||||||
|
|
||||||
canvas_display = new Group (*canvas.root(), 0.0, 0.0);
|
canvas_display = new Group (*canvas.root(), 0.0, 0.0);
|
||||||
|
|
||||||
selection_group = new Group (*canvas_display);
|
selection_group = new Group (*canvas_display);
|
||||||
|
|
@ -80,6 +93,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
|
||||||
parent = rent;
|
parent = rent;
|
||||||
_has_state = false;
|
_has_state = false;
|
||||||
last_name_entry_key_press_event = 0;
|
last_name_entry_key_press_event = 0;
|
||||||
|
name_packing = NamePackingBits (0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Create the standard LHS Controls
|
Create the standard LHS Controls
|
||||||
|
|
@ -99,27 +113,20 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
|
||||||
name_label.set_name ("TrackLabel");
|
name_label.set_name ("TrackLabel");
|
||||||
name_label.set_alignment (0.0, 0.5);
|
name_label.set_alignment (0.0, 0.5);
|
||||||
|
|
||||||
// name_hbox.set_border_width (2);
|
|
||||||
// name_hbox.set_spacing (5);
|
|
||||||
|
|
||||||
/* typically, either name_label OR name_entry are visible,
|
/* typically, either name_label OR name_entry are visible,
|
||||||
but not both. its up to derived classes to show/hide them as they
|
but not both. its up to derived classes to show/hide them as they
|
||||||
wish.
|
wish.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
name_hbox.pack_start (name_label, true, true);
|
|
||||||
name_hbox.pack_start (name_entry, true, true);
|
|
||||||
name_hbox.show ();
|
name_hbox.show ();
|
||||||
|
|
||||||
controls_table.set_border_width (2);
|
controls_table.set_border_width (2);
|
||||||
controls_table.set_row_spacings (0);
|
controls_table.set_row_spacings (0);
|
||||||
controls_table.set_col_spacings (0);
|
controls_table.set_col_spacings (0);
|
||||||
controls_table.set_homogeneous (true);
|
controls_table.set_homogeneous (true);
|
||||||
controls_table.show ();
|
|
||||||
|
|
||||||
controls_table.attach (name_hbox, 0, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
controls_table.attach (name_hbox, 0, 5, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
|
||||||
|
controls_table.show_all ();
|
||||||
controls_table.show ();
|
|
||||||
|
|
||||||
controls_vbox.pack_start (controls_table, false, false);
|
controls_vbox.pack_start (controls_table, false, false);
|
||||||
controls_vbox.show ();
|
controls_vbox.show ();
|
||||||
|
|
@ -140,7 +147,6 @@ TimeAxisView::TimeAxisView (ARDOUR::Session& sess, PublicEditor& ed, TimeAxisVie
|
||||||
controls_frame.add (controls_hbox);
|
controls_frame.add (controls_hbox);
|
||||||
controls_frame.set_name ("TimeAxisViewControlsBaseUnselected");
|
controls_frame.set_name ("TimeAxisViewControlsBaseUnselected");
|
||||||
controls_frame.set_shadow_type (Gtk::SHADOW_OUT);
|
controls_frame.set_shadow_type (Gtk::SHADOW_OUT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeAxisView::~TimeAxisView()
|
TimeAxisView::~TimeAxisView()
|
||||||
|
|
@ -176,11 +182,6 @@ TimeAxisView::~TimeAxisView()
|
||||||
delete display_menu;
|
delete display_menu;
|
||||||
display_menu = 0;
|
display_menu = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size_menu) {
|
|
||||||
delete size_menu;
|
|
||||||
size_menu = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
guint32
|
guint32
|
||||||
|
|
@ -354,7 +355,14 @@ TimeAxisView::step_height (bool bigger)
|
||||||
void
|
void
|
||||||
TimeAxisView::set_height (TrackHeight h)
|
TimeAxisView::set_height (TrackHeight h)
|
||||||
{
|
{
|
||||||
height = (gint32) h;
|
height_style = h;
|
||||||
|
set_height_pixels (height_to_pixels (h));
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TimeAxisView::set_height_pixels (uint32_t h)
|
||||||
|
{
|
||||||
|
height = h;
|
||||||
controls_frame.set_size_request (-1, height);
|
controls_frame.set_size_request (-1, height);
|
||||||
|
|
||||||
if (canvas_item_visible (selection_group)) {
|
if (canvas_item_visible (selection_group)) {
|
||||||
|
|
@ -861,14 +869,135 @@ TimeAxisView::set_state (const XMLNode& node)
|
||||||
void
|
void
|
||||||
TimeAxisView::reset_height()
|
TimeAxisView::reset_height()
|
||||||
{
|
{
|
||||||
set_height ((TrackHeight) height);
|
set_height_pixels (height);
|
||||||
|
|
||||||
for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
|
for (vector<TimeAxisView*>::iterator i = children.begin(); i != children.end(); ++i) {
|
||||||
(*i)->set_height ((TrackHeight)(*i)->height);
|
(*i)->set_height ((TrackHeight)(*i)->height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
uint32_t
|
||||||
TimeAxisView::check_height (Gdk::Rectangle& r)
|
TimeAxisView::height_to_pixels (TrackHeight h)
|
||||||
{
|
{
|
||||||
|
switch (h) {
|
||||||
|
case Largest:
|
||||||
|
return hLargest;
|
||||||
|
case Large:
|
||||||
|
return hLarge;
|
||||||
|
case Larger:
|
||||||
|
return hLarger;
|
||||||
|
case Normal:
|
||||||
|
return hNormal;
|
||||||
|
case Smaller:
|
||||||
|
return hSmaller;
|
||||||
|
case Small:
|
||||||
|
return hSmall;
|
||||||
|
}
|
||||||
|
|
||||||
|
// what is wrong with gcc ?
|
||||||
|
|
||||||
|
return hNormal;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TimeAxisView::compute_controls_size_info ()
|
||||||
|
{
|
||||||
|
Gtk::Window window (Gtk::WINDOW_TOPLEVEL);
|
||||||
|
Gtk::Table two_row_table (2, 9);
|
||||||
|
Gtk::Table one_row_table (1, 9);
|
||||||
|
Button* buttons[5];
|
||||||
|
|
||||||
|
window.add (one_row_table);
|
||||||
|
|
||||||
|
one_row_table.set_border_width (2);
|
||||||
|
one_row_table.set_row_spacings (0);
|
||||||
|
one_row_table.set_col_spacings (0);
|
||||||
|
one_row_table.set_homogeneous (true);
|
||||||
|
|
||||||
|
two_row_table.set_border_width (2);
|
||||||
|
two_row_table.set_row_spacings (0);
|
||||||
|
two_row_table.set_col_spacings (0);
|
||||||
|
two_row_table.set_homogeneous (true);
|
||||||
|
|
||||||
|
for (int i = 0; i < 5; ++i) {
|
||||||
|
buttons[i] = manage (new Button (X_("f")));
|
||||||
|
buttons[i]->set_name ("TrackMuteButton");
|
||||||
|
}
|
||||||
|
|
||||||
|
Gtk::Requisition req;
|
||||||
|
|
||||||
|
one_row_table.attach (*buttons[0], 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
|
||||||
|
|
||||||
|
one_row_table.show_all ();
|
||||||
|
one_row_table.size_request (req);
|
||||||
|
|
||||||
|
// height required to show 1 row of buttons
|
||||||
|
|
||||||
|
hSmaller = req.height + 3;
|
||||||
|
|
||||||
|
window.remove ();
|
||||||
|
window.add (two_row_table);
|
||||||
|
|
||||||
|
two_row_table.attach (*buttons[1], 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
|
||||||
|
two_row_table.attach (*buttons[2], 7, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
|
||||||
|
two_row_table.attach (*buttons[3], 8, 9, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
|
||||||
|
two_row_table.attach (*buttons[4], 6, 7, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 0, 0);
|
||||||
|
|
||||||
|
two_row_table.show_all ();
|
||||||
|
two_row_table.size_request (req);
|
||||||
|
|
||||||
|
// height required to show all normal buttons
|
||||||
|
|
||||||
|
hNormal = req.height + 3;
|
||||||
|
|
||||||
|
// these heights are all just larger than normal. no more
|
||||||
|
// elements are visible (yet).
|
||||||
|
|
||||||
|
hLarger = hNormal + 50;
|
||||||
|
hLarge = hNormal + 150;
|
||||||
|
hLargest = hNormal + 250;
|
||||||
|
|
||||||
|
// height required to show track name
|
||||||
|
|
||||||
|
hSmall = 27;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TimeAxisView::show_name_label ()
|
||||||
|
{
|
||||||
|
if (!(name_packing & NameLabelPacked)) {
|
||||||
|
name_hbox.pack_start (name_label, true, true);
|
||||||
|
name_packing = NamePackingBits (name_packing | NameLabelPacked);
|
||||||
|
name_hbox.show ();
|
||||||
|
name_label.show ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TimeAxisView::show_name_entry ()
|
||||||
|
{
|
||||||
|
if (!(name_packing & NameEntryPacked)) {
|
||||||
|
name_hbox.pack_start (name_entry, true, true);
|
||||||
|
name_packing = NamePackingBits (name_packing | NameEntryPacked);
|
||||||
|
name_hbox.show ();
|
||||||
|
name_entry.show ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TimeAxisView::hide_name_label ()
|
||||||
|
{
|
||||||
|
if (name_packing & NameLabelPacked) {
|
||||||
|
name_hbox.remove (name_label);
|
||||||
|
name_packing = NamePackingBits (name_packing & ~NameLabelPacked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
TimeAxisView::hide_name_entry ()
|
||||||
|
{
|
||||||
|
if (name_packing & NameEntryPacked) {
|
||||||
|
name_hbox.remove (name_entry);
|
||||||
|
name_packing = NamePackingBits (name_packing & ~NameEntryPacked);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,20 +69,31 @@ class Selectable;
|
||||||
*/
|
*/
|
||||||
class TimeAxisView : public virtual AxisView
|
class TimeAxisView : public virtual AxisView
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
enum NamePackingBits {
|
||||||
|
NameLabelPacked = 0x1,
|
||||||
|
NameEntryPacked = 0x2
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum TrackHeight {
|
enum TrackHeight {
|
||||||
/* canvas units. they need to be odd
|
Largest,
|
||||||
valued so that there is a precise
|
Large,
|
||||||
middle.
|
Larger,
|
||||||
*/
|
Normal,
|
||||||
Largest = 307,
|
Smaller,
|
||||||
Large = 207,
|
Small
|
||||||
Larger = 107,
|
|
||||||
Normal = 57,
|
|
||||||
Smaller = 37,
|
|
||||||
Small = 27
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static uint32_t hLargest;
|
||||||
|
static uint32_t hLarge;
|
||||||
|
static uint32_t hLarger;
|
||||||
|
static uint32_t hNormal;
|
||||||
|
static uint32_t hSmaller;
|
||||||
|
static uint32_t hSmall;
|
||||||
|
|
||||||
|
static uint32_t height_to_pixels (TrackHeight);
|
||||||
|
|
||||||
TimeAxisView(ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* parent, ArdourCanvas::Canvas& canvas);
|
TimeAxisView(ARDOUR::Session& sess, PublicEditor& ed, TimeAxisView* parent, ArdourCanvas::Canvas& canvas);
|
||||||
virtual ~TimeAxisView ();
|
virtual ~TimeAxisView ();
|
||||||
|
|
||||||
|
|
@ -90,12 +101,12 @@ class TimeAxisView : public virtual AxisView
|
||||||
|
|
||||||
PublicEditor& editor;
|
PublicEditor& editor;
|
||||||
|
|
||||||
guint32 height; /* in canvas units */
|
TrackHeight height_style;
|
||||||
guint32 effective_height; /* in canvas units */
|
uint32_t height; /* in canvas units */
|
||||||
|
uint32_t effective_height; /* in canvas units */
|
||||||
double y_position;
|
double y_position;
|
||||||
int order;
|
int order;
|
||||||
|
|
||||||
|
|
||||||
ArdourCanvas::Group *canvas_display;
|
ArdourCanvas::Group *canvas_display;
|
||||||
Gtk::VBox *control_parent;
|
Gtk::VBox *control_parent;
|
||||||
|
|
||||||
|
|
@ -110,6 +121,11 @@ class TimeAxisView : public virtual AxisView
|
||||||
Gtk::Frame name_frame;
|
Gtk::Frame name_frame;
|
||||||
Gtk::Entry name_entry;
|
Gtk::Entry name_entry;
|
||||||
|
|
||||||
|
void hide_name_label ();
|
||||||
|
void hide_name_entry ();
|
||||||
|
void show_name_label ();
|
||||||
|
void show_name_entry ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display this TrackView as the nth component of the parent box, at y.
|
* Display this TrackView as the nth component of the parent box, at y.
|
||||||
*
|
*
|
||||||
|
|
@ -137,15 +153,11 @@ class TimeAxisView : public virtual AxisView
|
||||||
virtual void entered () {}
|
virtual void entered () {}
|
||||||
virtual void exited () {}
|
virtual void exited () {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the height of this TrackView to one of ths TrackHeghts
|
|
||||||
*
|
|
||||||
* @param h the TrackHeight value to set
|
|
||||||
*/
|
|
||||||
virtual void set_height (TrackHeight h);
|
virtual void set_height (TrackHeight h);
|
||||||
void reset_height();
|
void reset_height();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Steps through the defined TrackHeights for this TrackView.
|
* Steps through the defined heights for this TrackView.
|
||||||
* Sets bigger to true to step up in size, set to fals eot step smaller.
|
* Sets bigger to true to step up in size, set to fals eot step smaller.
|
||||||
*
|
*
|
||||||
* @param bigger true if stepping should increase in size, false otherwise
|
* @param bigger true if stepping should increase in size, false otherwise
|
||||||
|
|
@ -242,13 +254,13 @@ class TimeAxisView : public virtual AxisView
|
||||||
virtual bool handle_display_menu_map_event (GdkEventAny *ev) { return false; }
|
virtual bool handle_display_menu_map_event (GdkEventAny *ev) { return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build the standard LHS control size menu for the default TrackHeight options.
|
* Build the standard LHS control size menu for the default heights options.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
virtual void build_size_menu();
|
virtual void build_size_menu();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the standard LHS controls size menu for the TrackHeight.
|
* Displays the standard LHS controls size menu for the track heights
|
||||||
*
|
*
|
||||||
* @parem when the popup activation time
|
* @parem when the popup activation time
|
||||||
*/
|
*/
|
||||||
|
|
@ -293,8 +305,12 @@ class TimeAxisView : public virtual AxisView
|
||||||
|
|
||||||
bool _hidden;
|
bool _hidden;
|
||||||
bool _has_state;
|
bool _has_state;
|
||||||
|
NamePackingBits name_packing;
|
||||||
|
|
||||||
void check_height (Gdk::Rectangle&);
|
static void compute_controls_size_info ();
|
||||||
|
static bool need_size_info;
|
||||||
|
|
||||||
|
void set_height_pixels (uint32_t h);
|
||||||
|
|
||||||
}; /* class TimeAxisView */
|
}; /* class TimeAxisView */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,22 +177,22 @@ VisualTimeAxis::set_height(TrackHeight h)
|
||||||
case Larger:
|
case Larger:
|
||||||
case Normal:
|
case Normal:
|
||||||
{
|
{
|
||||||
name_label.hide() ;
|
hide_name_label ();
|
||||||
name_entry.show() ;
|
show_name_entry ();
|
||||||
other_button_hbox.show_all() ;
|
other_button_hbox.show_all() ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Smaller:
|
case Smaller:
|
||||||
{
|
{
|
||||||
name_label.hide() ;
|
hide_name_label ();
|
||||||
name_entry.show() ;
|
show_name_entry ();
|
||||||
other_button_hbox.hide_all() ;
|
other_button_hbox.hide_all() ;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Small:
|
case Small:
|
||||||
{
|
{
|
||||||
name_label.show() ;
|
hide_name_entry ();
|
||||||
name_entry.hide() ;
|
show_name_label ();
|
||||||
other_button_hbox.hide_all() ;
|
other_button_hbox.hide_all() ;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue