along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <fcntl.h>
#include <ardour/audioengine.h>
#include <ardour/ardour.h>
+#include <ardour/profile.h>
#include <ardour/route.h>
#include "ardour_ui.h"
#include "audio_clock.h"
#include "actions.h"
#include "utils.h"
+#include "theme_manager.h"
#include "i18n.h"
setup_clock ();
setup_transport();
- setup_adjustables ();
build_menu_bar ();
- top_packer.pack_start (menu_bar_base, false, false);
- top_packer.pack_start (transport_frame, false, false);
+ theme_manager->signal_unmap().connect (bind (sigc::ptr_fun(&ActionManager::uncheck_toggleaction), X_("<Actions>/Common/ToggleThemeManager")));
+
+#ifdef TOP_MENUBAR
+ HBox* status_bar_packer = manage (new HBox);
+
+ status_bar_label.set_size_request (300, -1);
+ status_bar_packer->pack_start (status_bar_label, true, true, 6);
+ status_bar_packer->pack_start (error_log_button, false, false);
+
+ error_log_button.signal_clicked().connect (mem_fun (*this, &UI::toggle_errors));
+
+ 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
+ top_packer.pack_start (menu_bar_base, false, false);
+#endif
+
+ top_packer.pack_start (transport_frame, false, false);
editor->add_toplevel_controls (top_packer);
return 0;
}
-void
-ARDOUR_UI::setup_adjustables ()
+ void
+ARDOUR_UI::display_message (const char *prefix, gint prefix_len, RefPtr<TextBuffer::Tag> ptag, RefPtr<TextBuffer::Tag> mtag, const char *msg)
{
- adjuster_table.set_homogeneous (true);
-
- online_control_strings.push_back (_("MMC + Local"));
- online_control_strings.push_back (_("MMC"));
- online_control_strings.push_back (_("Local"));
-
- online_control_button = new GlobalClickBox ("CONTROL",
- online_control_strings);
+ ustring text;
- online_control_button->adjustment.signal_value_changed().connect(mem_fun(*this,&ARDOUR_UI::control_methods_adjusted));
+ UI::display_message (prefix, prefix_len, ptag, mtag, msg);
+#ifdef TOP_MENUBAR
- mmc_id_strings.push_back ("1");
- mmc_id_strings.push_back ("2");
- mmc_id_strings.push_back ("3");
- mmc_id_strings.push_back ("4");
- mmc_id_strings.push_back ("5");
- mmc_id_strings.push_back ("6");
- mmc_id_strings.push_back ("7");
- mmc_id_strings.push_back ("8");
- mmc_id_strings.push_back ("9");
-
- mmc_id_button = new GlobalClickBox (_("MMC ID"), mmc_id_strings);
+ 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\">???";
+ }
- mmc_id_button->adjustment.signal_value_changed().connect (mem_fun(*this,&ARDOUR_UI::mmc_device_id_adjusted));
+ text += prefix;
+ text += "</span>";
+ text += msg;
- adjuster_table.attach (*online_control_button, 0, 2, 1, 2, FILL|EXPAND, FILL, 5, 5);
- adjuster_table.attach (*mmc_id_button, 2, 3, 1, 2, FILL, FILL, 5, 5);
+ status_bar_label.set_markup (text);
+#endif
}
void
transport_tearoff = manage (new TearOff (transport_tearoff_hbox));
transport_tearoff->set_name ("TransportBase");
+ if (Profile->get_sae()) {
+ transport_tearoff->set_can_be_torn_off (false);
+ }
+
transport_hbox.pack_start (*transport_tearoff, true, false);
transport_base.set_name ("TransportBase");
/* clocks, etc. */
- ARDOUR_UI::Clock.connect (bind (mem_fun (primary_clock, &AudioClock::set), false));
- ARDOUR_UI::Clock.connect (bind (mem_fun (secondary_clock, &AudioClock::set), false));
+ ARDOUR_UI::Clock.connect (bind (mem_fun (primary_clock, &AudioClock::set), 'p'));
+ ARDOUR_UI::Clock.connect (bind (mem_fun (secondary_clock, &AudioClock::set), 's'));
primary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
secondary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));
+ big_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::big_clock_value_changed));
ARDOUR_UI::instance()->tooltips().set_tip (primary_clock, _("Primary clock"));
ARDOUR_UI::instance()->tooltips().set_tip (secondary_clock, _("secondary clock"));
transport_tearoff_hbox.pack_start (*svbox, false, false, 3);
transport_tearoff_hbox.pack_start (auto_loop_button, false, false);
- transport_tearoff_hbox.pack_start (play_selection_button, false, false);
+ if (!Profile->get_sae()) {
+ transport_tearoff_hbox.pack_start (play_selection_button, false, false);
+ }
transport_tearoff_hbox.pack_start (roll_button, false, false);
transport_tearoff_hbox.pack_start (stop_button, false, false);
transport_tearoff_hbox.pack_start (rec_button, false, false, 6);
HBox* clock_box = manage (new HBox);
clock_box->pack_start (primary_clock, false, false);
- clock_box->pack_start (secondary_clock, false, false);
- VBox* time_controls_box = manage (new VBox);
- time_controls_box->pack_start (sync_option_combo, false, false);
- time_controls_box->pack_start (time_master_button, false, false);
- clock_box->pack_start (*time_controls_box, false, false, 1);
+ if (!ARDOUR::Profile->get_small_screen()) {
+ clock_box->pack_start (secondary_clock, false, false);
+ }
+
+ if (!Profile->get_sae()) {
+ VBox* time_controls_box = manage (new VBox);
+ time_controls_box->pack_start (sync_option_combo, false, false);
+ time_controls_box->pack_start (time_master_button, false, false);
+ clock_box->pack_start (*time_controls_box, false, false, 1);
+ }
+
transport_tearoff_hbox.pack_start (*clock_box, false, false, 0);
-
+
HBox* toggle_box = manage(new HBox);
VBox* punch_box = manage (new VBox);
transport_tearoff_hbox.pack_start (*toggle_box, false, false, 4);
transport_tearoff_hbox.pack_start (alert_box, false, false);
+
+ if (Profile->get_sae()) {
+ Image* img = manage (new Image ((::get_icon (X_("sae")))));
+ transport_tearoff_hbox.pack_end (*img, false, false, 6);
+ }
}
void
shuttle_grabbed = false;
shuttle_box.remove_modal_grab ();
if (Config->get_shuttle_behaviour() == Sprung) {
- if (Config->get_auto_play() || roll_button.get_state()) {
+ if (Config->get_auto_play() || roll_button.get_visual_state()) {
shuttle_fract = SHUTTLE_FRACT_SPEED1;
session->request_transport_speed (1.0);
stop_button.set_visual_state (0);
return true;
case 3:
+ default:
return true;
-
- case 4:
- shuttle_fract += 0.005;
- break;
- case 5:
- shuttle_fract -= 0.005;
- break;
+
}
use_shuttle_fract (true);
void
ARDOUR_UI::use_shuttle_fract (bool force)
{
- struct timeval now;
- struct timeval diff;
+ microseconds_t now = get_microseconds();
/* do not attempt to submit a motion-driven transport speed request
more than once per process cycle.
*/
- gettimeofday (&now, 0);
- timersub (&now, &last_shuttle_request, &diff);
-
- if (!force && (diff.tv_usec + (diff.tv_sec * 1000000)) < engine->usecs_per_cycle()) {
+ if (!force && (last_shuttle_request - now) < (microseconds_t) engine->usecs_per_cycle()) {
return;
}
set_size_request_to_display_given_text (speed_display_box, _("-0.55"), 2, 2);
const guint32 FUDGE = 25; // Combo's are stupid - they steal space from the entry for the button
set_size_request_to_display_given_text (shuttle_style_button, _("sprung"), 2+FUDGE, 10);
+ cerr << "I commented out line line 881 in ardour_ui2.cc, because it made ardour crash somewhere in Gnome::Canvas::Text" << endl;
+ //reset_dpi();
}
void
ARDOUR_UI::sync_option_changed ()
{
if (session) {
- session->request_slave_source (string_to_slave_source (sync_option_combo.get_active_text()));
+ ustring txt = sync_option_combo.get_active_text ();
+ if (txt.length()) {
+ session->request_slave_source (string_to_slave_source (txt));
+ }
}
}