Merge branch 'master' into ardour-merge

Conflicts:
	gtk2_ardour/editor.cc
	gtk2_ardour/editor_mouse.cc
	gtk2_ardour/public_editor.h
	gtk2_ardour/time_axis_view_item.cc
	gtk2_ardour/time_axis_view_item.h
This commit is contained in:
Paul Davis 2014-08-28 10:58:49 -04:00
commit 9c24d10862
23 changed files with 214 additions and 593 deletions

View file

@ -208,8 +208,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
, big_clock_window (X_("big-clock"), _("Big Clock"), boost::bind (&ARDOUR_UI::create_big_clock_window, this)) , big_clock_window (X_("big-clock"), _("Big Clock"), boost::bind (&ARDOUR_UI::create_big_clock_window, this))
, audio_port_matrix (X_("audio-connection-manager"), _("Audio Connections"), boost::bind (&ARDOUR_UI::create_global_port_matrix, this, ARDOUR::DataType::AUDIO)) , audio_port_matrix (X_("audio-connection-manager"), _("Audio Connections"), boost::bind (&ARDOUR_UI::create_global_port_matrix, this, ARDOUR::DataType::AUDIO))
, midi_port_matrix (X_("midi-connection-manager"), _("MIDI Connections"), boost::bind (&ARDOUR_UI::create_global_port_matrix, this, ARDOUR::DataType::MIDI)) , midi_port_matrix (X_("midi-connection-manager"), _("MIDI Connections"), boost::bind (&ARDOUR_UI::create_global_port_matrix, this, ARDOUR::DataType::MIDI))
, error_log_button (_("Errors"))
, _status_bar_visibility (X_("status-bar"))
, _feedback_exists (false) , _feedback_exists (false)
, _dsp_load_adjustment (0) , _dsp_load_adjustment (0)
, _hd_load_adjustment (0) , _hd_load_adjustment (0)
@ -399,8 +397,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
_process_thread = new ProcessThread (); _process_thread = new ProcessThread ();
_process_thread->init (); _process_thread->init ();
DPIReset.connect (sigc::mem_fun (*this, &ARDOUR_UI::resize_text_widgets));
// start the engine: // start the engine:
// initialize engin state controller // initialize engin state controller
EngineStateController::instance(); EngineStateController::instance();
@ -447,8 +443,6 @@ ARDOUR_UI::engine_running ()
update_disk_space (); update_disk_space ();
update_disk_usage (); update_disk_usage ();
update_cpu_load (); update_cpu_load ();
update_sample_rate (EngineStateController::instance()->get_current_sample_rate() );
update_timecode_format ();
} }
void void
@ -467,8 +461,6 @@ ARDOUR_UI::engine_halted (const char* reason, bool free_reason)
ActionManager::set_sensitive (ActionManager::engine_sensitive_actions, false); ActionManager::set_sensitive (ActionManager::engine_sensitive_actions, false);
ActionManager::set_sensitive (ActionManager::engine_opposite_sensitive_actions, true); ActionManager::set_sensitive (ActionManager::engine_opposite_sensitive_actions, true);
update_sample_rate (0);
string msgstr; string msgstr;
/* if the reason is a non-empty string, it means that the backend was shutdown /* if the reason is a non-empty string, it means that the backend was shutdown
@ -506,7 +498,6 @@ ARDOUR_UI::post_engine ()
/* connect to important signals */ /* connect to important signals */
AudioEngine::instance()->Stopped.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::engine_stopped, this), gui_context()); AudioEngine::instance()->Stopped.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::engine_stopped, this), gui_context());
AudioEngine::instance()->SampleRateChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::update_sample_rate, this, _1), gui_context());
AudioEngine::instance()->Halted.connect_same_thread (halt_connection, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false)); AudioEngine::instance()->Halted.connect_same_thread (halt_connection, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false));
_tooltips.enable(); _tooltips.enable();
@ -515,12 +506,6 @@ ARDOUR_UI::post_engine ()
throw failed_constructor (); throw failed_constructor ();
} }
/* Do this after setup_windows (), as that's when the _status_bar_visibility is created */
XMLNode* n = Config->extra_xml (X_("UI"));
if (n) {
_status_bar_visibility.set_state (*n);
}
check_memory_locking(); check_memory_locking();
/* this is the first point at which all the keybindings are available */ /* this is the first point at which all the keybindings are available */
@ -563,14 +548,6 @@ ARDOUR_UI::post_engine ()
secondary_clock->set_mode (AudioClock::BBT); secondary_clock->set_mode (AudioClock::BBT);
} }
/* start the time-of-day-clock */
#ifndef GTKOSX
/* OS X provides a nearly-always visible wallclock, so don't be stupid */
update_wall_clock ();
Glib::signal_timeout().connect_seconds (sigc::mem_fun(*this, &ARDOUR_UI::update_wall_clock), 1);
#endif
Config->ParameterChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::parameter_changed, this, _1), gui_context()); Config->ParameterChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::parameter_changed, this, _1), gui_context());
boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1)); boost::function<void (string)> pc (boost::bind (&ARDOUR_UI::parameter_changed, this, _1));
Config->map_parameters (pc); Config->map_parameters (pc);
@ -892,7 +869,6 @@ ARDOUR_UI::starting ()
/* We have to do this here since goto_editor_window() ends up calling show_all() on the /* We have to do this here since goto_editor_window() ends up calling show_all() on the
* editor window, and we may want stuff to be hidden. * editor window, and we may want stuff to be hidden.
*/ */
_status_bar_visibility.update ();
BootMessage (string_compose (_("%1 is ready for use"), PROGRAM_NAME)); BootMessage (string_compose (_("%1 is ready for use"), PROGRAM_NAME));
return 0; return 0;
@ -1100,10 +1076,8 @@ gint
ARDOUR_UI::every_second () ARDOUR_UI::every_second ()
{ {
update_cpu_load (); update_cpu_load ();
update_buffer_load ();
update_disk_space (); update_disk_space ();
update_disk_usage (); update_disk_usage ();
update_timecode_format ();
if (nsm && nsm->is_active ()) { if (nsm && nsm->is_active ()) {
nsm->check (); nsm->check ();
@ -1146,142 +1120,17 @@ ARDOUR_UI::every_point_zero_something_seconds ()
return TRUE; return TRUE;
} }
void
ARDOUR_UI::update_sample_rate (framecnt_t)
{
char buf[64];
ENSURE_GUI_THREAD (*this, &ARDOUR_UI::update_sample_rate, ignored)
if (!AudioEngine::instance()->connected()) {
snprintf (buf, sizeof (buf), _("Audio: <span foreground=\"red\">none</span>"));
} else {
framecnt_t rate = EngineStateController::instance()->get_current_sample_rate();
if (rate == 0) {
/* no sample rate available */
snprintf (buf, sizeof (buf), _("Audio: <span foreground=\"red\">none</span>"));
} else {
if (fmod (rate, 1000.0) != 0.0) {
snprintf (buf, sizeof (buf), _("Audio: <span foreground=\"green\">%.1f kHz / %4.1f ms</span>"),
(float) rate / 1000.0f,
(AudioEngine::instance()->usecs_per_cycle() / 1000.0f));
} else {
snprintf (buf, sizeof (buf), _("Audio: <span foreground=\"green\">%" PRId64 " kHz / %4.1f ms</span>"),
rate/1000,
(AudioEngine::instance()->usecs_per_cycle() / 1000.0f));
}
}
}
sample_rate_label.set_markup (buf);
}
void
ARDOUR_UI::update_format ()
{
if (!_session) {
format_label.set_text ("");
return;
}
stringstream s;
s << _("File:") << X_(" <span foreground=\"green\">");
switch (_session->config.get_native_file_header_format ()) {
case BWF:
s << _("BWF");
break;
case WAVE:
s << _("WAV");
break;
case WAVE64:
s << _("WAV64");
break;
case CAF:
s << _("CAF");
break;
case AIFF:
s << _("AIFF");
break;
case iXML:
s << _("iXML");
break;
case RF64:
s << _("RF64");
break;
}
s << " ";
switch (_session->config.get_native_file_data_format ()) {
case FormatFloat:
s << _("32-float");
break;
case FormatInt24:
s << _("24-int");
break;
case FormatInt16:
s << _("16-int");
break;
}
s << X_("</span>");
format_label.set_markup (s.str ());
}
void void
ARDOUR_UI::update_cpu_load () ARDOUR_UI::update_cpu_load ()
{ {
char buf[64];
/* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::resize_text_widgets
should also be changed.
*/
float const c = AudioEngine::instance()->get_dsp_load (); float const c = AudioEngine::instance()->get_dsp_load ();
snprintf (buf, sizeof (buf), _("DSP: <span foreground=\"%s\">%5.1f%%</span>"), c >= 90 ? X_("red") : X_("green"), c); _dsp_load_adjustment->set_value (c);
cpu_load_label.set_markup (buf);
_dsp_load_adjustment->set_value (c);
stringstream ss; stringstream ss;
ss << (int)c; ss << (int)c;
_dsp_load_label->set_text ( ss.str() + "%" ); _dsp_load_label->set_text ( ss.str() + "%" );
} }
void
ARDOUR_UI::update_buffer_load ()
{
char buf[256];
uint32_t const playback = _session ? _session->playback_load () : 100;
uint32_t const capture = _session ? _session->capture_load () : 100;
/* If this text is changed, the set_size_request_to_display_given_text call in ARDOUR_UI::resize_text_widgets
should also be changed.
*/
if (_session) {
snprintf (
buf, sizeof (buf),
_("Buffers: <span foreground=\"green\">p:</span><span foreground=\"%s\">%" PRIu32 "%%</span> "
"<span foreground=\"green\">c:</span><span foreground=\"%s\">%" PRIu32 "%%</span>"),
playback <= 5 ? X_("red") : X_("green"),
playback,
capture <= 5 ? X_("red") : X_("green"),
capture
);
buffer_load_label.set_markup (buf);
} else {
buffer_load_label.set_text ("");
}
}
void void
ARDOUR_UI::count_recenabled_streams (Route& route) ARDOUR_UI::count_recenabled_streams (Route& route)
{ {
@ -1301,7 +1150,6 @@ ARDOUR_UI::update_disk_space()
} }
boost::optional<framecnt_t> opt_frames = _session->available_capture_duration(); boost::optional<framecnt_t> opt_frames = _session->available_capture_duration();
char buf[64];
framecnt_t fr = _session->frame_rate(); framecnt_t fr = _session->frame_rate();
if (fr == 0) { if (fr == 0) {
@ -1311,10 +1159,8 @@ ARDOUR_UI::update_disk_space()
if (!opt_frames) { if (!opt_frames) {
/* Available space is unknown */ /* Available space is unknown */
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">Unknown</span>"));
result = "Unknown"; result = "Unknown";
} else if (opt_frames.get_value_or (0) == max_framecnt) { } else if (opt_frames.get_value_or (0) == max_framecnt) {
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">24hrs+</span>"));
result = "24hrs+"; result = "24hrs+";
} else { } else {
rec_enabled_streams = 0; rec_enabled_streams = 0;
@ -1335,7 +1181,6 @@ ARDOUR_UI::update_disk_space()
hrs = frames / (fr * 3600); hrs = frames / (fr * 3600);
if (hrs > 24) { if (hrs > 24) {
snprintf (buf, sizeof (buf), "%s", _("Disk: <span foreground=\"green\">&gt;24 hrs</span>"));
result =">24hrs"; result =">24hrs";
} else { } else {
frames -= hrs * fr * 3600; frames -= hrs * fr * 3600;
@ -1343,22 +1188,12 @@ ARDOUR_UI::update_disk_space()
frames -= mins * fr * 60; frames -= mins * fr * 60;
secs = frames / fr; secs = frames / fr;
bool const low = (hrs == 0 && mins <= 30);
snprintf (
buf, sizeof(buf),
_("Disk: <span foreground=\"%s\">%02dh:%02dm:%02ds</span>"),
low ? X_("red") : X_("green"),
hrs, mins, secs
);
stringstream ss; stringstream ss;
ss << hrs << "h " << mins << "m "; ss << hrs << "h " << mins << "m ";
result = ss.str(); result = ss.str();
} }
} }
disk_space_label.set_markup (buf);
_hd_remained_time_label->set_text(result); _hd_remained_time_label->set_text(result);
} }
@ -1376,51 +1211,6 @@ ARDOUR_UI::update_disk_usage ()
_hd_load_label->set_text ( ss.str() + "%" ); _hd_load_label->set_text ( ss.str() + "%" );
} }
void
ARDOUR_UI::update_timecode_format ()
{
char buf[64];
if (_session) {
bool matching;
TimecodeSlave* tcslave;
SyncSource sync_src = Config->get_sync_source();
if ((sync_src == LTC || sync_src == MTC) && (tcslave = dynamic_cast<TimecodeSlave*>(_session->slave())) != 0) {
matching = (tcslave->apparent_timecode_format() == _session->config.get_timecode_format());
} else {
matching = true;
}
snprintf (buf, sizeof (buf), S_("Timecode|TC: <span foreground=\"%s\">%s</span>"),
matching ? X_("green") : X_("red"),
Timecode::timecode_format_name (_session->config.get_timecode_format()).c_str());
} else {
snprintf (buf, sizeof (buf), "TC: n/a");
}
timecode_format_label.set_markup (buf);
}
gint
ARDOUR_UI::update_wall_clock ()
{
time_t now;
struct tm *tm_now;
static int last_min = -1;
time (&now);
tm_now = localtime (&now);
if (last_min != tm_now->tm_min) {
char buf[16];
sprintf (buf, "%02d:%02d", tm_now->tm_hour, tm_now->tm_min);
wall_clock_label.set_text (buf);
last_min = tm_now->tm_min;
}
return TRUE;
}
void void
ARDOUR_UI::redisplay_recent_sessions () ARDOUR_UI::redisplay_recent_sessions ()
{ {
@ -1878,14 +1668,13 @@ ARDOUR_UI::transport_record (bool roll)
msg.run (); msg.run ();
return; return;
} }
if (Profile->get_trx()) {
roll = trx_record_enable_all_tracks (); if ( Profile->get_trx() )
} roll = trx_record_enable_all_tracks ();
transport_roll ();
_session->maybe_enable_record (); _session->maybe_enable_record ();
if (roll) { break;
transport_roll ();
}
break;
case Session::Recording: case Session::Recording:
if (roll) { if (roll) {
_session->request_stop(); _session->request_stop();
@ -4279,7 +4068,6 @@ ARDOUR_UI::disconnect_from_engine ()
AudioEngine::instance()->Halted.connect_same_thread (halt_connection, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false)); AudioEngine::instance()->Halted.connect_same_thread (halt_connection, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false));
} }
update_sample_rate (0);
return 0; return 0;
} }
@ -4297,7 +4085,6 @@ ARDOUR_UI::reconnect_to_engine ()
return -1; return -1;
} }
update_sample_rate (0);
return 0; return 0;
} }

View file

@ -553,29 +553,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void use_menubar_as_top_menubar (); void use_menubar_as_top_menubar ();
void build_menu_bar (); void build_menu_bar ();
Gtk::Label wall_clock_label;
gint update_wall_clock ();
Gtk::Label disk_space_label;
void update_disk_space (); void update_disk_space ();
void update_disk_usage (); void update_disk_usage ();
Gtk::Label timecode_format_label;
Gtk::Label cpu_load_label;
void update_cpu_load (); void update_cpu_load ();
Gtk::Label buffer_load_label;
void update_buffer_load ();
Gtk::Label sample_rate_label;
void update_sample_rate (ARDOUR::framecnt_t);
Gtk::Label format_label;
void update_format ();
void update_timecode_format ();
gint every_second (); gint every_second ();
gint every_point_one_seconds (); gint every_point_one_seconds ();
gint every_point_zero_something_seconds (); gint every_point_zero_something_seconds ();
@ -754,13 +736,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
bool check_audioengine(); bool check_audioengine();
void audioengine_setup (); void audioengine_setup ();
void display_message (const char *prefix, gint prefix_len,
Glib::RefPtr<Gtk::TextBuffer::Tag> ptag, Glib::RefPtr<Gtk::TextBuffer::Tag> mtag,
const char *msg);
Gtk::Label status_bar_label;
bool status_bar_button_press (GdkEventButton*);
Gtk::ToggleButton error_log_button;
void loading_message (const std::string& msg); void loading_message (const std::string& msg);
PBD::ScopedConnectionList forever_connections; PBD::ScopedConnectionList forever_connections;
@ -782,7 +757,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
bool click_button_clicked (GdkEventButton *); bool click_button_clicked (GdkEventButton *);
VisibilityGroup _status_bar_visibility;
Gtk::Adjustment* _dsp_load_adjustment; Gtk::Adjustment* _dsp_load_adjustment;
Gtk::Adjustment* _hd_load_adjustment; Gtk::Adjustment* _hd_load_adjustment;
Gtk::Label* _dsp_load_label; Gtk::Label* _dsp_load_label;
@ -802,8 +776,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void successful_graph_sort (); void successful_graph_sort ();
bool _feedback_exists; bool _feedback_exists;
void resize_text_widgets ();
std::string _announce_string; std::string _announce_string;
void check_announcements (); void check_announcements ();

View file

@ -88,27 +88,7 @@ ARDOUR_UI::setup_windows ()
we_have_dependents (); we_have_dependents ();
#ifdef TOP_MENUBAR #ifndef TOP_MENUBAR
HBox* status_bar_packer = manage (new HBox);
EventBox* status_bar_event_box = manage (new EventBox);
status_bar_event_box->add (status_bar_label);
status_bar_event_box->add_events (Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
status_bar_label.set_size_request (300, -1);
status_bar_packer->pack_start (*status_bar_event_box, true, true, 6);
status_bar_packer->pack_start (error_log_button, false, false);
status_bar_label.show ();
status_bar_event_box->show ();
status_bar_packer->show ();
error_log_button.show ();
error_log_button.signal_clicked().connect (mem_fun (*this, &UI::toggle_errors));
status_bar_event_box->signal_button_press_event().connect (mem_fun (*this, &ARDOUR_UI::status_bar_button_press));
editor->get_status_bar_packer().pack_start (*status_bar_packer, true, true);
editor->get_status_bar_packer().pack_start (menu_bar_base, false, false, 6);
#else
editor->get_h_box ("menu_bar_base").pack_start (menu_bar_base, false, false); editor->get_h_box ("menu_bar_base").pack_start (menu_bar_base, false, false);
#endif #endif
if (ARDOUR::Profile->get_trx()) { if (ARDOUR::Profile->get_trx()) {
@ -155,49 +135,6 @@ ARDOUR_UI::setup_tooltips ()
editor->setup_tooltips (); editor->setup_tooltips ();
} }
bool
ARDOUR_UI::status_bar_button_press (GdkEventButton* ev)
{
bool handled = false;
switch (ev->button) {
case 1:
status_bar_label.set_text ("");
handled = true;
break;
default:
break;
}
return handled;
}
void
ARDOUR_UI::display_message (const char *prefix, gint prefix_len, RefPtr<TextBuffer::Tag> ptag, RefPtr<TextBuffer::Tag> mtag, const char *msg)
{
string text;
UI::display_message (prefix, prefix_len, ptag, mtag, msg);
#ifdef TOP_MENUBAR
if (strcmp (prefix, _("[ERROR]: ")) == 0) {
text = "<span color=\"red\" weight=\"bold\">";
} else if (strcmp (prefix, _("[WARNING]: ")) == 0) {
text = "<span color=\"yellow\" weight=\"bold\">";
} else if (strcmp (prefix, _("[INFO]: ")) == 0) {
text = "<span color=\"green\" weight=\"bold\">";
} else {
text = "<span color=\"white\" weight=\"bold\">???";
}
text += prefix;
text += "</span>";
text += msg;
status_bar_label.set_markup (text);
#endif
}
XMLNode* XMLNode*
ARDOUR_UI::tearoff_settings (const char* name) const ARDOUR_UI::tearoff_settings (const char* name) const
{ {

View file

@ -300,8 +300,6 @@ ARDOUR_UI::unload_session (bool hide_stuff)
session_loaded = false; session_loaded = false;
update_buffer_load ();
return 0; return 0;
} }

View file

@ -575,21 +575,6 @@ ARDOUR_UI::build_menu_bar ()
ev->add (*vbox); ev->add (*vbox);
wall_clock_label.set_name ("WallClock");
wall_clock_label.set_use_markup ();
disk_space_label.set_name ("WallClock");
disk_space_label.set_use_markup ();
timecode_format_label.set_name ("WallClock");
timecode_format_label.set_use_markup ();
cpu_load_label.set_name ("CPULoad");
cpu_load_label.set_use_markup ();
buffer_load_label.set_name ("BufferLoad");
buffer_load_label.set_use_markup ();
sample_rate_label.set_name ("SampleRate");
sample_rate_label.set_use_markup ();
format_label.set_name ("Format");
format_label.set_use_markup ();
#ifndef TOP_MENUBAR #ifndef TOP_MENUBAR
menu_hbox.pack_start (*menu_bar, false, false); menu_hbox.pack_start (*menu_bar, false, false);
#else #else
@ -607,28 +592,10 @@ ARDOUR_UI::build_menu_bar ()
disk_space = true; disk_space = true;
} }
hbox->pack_end (wall_clock_label, false, false, 2);
hbox->pack_end (disk_space_label, false, false, 4);
hbox->pack_end (cpu_load_label, false, false, 4);
hbox->pack_end (buffer_load_label, false, false, 4);
hbox->pack_end (sample_rate_label, false, false, 4);
hbox->pack_end (timecode_format_label, false, false, 4);
hbox->pack_end (format_label, false, false, 4);
menu_hbox.pack_end (*ev, false, false, 6); menu_hbox.pack_end (*ev, false, false, 6);
menu_bar_base.set_name ("MainMenuBar"); menu_bar_base.set_name ("MainMenuBar");
menu_bar_base.add (menu_hbox); menu_bar_base.add (menu_hbox);
_status_bar_visibility.add (&wall_clock_label, X_("WallClock"), _("Wall Clock"), wall_clock);
_status_bar_visibility.add (&disk_space_label, X_("Disk"), _("Disk Space"), disk_space);
_status_bar_visibility.add (&cpu_load_label, X_("DSP"), _("DSP"), true);
_status_bar_visibility.add (&buffer_load_label, X_("Buffers"), _("Buffers"), true);
_status_bar_visibility.add (&sample_rate_label, X_("Audio"), _("Audio"), true);
_status_bar_visibility.add (&timecode_format_label, X_("TCFormat"), _("Timecode Format"), true);
_status_bar_visibility.add (&format_label, X_("Format"), _("File Format"), true);
ev->signal_button_press_event().connect (sigc::mem_fun (_status_bar_visibility, &VisibilityGroup::button_press_event));
} }
void void
@ -679,7 +646,6 @@ ARDOUR_UI::save_ardour_state ()
Config->add_extra_xml (get_transport_controllable_state()); Config->add_extra_xml (get_transport_controllable_state());
XMLNode* window_node = new XMLNode (X_("UI")); XMLNode* window_node = new XMLNode (X_("UI"));
window_node->add_property (_status_bar_visibility.get_state_name().c_str(), _status_bar_visibility.get_state_value ());
/* Windows */ /* Windows */
@ -733,13 +699,6 @@ ARDOUR_UI::save_ardour_state ()
Keyboard::save_keybindings (); Keyboard::save_keybindings ();
} }
void
ARDOUR_UI::resize_text_widgets ()
{
set_size_request_to_display_given_text (cpu_load_label, "DSP: 100.0%", 2, 2);
set_size_request_to_display_given_text (buffer_load_label, "Buffers: p:100% c:100%", 2, 2);
}
void void
ARDOUR_UI::focus_on_clock () ARDOUR_UI::focus_on_clock ()
{ {

View file

@ -427,16 +427,10 @@ ARDOUR_UI::session_parameter_changed (const std::string& param)
{ {
if ( param == "native-file-data-format" ) if ( param == "native-file-data-format" )
{ {
update_format();
update_bit_depth_button (); update_bit_depth_button ();
} }
else if (param == "native-file-header-format")
{
update_format();
}
else if ( param == "timecode-format" ) else if ( param == "timecode-format" )
{ {
update_timecode_format();
update_frame_rate_button (); update_frame_rate_button ();
} }
} }

View file

@ -425,12 +425,12 @@ AudioRegionView::reset_width_dependent_items (double pixel_width)
float x_pos = trackview.editor().sample_to_pixel (*i); float x_pos = trackview.editor().sample_to_pixel (*i);
(*l).second->set (ArdourCanvas::Duple (x_pos, 2.0), (*l).second->set (ArdourCanvas::Duple (x_pos, 2.0),
ArdourCanvas::Duple (x_pos, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1)); ArdourCanvas::Duple (x_pos, _height - 1));
(*l).first = *i; (*l).first = *i;
(*l).second->set (ArdourCanvas::Duple (x_pos, 2.0), (*l).second->set (ArdourCanvas::Duple (x_pos, 2.0),
ArdourCanvas::Duple (x_pos, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1)); ArdourCanvas::Duple (x_pos, _height - 1));
} }
reset_fade_shapes (); reset_fade_shapes ();
@ -483,7 +483,7 @@ AudioRegionView::set_height (gdouble height)
if (height < NAME_HIGHLIGHT_THRESH) { if (height < NAME_HIGHLIGHT_THRESH) {
ht = ((height - 2 * wcnt) / (double) wcnt); ht = ((height - 2 * wcnt) / (double) wcnt);
} else { } else {
ht = (((height - 2 * wcnt) - NAME_HIGHLIGHT_SIZE) / (double) wcnt); ht = (((height - 2 * wcnt) ) / (double) wcnt);
} }
gdouble yoff = n * (ht + 1); gdouble yoff = n * (ht + 1);
@ -500,7 +500,7 @@ AudioRegionView::set_height (gdouble height)
update_envelope_visibility (); update_envelope_visibility ();
} }
gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE) - 2); gain_line->set_height ((uint32_t) rint (height) - 2);
} }
reset_fade_shapes (); reset_fade_shapes ();
@ -514,7 +514,7 @@ AudioRegionView::set_height (gdouble height)
if (height >= NAME_HIGHLIGHT_THRESH) { if (height >= NAME_HIGHLIGHT_THRESH) {
(*l).second->set (ArdourCanvas::Duple (pos_x, 2.0), (*l).second->set (ArdourCanvas::Duple (pos_x, 2.0),
ArdourCanvas::Duple (pos_x, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1)); ArdourCanvas::Duple (pos_x, _height - 1));
} else { } else {
(*l).second->set (ArdourCanvas::Duple (pos_x, 2.0), (*l).second->set (ArdourCanvas::Duple (pos_x, 2.0),
ArdourCanvas::Duple (pos_x, _height - 1)); ArdourCanvas::Duple (pos_x, _height - 1));
@ -584,7 +584,7 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
double effective_height; double effective_height;
if (_height >= NAME_HIGHLIGHT_THRESH) { if (_height >= NAME_HIGHLIGHT_THRESH) {
effective_height = _height - NAME_HIGHLIGHT_SIZE; effective_height = _height;
} else { } else {
effective_height = _height; effective_height = _height;
} }
@ -669,7 +669,7 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
double effective_height; double effective_height;
if (_height >= NAME_HIGHLIGHT_THRESH) { if (_height >= NAME_HIGHLIGHT_THRESH) {
effective_height = _height - NAME_HIGHLIGHT_SIZE; effective_height = _height;
} else { } else {
effective_height = _height; effective_height = _height;
} }
@ -1126,11 +1126,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
uint32_t nwaves = std::min (nchans, audio_region()->n_channels()); uint32_t nwaves = std::min (nchans, audio_region()->n_channels());
gdouble ht; gdouble ht;
if (trackview.current_height() < NAME_HIGHLIGHT_THRESH) { ht = ((trackview.current_height()) / (double) nchans);
ht = ((trackview.current_height()) / (double) nchans);
} else {
ht = ((trackview.current_height() - NAME_HIGHLIGHT_SIZE) / (double) nchans);
}
gdouble yoff = which * ht; gdouble yoff = which * ht;
@ -1230,7 +1226,7 @@ AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev, b
/* compute vertical fractional position */ /* compute vertical fractional position */
y = 1.0 - (y / (_height - NAME_HIGHLIGHT_SIZE)); y = 1.0 - (y / (_height));
/* map using gain line */ /* map using gain line */
@ -1518,7 +1514,7 @@ AudioRegionView::transients_changed ()
CANVAS_DEBUG_NAME (canvas_item, string_compose ("transient group for %1", region()->name())); CANVAS_DEBUG_NAME (canvas_item, string_compose ("transient group for %1", region()->name()));
canvas_item->set (ArdourCanvas::Duple (-1.0, 2.0), canvas_item->set (ArdourCanvas::Duple (-1.0, 2.0),
ArdourCanvas::Duple (1.0, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1)); ArdourCanvas::Duple (1.0, _height - 1));
canvas_item->raise_to_top (); canvas_item->raise_to_top ();
canvas_item->show (); canvas_item->show ();
@ -1545,7 +1541,7 @@ AudioRegionView::transients_changed ()
(*l).second->set ( (*l).second->set (
ArdourCanvas::Duple (*pos, 2.0), ArdourCanvas::Duple (*pos, 2.0),
ArdourCanvas::Duple (*pos, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1) ArdourCanvas::Duple (*pos, _height - 1)
); );
(*l).second->set_data ("position", pos); (*l).second->set_data ("position", pos);

View file

@ -35,6 +35,7 @@
#include "ardour/session.h" #include "ardour/session.h"
#include "canvas/rectangle.h" #include "canvas/rectangle.h"
#include "canvas/utils.h"
#include "audio_streamview.h" #include "audio_streamview.h"
#include "audio_region_view.h" #include "audio_region_view.h"
@ -269,25 +270,22 @@ AudioStreamView::setup_rec_box ()
switch (_trackview.audio_track()->mode()) { switch (_trackview.audio_track()->mode()) {
case Normal: case Normal:
case NonLayered: case NonLayered:
xend = xstart;
fill_color = ARDOUR_UI::config()->get_canvasvar_RecordingRect();
break;
case Destructive: case Destructive:
xend = xstart + 2; xend = xstart;
fill_color = ARDOUR_UI::config()->get_canvasvar_RecordingRect(); //fill_color = ARDOUR_UI::config()->get_canvasvar_RecordingRect();
// GZ FIXME:change in config instead of following
fill_color = ArdourCanvas::rgba_to_color (251.0/255.0, 35.0/255.0, 52.0/255.0, 1.0);
/* make the recording rect translucent to allow /* make the recording rect translucent to allow
the user to see the peak data coming in, etc. the user to see the peak data coming in, etc.
*/ */
fill_color = UINT_RGBA_CHANGE_A (fill_color, 120); break;
break;
} }
ArdourCanvas::Rectangle * rec_rect = new ArdourCanvas::Rectangle (_canvas_group); ArdourCanvas::Rectangle * rec_rect = new ArdourCanvas::Rectangle (_canvas_group);
rec_rect->set_x0 (xstart); rec_rect->set_x0 (xstart);
rec_rect->set_y0 (1); rec_rect->set_y0 (2);
rec_rect->set_x1 (xend); rec_rect->set_x1 (xend);
rec_rect->set_y1 (child_height ()); rec_rect->set_y1 (child_height () - 3);
rec_rect->set_outline_what (ArdourCanvas::Rectangle::What (0)); rec_rect->set_outline_what (ArdourCanvas::Rectangle::What (0));
rec_rect->set_outline_color (ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame()); rec_rect->set_outline_color (ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame());
rec_rect->set_fill_color (fill_color); rec_rect->set_fill_color (fill_color);

View file

@ -88,7 +88,7 @@ AutomationRegionView::create_line (boost::shared_ptr<ARDOUR::AutomationList> lis
_parameter, _parameter,
&_source_relative_time_converter)); &_source_relative_time_converter));
_line->set_colors(); _line->set_colors();
_line->set_height ((uint32_t)rint(trackview.current_height() - NAME_HIGHLIGHT_SIZE)); _line->set_height ((uint32_t)rint(trackview.current_height()));
_line->set_visibility (AutomationLine::VisibleAspects (AutomationLine::Line|AutomationLine::ControlPoints)); _line->set_visibility (AutomationLine::VisibleAspects (AutomationLine::Line|AutomationLine::ControlPoints));
_line->set_maximum_time (_region->length()); _line->set_maximum_time (_region->length());
_line->set_offset (_region->start ()); _line->set_offset (_region->start ());
@ -118,7 +118,7 @@ AutomationRegionView::canvas_event (GdkEvent* ev)
/* clamp y */ /* clamp y */
y = std::max (y, 0.0); y = std::max (y, 0.0);
y = std::min (y, _height - NAME_HIGHLIGHT_SIZE); y = std::min (y, _height);
/* guard points only if primary modifier is used */ /* guard points only if primary modifier is used */
bool with_guard_points = Gtkmm2ext::Keyboard::modifier_state_equals (ev->button.state, Gtkmm2ext::Keyboard::PrimaryModifier); bool with_guard_points = Gtkmm2ext::Keyboard::modifier_state_equals (ev->button.state, Gtkmm2ext::Keyboard::PrimaryModifier);
@ -147,7 +147,7 @@ AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double
/* compute vertical fractional position */ /* compute vertical fractional position */
const double h = trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2; const double h = trackview.current_height() - 2;
y = 1.0 - (y / h); y = 1.0 - (y / h);
/* snap frame */ /* snap frame */
@ -184,7 +184,7 @@ AutomationRegionView::set_height (double h)
RegionView::set_height(h); RegionView::set_height(h);
if (_line) { if (_line) {
_line->set_height ((uint32_t)rint(h - NAME_HIGHLIGHT_SIZE)); _line->set_height ((uint32_t)rint(h));
} }
} }

View file

@ -50,7 +50,7 @@ class AutomationStreamView : public StreamView
void redisplay_track (); void redisplay_track ();
inline double contents_height() const { inline double contents_height() const {
return (_trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2); return (_trackview.current_height() - 2);
} }
bool has_automation () const; bool has_automation () const;

View file

@ -279,14 +279,6 @@ Editor::Editor ()
, edit_packer (get_table ("edit_packer")) , edit_packer (get_table ("edit_packer"))
, edit_controls_vbox (get_v_box ("edit_controls_vbox")) , edit_controls_vbox (get_v_box ("edit_controls_vbox"))
, controls_layout (get_layout ("controls_layout")) , controls_layout (get_layout ("controls_layout"))
#ifdef TOP_MENUBAR
/*
* This is needed for OS X primarily
* but also any other OS that uses a single
* top menubar instead of per window menus
*/
, _status_bar_hpacker (get_h_box ("menu_bar_base"))
#endif
/* the values here don't matter: layout widgets /* the values here don't matter: layout widgets
reset them as needed. reset them as needed.
@ -4960,8 +4952,13 @@ Editor::add_routes (RouteList& routes)
throw unknown_type(); throw unknown_type();
} }
new_views.push_back (rtv); if (rtv->is_master_track() ) {
track_views.push_back (rtv); new_views.push_front (rtv);
track_views.push_front (rtv);
} else {
new_views.push_back (rtv);
track_views.push_back (rtv);
}
rtv->effective_gain_display (); rtv->effective_gain_display ();

View file

@ -284,14 +284,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void export_region (); void export_region ();
void add_toplevel_controls (Gtk::Container&); void add_toplevel_controls (Gtk::Container&);
#ifdef TOP_MENUBAR
/*
* This is needed for OS X primarily
* but also any other OS that uses a single
* top menubar instead of per window menus
*/
Gtk::HBox& get_status_bar_packer() { return _status_bar_hpacker; }
#endif
void set_zoom_focus (Editing::ZoomFocus); void set_zoom_focus (Editing::ZoomFocus);
Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; } Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
@ -2007,15 +1999,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void history_changed (); void history_changed ();
#ifdef TOP_MENUBAR
/*
* This is needed for OS X primarily
* but also any other OS that uses a single
* top menubar instead of per window menus
*/
Gtk::HBox& _status_bar_hpacker;
#endif
Editing::EditPoint _edit_point; Editing::EditPoint _edit_point;
ArdourDropdown edit_point_selector; ArdourDropdown edit_point_selector;

View file

@ -2626,12 +2626,7 @@ Editor::update_join_object_range_location (double y)
entered_route_view->canvas_display()->canvas_to_item (cx, cy); entered_route_view->canvas_display()->canvas_to_item (cx, cy);
double track_height = entered_route_view->view()->child_height(); double const c = cy / (entered_route_view->view()->child_height() );
if (Config->get_show_name_highlight()) {
track_height -= TimeAxisViewItem::NAME_HIGHLIGHT_SIZE;
}
double const c = cy / track_height;
if (c <= 0.5) { if (c <= 0.5) {
_join_object_range_state = JOIN_OBJECT_RANGE_RANGE; _join_object_range_state = JOIN_OBJECT_RANGE_RANGE;

View file

@ -82,7 +82,7 @@ class MidiStreamView : public StreamView
void leave_internal_edit_mode (); void leave_internal_edit_mode ();
inline double contents_height() const inline double contents_height() const
{ return (child_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2); } { return (child_height() - 2); }
inline double note_to_y(uint8_t note) const inline double note_to_y(uint8_t note) const
{ return contents_height() { return contents_height()

View file

@ -367,15 +367,6 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
static const int vertical_spacing; static const int vertical_spacing;
static const int horizontal_spacing; static const int horizontal_spacing;
#ifdef TOP_MENUBAR
/*
* This is needed for OS X primarily
* but also any other OS that uses a single
* top menubar instead of per window menus
*/
virtual Gtk::HBox& get_status_bar_packer() = 0;
#endif
virtual ArdourCanvas::Container* get_trackview_group () const = 0; virtual ArdourCanvas::Container* get_trackview_group () const = 0;
virtual ArdourCanvas::ScrollGroup* get_hscroll_group () const = 0; virtual ArdourCanvas::ScrollGroup* get_hscroll_group () const = 0;
virtual ArdourCanvas::ScrollGroup* get_vscroll_group () const = 0; virtual ArdourCanvas::ScrollGroup* get_vscroll_group () const = 0;

View file

@ -675,7 +675,7 @@ RegionView::region_sync_changed ()
sync_mark->set (points); sync_mark->set (points);
sync_mark->show (); sync_mark->show ();
sync_line->set (ArdourCanvas::Duple (offset, 0), ArdourCanvas::Duple (offset, trackview.current_height() - NAME_HIGHLIGHT_SIZE)); sync_line->set (ArdourCanvas::Duple (offset, 0), ArdourCanvas::Duple (offset, trackview.current_height() ));
sync_line->show (); sync_line->show ();
} }
} }
@ -748,7 +748,7 @@ RegionView::set_height (double h)
sync_line->set ( sync_line->set (
ArdourCanvas::Duple (offset, 0), ArdourCanvas::Duple (offset, 0),
ArdourCanvas::Duple (offset, h - NAME_HIGHLIGHT_SIZE) ArdourCanvas::Duple (offset, h )
); );
} }

View file

@ -2273,7 +2273,7 @@ RouteTimeAxisView::can_edit_name () const
{ {
/* we do not allow track name changes if it is record enabled /* we do not allow track name changes if it is record enabled
*/ */
return !_route->record_enabled(); return !( (ARDOUR_UI::instance()->the_session()->record_status()==Session::Recording) && (_route->record_enabled()) );
} }
void void

View file

@ -418,16 +418,11 @@ StreamView::update_rec_box ()
case NonLayered: case NonLayered:
case Normal: case Normal:
rect.length = at - rect.start;
xstart = _trackview.editor().sample_to_pixel (rect.start);
xend = _trackview.editor().sample_to_pixel (at);
break;
case Destructive: case Destructive:
rect.length = 2; rect.length = at - rect.start;
xstart = _trackview.editor().sample_to_pixel (_trackview.track()->current_capture_start()); xstart = _trackview.editor().sample_to_pixel (rect.start);
xend = _trackview.editor().sample_to_pixel (at); xend = _trackview.editor().sample_to_pixel (at);
break; break;
default: default:
fatal << string_compose (_("programming error: %1"), "illegal track mode") << endmsg; fatal << string_compose (_("programming error: %1"), "illegal track mode") << endmsg;

View file

@ -60,14 +60,20 @@ using namespace ARDOUR_UI_UTILS;
using namespace Gtkmm2ext; using namespace Gtkmm2ext;
Pango::FontDescription TimeAxisViewItem::NAME_FONT; Pango::FontDescription TimeAxisViewItem::NAME_FONT;
const double TimeAxisViewItem::NAME_X_OFFSET = 15.0; const double TimeAxisViewItem::NAME_HIGHLIGHT_Y_IDENT = 3.0;
const double TimeAxisViewItem::GRAB_HANDLE_TOP = 0.0; const double TimeAxisViewItem::NAME_HIGHLIGHT_X_OFFSET = 10.0;
const double TimeAxisViewItem::NAME_HIGHLIGHT_Y_OFFSET = 5.0;
const double TimeAxisViewItem::GRAB_HANDLE_TOP = 2.0;
const double TimeAxisViewItem::GRAB_HANDLE_WIDTH = 10.0; const double TimeAxisViewItem::GRAB_HANDLE_WIDTH = 10.0;
const double TimeAxisViewItem::RIGHT_EDGE_SHIFT = 1.0; const double TimeAxisViewItem::RIGHT_EDGE_SHIFT = 1.0;
const double TimeAxisViewItem::REGION_TOP_OFFSET = 2.0;
const double TimeAxisViewItem::REGION_BOTTOM_OFFSET = 3.0;
int TimeAxisViewItem::NAME_HEIGHT; int TimeAxisViewItem::NAME_HEIGHT;
double TimeAxisViewItem::NAME_HIGHLIGHT_X_IDENT;
double TimeAxisViewItem::NAME_Y_OFFSET; double TimeAxisViewItem::NAME_Y_OFFSET;
double TimeAxisViewItem::NAME_HIGHLIGHT_SIZE; double TimeAxisViewItem::NAME_HIGHLIGHT_HEIGHT;
double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH; double TimeAxisViewItem::NAME_HIGHLIGHT_THRESH;
void void
@ -79,16 +85,15 @@ TimeAxisViewItem::set_constant_heights ()
Gtk::Label foo; Gtk::Label foo;
win.add (foo); win.add (foo);
Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("Hg")); /* ascender + descender */
int width = 0; int width = 0;
int height = 0; int height = 0;
Glib::RefPtr<Pango::Layout> layout = foo.create_pango_layout (X_("H")); /* just the ascender */
layout->set_font_description (NAME_FONT); layout->set_font_description (NAME_FONT);
get_pixel_size (layout, width, height); get_pixel_size (layout, width, height);
layout = foo.create_pango_layout (X_("H")); /* just the ascender */ NAME_HEIGHT = height + 2;
NAME_HIGHLIGHT_X_IDENT = width + 2;
NAME_HEIGHT = height;
/* Config->get_show_name_highlight) == true: /* Config->get_show_name_highlight) == true:
Y_OFFSET is measured from bottom of the time axis view item. Y_OFFSET is measured from bottom of the time axis view item.
@ -96,14 +101,8 @@ TimeAxisViewItem::set_constant_heights ()
Y_OFFSET is measured from the top of the time axis view item. Y_OFFSET is measured from the top of the time axis view item.
*/ */
if (Config->get_show_name_highlight()) { NAME_HIGHLIGHT_HEIGHT = NAME_HEIGHT + NAME_HIGHLIGHT_Y_IDENT*2;
NAME_Y_OFFSET = height + 1; NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_HEIGHT * 1.5;
NAME_HIGHLIGHT_SIZE = height + 2;
} else {
NAME_Y_OFFSET = 3;
NAME_HIGHLIGHT_SIZE = 0;
}
NAME_HIGHLIGHT_THRESH = NAME_HIGHLIGHT_SIZE * 3;
} }
/** /**
@ -188,7 +187,7 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
warning << "Time Axis Item Duration == 0" << endl; warning << "Time Axis Item Duration == 0" << endl;
} }
vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 1.0, 2.0, trackview.current_height())); vestigial_frame = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, 2.0, 2.0 + REGION_TOP_OFFSET, trackview.current_height() - REGION_BOTTOM_OFFSET));
CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name())); CANVAS_DEBUG_NAME (vestigial_frame, string_compose ("vestigial frame for %1", get_item_name()));
vestigial_frame->hide (); vestigial_frame->hide ();
vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_VestigialFrame()); vestigial_frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_VestigialFrame());
@ -196,82 +195,75 @@ TimeAxisViewItem::init (ArdourCanvas::Item* parent, double fpp, uint32_t base_co
if (visibility & ShowFrame) { if (visibility & ShowFrame) {
frame = new ArdourCanvas::Rectangle (group, frame = new ArdourCanvas::Rectangle (group,
ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::Rect (0.0, REGION_TOP_OFFSET,
trackview.editor().sample_to_pixel(duration) + RIGHT_EDGE_SHIFT, trackview.editor().sample_to_pixel(duration) + RIGHT_EDGE_SHIFT,
trackview.current_height() - 1.0)); trackview.current_height() - REGION_BOTTOM_OFFSET));
CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name())); CANVAS_DEBUG_NAME (frame, string_compose ("frame for %1", get_item_name()));
if (Config->get_show_name_highlight()) { if (_recregion) {
frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT)); frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|
} else { ArdourCanvas::Rectangle::BOTTOM|
frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::BOTTOM)); ArdourCanvas::Rectangle::TOP));
} } else {
frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::LEFT|
ArdourCanvas::Rectangle::RIGHT|
ArdourCanvas::Rectangle::BOTTOM|
ArdourCanvas::Rectangle::TOP));
}
if (_recregion) { //ArdourCanvas::Color ouline_color = ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame();
frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_RecordingRect());
} else { // GZ FIXME:change in config instead of following
frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame()); ArdourCanvas::Color outline_color = ArdourCanvas::rgba_to_color (104, 104, 104, 0.6);
} frame->set_outline_color (outline_color );
} else { } else {
frame = 0; frame = 0;
} }
if (Config->get_show_name_highlight() && (visibility & ShowNameHighlight)) { { // always show name highlight
double width; double width;
double start;
if (visibility & FullWidthNameHighlight) { width = trackview.editor().sample_to_pixel(item_duration) - 2.0 + RIGHT_EDGE_SHIFT;
start = 0.0;
width = trackview.editor().sample_to_pixel(item_duration) + RIGHT_EDGE_SHIFT;
} else {
start = 1.0;
width = trackview.editor().sample_to_pixel(item_duration) - 2.0 + RIGHT_EDGE_SHIFT;
}
name_highlight = new ArdourCanvas::Rectangle (group, name_highlight = new ArdourCanvas::Rectangle (group,
ArdourCanvas::Rect (start, ArdourCanvas::Rect (NAME_HIGHLIGHT_X_OFFSET,
trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, NAME_HIGHLIGHT_Y_OFFSET,
width - 2.0 + RIGHT_EDGE_SHIFT, NAME_HIGHLIGHT_X_OFFSET + 2*NAME_HIGHLIGHT_X_IDENT,
trackview.current_height())); NAME_HIGHLIGHT_HEIGHT) );
CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name())); CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
name_highlight->set_data ("timeaxisviewitem", this); name_highlight->set_data ("timeaxisviewitem", this);
name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP); name_highlight->set_outline_what (ArdourCanvas::Rectangle::What (0) );
name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255)); name_highlight->set_outline_color (RGBA_TO_UINT (0,0,0,255));
} else {
name_highlight = 0;
} }
if (visibility & ShowNameText) { {
name_text = new ArdourCanvas::Text (group); name_text = new ArdourCanvas::Text (group);
CANVAS_DEBUG_NAME (name_text, string_compose ("name text for %1", get_item_name())); CANVAS_DEBUG_NAME (name_text, string_compose ("name text for %1", get_item_name()));
if (Config->get_show_name_highlight()) { name_text->set_position (ArdourCanvas::Duple (NAME_HIGHLIGHT_X_OFFSET + NAME_HIGHLIGHT_X_IDENT, NAME_HIGHLIGHT_Y_OFFSET + NAME_HIGHLIGHT_Y_IDENT) );
name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, trackview.current_height() - NAME_Y_OFFSET)); name_text->set("");
} else { name_text->set_font_description (NAME_FONT);
name_text->set_position (ArdourCanvas::Duple (NAME_X_OFFSET, NAME_Y_OFFSET));
} if (name_text->text().empty() ) {
name_text->set_font_description (NAME_FONT); name_highlight->hide();
name_text->set_ignore_events (true); }
} else { }
name_text = 0;
}
/* create our grab handles used for trimming/duration etc */ /* create our grab handles used for trimming/duration etc */
if (!_recregion && !_automation) { if (!_recregion && !_automation) {
double top = TimeAxisViewItem::GRAB_HANDLE_TOP; double top = TimeAxisViewItem::GRAB_HANDLE_TOP;
double width = TimeAxisViewItem::GRAB_HANDLE_WIDTH; double width = TimeAxisViewItem::GRAB_HANDLE_WIDTH;
frame_handle_start = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height())); frame_handle_start = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height() - REGION_BOTTOM_OFFSET));
CANVAS_DEBUG_NAME (frame_handle_start, "TAVI frame handle start"); CANVAS_DEBUG_NAME (frame_handle_start, "TAVI frame handle start");
frame_handle_start->set_outline (false); frame_handle_start->set_outline (false);
frame_handle_start->set_fill (false); frame_handle_start->set_fill (false);
frame_handle_start->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_start)); frame_handle_start->Event.connect (sigc::bind (sigc::mem_fun (*this, &TimeAxisViewItem::frame_handle_crossing), frame_handle_start));
frame_handle_end = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height())); frame_handle_end = new ArdourCanvas::Rectangle (group, ArdourCanvas::Rect (0.0, top, width, trackview.current_height() - REGION_BOTTOM_OFFSET));
CANVAS_DEBUG_NAME (frame_handle_end, "TAVI frame handle end"); CANVAS_DEBUG_NAME (frame_handle_end, "TAVI frame handle end");
frame_handle_end->set_outline (false); frame_handle_end->set_outline (false);
frame_handle_end->set_fill (false); frame_handle_end->set_fill (false);
@ -319,8 +311,8 @@ TimeAxisViewItem::show_rect ()
set_frame_color (); set_frame_color ();
if (name_highlight) { if (name_highlight) {
name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP); name_highlight->set_outline_what (ArdourCanvas::Rectangle::What (0));
name_highlight->set_fill_color (fill_color); name_highlight->set_fill_color (name_highlight_color);
} }
} }
@ -567,9 +559,8 @@ TimeAxisViewItem::set_name_text(const string& new_name)
return; return;
} }
name_text_width = pixel_width (new_name, NAME_FONT) + 2; name_text_width = pixel_width (new_name, NAME_FONT);
name_text->set (new_name); name_text->set (new_name);
} }
/** /**
@ -584,23 +575,15 @@ TimeAxisViewItem::set_height (double height)
manage_name_highlight (); manage_name_highlight ();
if (visibility & ShowNameText) {
if (Config->get_show_name_highlight()) {
name_text->set_y_position (height - NAME_Y_OFFSET);
} else {
name_text->set_y_position (NAME_Y_OFFSET);
}
}
if (frame) { if (frame) {
frame->set_y1 (height); frame->set_y1 (height - REGION_BOTTOM_OFFSET);
if (frame_handle_start) { if (frame_handle_start) {
frame_handle_start->set_y1 (height); frame_handle_start->set_y1 (height - REGION_BOTTOM_OFFSET);
frame_handle_end->set_y1 (height); frame_handle_end->set_y1 (height - REGION_BOTTOM_OFFSET);
} }
} }
vestigial_frame->set_y1 (height - 1.0); vestigial_frame->set_y1 (height - REGION_BOTTOM_OFFSET - 1.0);
set_colors (); set_colors ();
} }
@ -608,7 +591,7 @@ TimeAxisViewItem::set_height (double height)
void void
TimeAxisViewItem::manage_name_highlight () TimeAxisViewItem::manage_name_highlight ()
{ {
if (!name_highlight) { if (!name_highlight) {
return; return;
} }
@ -618,22 +601,29 @@ TimeAxisViewItem::manage_name_highlight ()
high_enough_for_name = true; high_enough_for_name = true;
} }
if (_width < 2.0) { double highlite_y1 = name_text_width + 2*NAME_HIGHLIGHT_X_IDENT + NAME_HIGHLIGHT_X_OFFSET;
wide_enough_for_name = false; if (_width < highlite_y1) {
highlite_y1 = _width;
}
if (highlite_y1 < NAME_HIGHLIGHT_X_OFFSET) {
wide_enough_for_name = false;
} else { } else {
wide_enough_for_name = true; wide_enough_for_name = true;
} }
if (name_highlight && wide_enough_for_name && high_enough_for_name) { if (wide_enough_for_name && high_enough_for_name && !name_text->text().empty() ) {
name_highlight->set (ArdourCanvas::Rect (NAME_HIGHLIGHT_X_OFFSET,
name_highlight->show(); NAME_HIGHLIGHT_Y_OFFSET,
name_highlight->set (ArdourCanvas::Rect (0.0, (double) _height - NAME_HIGHLIGHT_SIZE, _width+RIGHT_EDGE_SHIFT, (double) _height - 1.0)); highlite_y1,
NAME_HIGHLIGHT_HEIGHT) );
name_highlight->show();
} else { } else {
name_highlight->hide(); name_highlight->hide();
} }
manage_name_text (); manage_name_text ();
} }
void void
@ -670,7 +660,7 @@ TimeAxisViewItem::set_colors()
set_frame_color (); set_frame_color ();
if (name_highlight) { if (name_highlight) {
name_highlight->set_fill_color (fill_color); name_highlight->set_fill_color (name_highlight_color);
} }
set_name_text_color (); set_name_text_color ();
@ -745,14 +735,13 @@ TimeAxisViewItem::get_fill_color () const
} else { } else {
if (_recregion) { if (_recregion) {
f = ARDOUR_UI::config()->get_canvasvar_RecordingRect(); //f = ARDOUR_UI::config()->get_canvasvar_RecordingRect();
// GZ FIXME:change in config instead of following
f = ArdourCanvas::rgba_to_color (251.0/255.0, 35.0/255.0, 52.0/255.0, 1.0);
} else { } else {
if ((!Config->get_show_name_highlight() || high_enough_for_name) && !ARDOUR_UI::config()->get_color_regions_using_track_color()) { f = fill_color;
f = ARDOUR_UI::config()->get_canvasvar_FrameBase(); f = UINT_RGBA_CHANGE_A (f, (ARDOUR_UI::config()->get_canvasvar_FrameBase() & 0x000000ff));
} else { }
f = fill_color;
}
}
} }
return UINT_RGBA_CHANGE_A (f, o); return UINT_RGBA_CHANGE_A (f, o);
@ -768,54 +757,51 @@ TimeAxisViewItem::set_frame_color()
return; return;
} }
frame->set_fill_color (get_fill_color()); uint32_t f = get_fill_color ();
if (!rect_visible) {
f = UINT_RGBA_CHANGE_A (f, 0);
}
frame->set_fill_color (f);
set_frame_gradient (); set_frame_gradient ();
if (!_recregion) { //f = ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame();
uint32_t f;
if (_selected) { // GZ FIXME:change in config instead of following
f = ARDOUR_UI::config()->get_canvasvar_SelectedTimeAxisFrame(); f = ArdourCanvas::rgba_to_color (104.0/255.0, 104.0/255.0, 104.0/255.0, 1.0);
} else {
f = ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame();
}
if (!rect_visible) { if (!rect_visible) {
/* make the frame outline be visible but rather transparent */ f = UINT_RGBA_CHANGE_A (f, 64);
f = UINT_RGBA_CHANGE_A (f, 64);
}
frame->set_outline_color (f);
} }
frame->set_outline_color (f);
} }
void void
TimeAxisViewItem::set_frame_gradient () TimeAxisViewItem::set_frame_gradient ()
{ {
if (ARDOUR_UI::config()->get_timeline_item_gradient_depth() == 0.0) {
frame->set_gradient (ArdourCanvas::Fill::StopList (), 0);
return;
}
ArdourCanvas::Fill::StopList stops; ArdourCanvas::Fill::StopList stops;
double r, g, b, a; double r, g, b, a;
double h, s, v; double h, s, v;
ArdourCanvas::Color f (get_fill_color()); ArdourCanvas::Color fill_color (get_fill_color() );
/* need to get alpha value */ /* need to get alpha value */
ArdourCanvas::color_to_rgba (f, r, g, b, a); ArdourCanvas::color_to_rgba (fill_color, r, g, b, a);
/* now a darker version */ /* set base apacity 90% */
ArdourCanvas::Color base = ArdourCanvas::rgba_to_color (r, g, b, 0.95);
/* set middle apacity 80%*/
ArdourCanvas::Color middle = ArdourCanvas::rgba_to_color (r, g, b, 0.8);
/* set top color as white with 75% apacity*/
ArdourCanvas::Color top = ArdourCanvas::rgba_to_color (r, g, b, 0.65);
ArdourCanvas::color_to_hsv (f, h, s, v); /*set base color starting from the beginning*/
stops.push_back (std::make_pair (0.0, top));
v = min (1.0, v * (1.0 + ARDOUR_UI::config()->get_timeline_item_gradient_depth())); /*set middle color starting from 70% of height*/
stops.push_back (std::make_pair (0.7, middle));
ArdourCanvas::Color lighter = ArdourCanvas::hsv_to_color (h, s, v, a); /*set middle color starting from on top*/
stops.push_back (std::make_pair (0.0, lighter)); stops.push_back (std::make_pair (1.0, base));
stops.push_back (std::make_pair (0.37, f));
stops.push_back (std::make_pair (1.0, f));
frame->set_gradient (stops, true); frame->set_gradient (stops, true);
} }
@ -962,8 +948,8 @@ TimeAxisViewItem::manage_name_text ()
visible_name_width = name_text_width; visible_name_width = name_text_width;
if (visible_name_width > _width - NAME_X_OFFSET) { if (visible_name_width > _width - NAME_HIGHLIGHT_X_OFFSET - NAME_HIGHLIGHT_X_IDENT) {
visible_name_width = _width - NAME_X_OFFSET; visible_name_width = _width - NAME_HIGHLIGHT_X_OFFSET - NAME_HIGHLIGHT_X_IDENT;
} }
if (visible_name_width < 1) { if (visible_name_width < 1) {

View file

@ -104,16 +104,23 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
// Default sizes, font and spacing // Default sizes, font and spacing
static Pango::FontDescription NAME_FONT; static Pango::FontDescription NAME_FONT;
static void set_constant_heights (); static void set_constant_heights ();
static const double NAME_X_OFFSET; static const double NAME_HIGHLIGHT_Y_IDENT;
static const double NAME_HIGHLIGHT_X_OFFSET;
static const double NAME_HIGHLIGHT_Y_OFFSET;
static const double GRAB_HANDLE_TOP; static const double GRAB_HANDLE_TOP;
static const double GRAB_HANDLE_WIDTH; static const double GRAB_HANDLE_WIDTH;
static const double REGION_TOP_OFFSET;
static const double REGION_BOTTOM_OFFSET;
/* these are not constant, but vary with the pixel size /* these are not constant, but vary with the pixel size
of the font used to display the item name. of the font used to display the item name.
*/ */
static int NAME_HEIGHT; static int NAME_HEIGHT;
static double NAME_HIGHLIGHT_X_IDENT;
static double NAME_X_OFFSET;
static double NAME_Y_OFFSET; static double NAME_Y_OFFSET;
static double NAME_HIGHLIGHT_SIZE; static double NAME_HIGHLIGHT_HEIGHT;
static double NAME_HIGHLIGHT_THRESH; static double NAME_HIGHLIGHT_THRESH;
/* if this is 1.0, we move the right boundary /* if this is 1.0, we move the right boundary
@ -230,10 +237,24 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
/** true if a small vestigial rect should be shown when the item gets very narrow */ /** true if a small vestigial rect should be shown when the item gets very narrow */
bool show_vestigial; bool show_vestigial;
uint32_t fill_color;
virtual uint32_t fill_opacity() const; virtual uint32_t fill_opacity() const;
uint32_t fill_color;
uint32_t name_highlight_color;
uint32_t frame_color_r;
uint32_t frame_color_g;
uint32_t frame_color_b;
uint32_t selected_frame_color_r;
uint32_t selected_frame_color_g;
uint32_t selected_frame_color_b;
uint32_t handle_color_r;
uint32_t handle_color_g;
uint32_t handle_color_b;
uint32_t lock_handle_color_r;
uint32_t lock_handle_color_g;
uint32_t lock_handle_color_b;
uint32_t last_item_width; uint32_t last_item_width;
int name_text_width; int name_text_width;
bool wide_enough_for_name; bool wide_enough_for_name;

View file

@ -58,6 +58,8 @@
<Button id="name_button" <Button id="name_button"
width="57" width="57"
height="28" height="28"
fgnormal="#ffffff"
fgactive="#ffffff"
winfont ="Arial 10" winfont ="Arial 10"
macfont ="Helvetica 10"/> macfont ="Helvetica 10"/>
<EventBox bgnormal="#000000" <EventBox bgnormal="#000000"

View file

@ -23,7 +23,7 @@ UI_CONFIG_VARIABLE(bool, flat_buttons, "flat-buttons", false)
UI_CONFIG_VARIABLE(float, waveform_gradient_depth, "waveform-gradient-depth", 0) UI_CONFIG_VARIABLE(float, waveform_gradient_depth, "waveform-gradient-depth", 0)
UI_CONFIG_VARIABLE(float, timeline_item_gradient_depth, "timeline-item-gradient-depth", 0.5) UI_CONFIG_VARIABLE(float, timeline_item_gradient_depth, "timeline-item-gradient-depth", 0.5)
UI_CONFIG_VARIABLE(bool, all_floating_windows_are_dialogs, "all-floating-windows-are-dialogs", false) UI_CONFIG_VARIABLE(bool, all_floating_windows_are_dialogs, "all-floating-windows-are-dialogs", false)
UI_CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-track-color", false) UI_CONFIG_VARIABLE (bool, color_regions_using_track_color, "color-regions-using-track-color", true)
UI_CONFIG_VARIABLE (bool, show_waveform_clipping, "show-waveform-clipping", true) UI_CONFIG_VARIABLE (bool, show_waveform_clipping, "show-waveform-clipping", true)
UI_CONFIG_VARIABLE (int, auto_lock_timer, "auto-lock-timer", 0) UI_CONFIG_VARIABLE (int, auto_lock_timer, "auto-lock-timer", 0)
UI_CONFIG_VARIABLE (int, auto_save_timer, "auto-save-timer", 0) UI_CONFIG_VARIABLE (int, auto_save_timer, "auto-save-timer", 0)

View file

@ -2900,6 +2900,11 @@ WTErr WCMRCoreAudioDeviceManager::getDeviceSampleRatesImpl(const std::string & d
return retVal; return retVal;
} }
if (m_CurrentDevice && m_CurrentDevice->DeviceName () == deviceName) {
sampleRates.assign(m_CurrentDevice->SamplingRates().begin(), m_CurrentDevice->SamplingRates().end() );
return retVal;
}
DeviceInfo devInfo; DeviceInfo devInfo;
retVal = GetDeviceInfoByName(deviceName, devInfo); retVal = GetDeviceInfoByName(deviceName, devInfo);
@ -2973,6 +2978,11 @@ WTErr WCMRCoreAudioDeviceManager::getDeviceBufferSizesImpl(const std::string & d
return retVal; return retVal;
} }
if (m_CurrentDevice && m_CurrentDevice->DeviceName () == deviceName) {
bufferSizes.assign(m_CurrentDevice->BufferSizes().begin(), m_CurrentDevice->BufferSizes().end() );
return retVal;
}
DeviceInfo devInfo; DeviceInfo devInfo;
retVal = GetDeviceInfoByName(deviceName, devInfo); retVal = GetDeviceInfoByName(deviceName, devInfo);