meter/tempo bars show again, fix tempo/meter dialogs, and more

git-svn-id: svn://localhost/trunk/ardour2@183 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2005-12-08 18:53:43 +00:00
parent 9f91aca762
commit cdd680f0b7
11 changed files with 93 additions and 138 deletions

View File

@ -65,8 +65,7 @@ style "first_action_message"
style "verbose_canvas_cursor"
{
font="-*-sans-medium-r-*-*-*-240-*-*-*-*-*-*"
fontset="-*-sans-medium-r-*-*-*-240-*-*-*-*-*-*"
font_name = "sans bold 24"
}
style "marker_text"
@ -76,8 +75,7 @@ style "marker_text"
style "time_axis_view_item_name"
{
font="-*-sans-medium-r-normal-*-*-100-*-*-p-*-*-1"
fontset="-*-sans-medium-r-normal-*-*-100-*-*-p-*-*-1"
font_name = "sans medium 10"
}
style "default_base" = "medium_text"
@ -485,7 +483,7 @@ style "editor_time_ruler" = "small_text"
style "audio_track_base" = "default_base"
{
font = "-*-courier-medium-r-*-*-*-100-*-*-*-*-*-*"
font_name = "sans medium 10"
fg[NORMAL] = { 0.80, 0.80, 0.70 }
bg[NORMAL] = { 0.18, 0.18, 0.22 }
bg[ACTIVE] = { 0.20, 0.20, 0.20 }
@ -496,14 +494,14 @@ style "audio_track_base" = "default_base"
style "audio_bus_base"
{
font = "-*-courier-medium-r-*-*-*-100-*-*-*-*-*-*"
font_name = "sans medium 10"
fg[NORMAL] = { 0.7, 0.8, 0.2 }
bg[NORMAL] = {0, 0.36, 0.40 }
}
style "track_name_display"
{
font = "-*-sans-medium-r-*-*-*-100-*-*-*-*-*-*"
font_name = "sans medium 10"
fg[NORMAL] = { 0.80, 0.80, 0.70 }
fg[ACTIVE] = { 0.80, 0.80, 0.70 }
@ -598,7 +596,7 @@ style "track_controls_inactive"
bg[SELECTED] = { 0.60, 0.60, 0.66 }
bg[PRELIGHT] = { 0.60, 0.60, 0.66 }
font = "-*-courier-medium-r-*-*-*-100-*-*-*-*-*-*"
font_name = "sans medium 10"
fg[NORMAL] = { 0.7, 0.8, 0.2 }
}
@ -623,8 +621,7 @@ style "automation_track_controls_base"
# Plugin Editors
style "plugin_slider"
{
fontset="-*-sans-medium-r-normal-*-10-*-*-*-p-*-*-*"
font ="-*-sans-medium-r-normal-*-*-100-*-*-p-*-*"
font_name ="sans medium 10"
fg[NORMAL] = { 0.45, 0.45, 0.45 }
fg[ACTIVE] = { 0.45, 0.45, 0.45 }
@ -733,7 +730,7 @@ style "io_selector_port_list" = "medium_text"
style "io_selector_notebook" = "default_base"
{
fg[NORMAL] = { 0.98, 0.76, 0.14 }
font ="-*-sans-bold-r-normal-*-*-140-*-*-p-*-*"
font_name ="sans bold 14"
}
style "tearoff_arrow" = "medium_bold_entry"
@ -744,15 +741,10 @@ style "tearoff_arrow" = "medium_bold_entry"
style "meter_metrics_strip" = "default_base"
{
font = "-*-courier-medium-r-*-*-*-100-*-*-*-*-*-*"
font = "sans medium 10"
fg[NORMAL] = { 0.7, 0.8, 0.2 }
}
style "no_session_msg"
{
font = "-*-sans-medium-r-*-*-34-350-*-*-*-*-*-*"
}
style "location_row_button" = "default_buttons_menus"
{
font_name = "sans 10"
@ -1119,7 +1111,6 @@ widget "*PluginLoadButton" style "small_button"
widget "*PluginLoadButton*" style "small_button"
widget "*FaderMetricsStrip" style "meter_metrics_strip"
widget "*MeterMetricsStrip" style "meter_metrics_strip"
widget "*NoSessionMessage" style "no_session_msg"
widget "*MetricDialogFrame" style "base_frame"
widget "*MetricEntry" style "medium_bold_entry"
widget "*MetricButton" style "default_buttons_menus"

View File

@ -506,7 +506,12 @@ gnome_canvas_simplerect_update (GnomeCanvasItem *item, double *affine, ArtSVP *c
UINT_TO_RGBA (simplerect->outline_color, &simplerect->outline_r, &simplerect->outline_g, &simplerect->outline_b, &foo);
}
#define SIMPLERECT_FAST_RENDERER
// this can be useful for debugging/understanding how the canvas redraws
// stuff.
#undef HARLEQUIN_DEBUGGING
#undef SIMPLERECT_FAST_RENDERER
#ifdef SIMPLERECT_FAST_RENDERER
static void
@ -528,15 +533,13 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
if (buf->is_bg) {
// this can be useful for debugging/understanding how the canvas redraws
// stuff.
// gint randr, randg, randb;
// randr = random() % 255;
// randg = random() % 255;
// randb = random() % 255;
// PAINT_BOX(buf, randr, randg, randb, 255, buf->rect.x0, buf->rect.y0, buf->rect.x1, buf->rect.y1);
#ifdef HARLEQUIN_DEBUGGING
gint randr, randg, randb;
randr = random() % 255;
randg = random() % 255;
randb = random() % 255;
PAINT_BOX(buf, randr, randg, randb, 255, buf->rect.x0, buf->rect.y0, buf->rect.x1, buf->rect.y1);
#endif
gnome_canvas_buf_ensure_buf (buf);
buf->is_bg = FALSE;
}
@ -562,16 +565,18 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
// this can be useful for debugging/understanding how the canvas redraws
// stuff.
// gint randr, randg, randb;
// randr = random() % 255;
// randg = random() % 255;
// randb = random() % 255;
// PAINT_BOX(buf, randr, randg, randb, simplerect->fill_a, begin, sy, end, ey);
#ifdef HARLEQUIN_DEBUGGING
gint randr, randg, randb;
randr = random() % 255;
randg = random() % 255;
randb = random() % 255;
PAINT_BOX(buf, randr, randg, randb, simplerect->fill_a, begin, sy, end, ey);
#else
FAST_PAINT_BOX (buf, simplerect->fill_r, simplerect->fill_g, simplerect->fill_b, simplerect->fill_a,
intersection.x0, intersection.y0,
intersection.x1, intersection.y1);
#endif
}
@ -618,15 +623,13 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
if (buf->is_bg) {
// this can be useful for debugging/understanding how the canvas redraws
// stuff.
// gint randr, randg, randb;
// randr = random() % 255;
// randg = random() % 255;
// randb = random() % 255;
// PAINT_BOX(buf, randr, randg, randb, 255, buf->rect.x0, buf->rect.y0, buf->rect.x1, buf->rect.y1);
#ifdef HARLEQUIN_DEBUGGING
gint randr, randg, randb;
randr = random() % 255;
randg = random() % 255;
randb = random() % 255;
PAINT_BOX(buf, randr, randg, randb, 255, buf->rect.x0, buf->rect.y0, buf->rect.x1, buf->rect.y1);
#endif
gnome_canvas_buf_ensure_buf (buf);
buf->is_bg = FALSE;
}
@ -643,16 +646,15 @@ gnome_canvas_simplerect_render (GnomeCanvasItem *item,
if (simplerect->fill) {
// this can be useful for debugging/understanding how the canvas redraws
// stuff.
// gint randr, randg, randb;
// randr = random() % 255;
// randg = random() % 255;
// randb = random() % 255;
// PAINT_BOX(buf, randr, randg, randb, simplerect->fill_a, begin, sy, end, ey);
#ifdef HARLEQUIN_DEBUGGING
gint randr, randg, randb;
randr = random() % 255;
randg = random() % 255;
randb = random() % 255;
PAINT_BOX(buf, randr, randg, randb, simplerect->fill_a, begin, sy, end, ey);
#else
PAINT_BOX(buf, simplerect->fill_r, simplerect->fill_g, simplerect->fill_b, simplerect->fill_a, begin, sy, end, ey);
#endif
}
for (i = 0; i < simplerect->outline_pixels; ++i) {

View File

@ -608,8 +608,10 @@ Editor::Editor (AudioEngine& eng)
the_notebook.append_page (named_selection_scroller, _("Chunks"));
the_notebook.set_show_tabs (true);
TearOff *notebook_tearoff = manage (new TearOff (the_notebook));
edit_pane.pack1 (edit_frame, true, true);
edit_pane.pack2 (the_notebook, true, true);
edit_pane.pack2 (*notebook_tearoff, true, true);
edit_pane.signal_size_allocate().connect_notify (bind (mem_fun(*this, &Editor::pane_allocation_handler), static_cast<Gtk::Paned*> (&edit_pane)));

View File

@ -111,8 +111,7 @@ Editor::initialize_canvas ()
verbose_canvas_cursor = new ArdourCanvas::Text (*track_canvas.root());
verbose_canvas_cursor->property_font_desc() = font;
// GTK2FIX
// verbose_canvas_cursor->property_anchor() = GTK_ANCHOR_NW;
verbose_canvas_cursor->property_anchor() = ANCHOR_NW;
verbose_canvas_cursor->property_fill_color_rgba() = color_map[cVerboseCanvasCursor];
verbose_cursor_visible = false;
@ -126,7 +125,7 @@ Editor::initialize_canvas ()
time_canvas.add_events (Gdk::POINTER_MOTION_HINT_MASK);
meter_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, 0.0);
tempo_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, 0.0);
tempo_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height);
marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 2.0);
range_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 3.0);
transport_marker_group = new ArdourCanvas::Group (*time_canvas.root(), 0.0, timebar_height * 4.0);

View File

@ -2191,7 +2191,7 @@ Editor::start_tempo_marker_grab (ArdourCanvas::Item* item, GdkEvent* event)
Marker* marker;
TempoMarker* tempo_marker;
if ((marker = reinterpret_cast<Marker *> (item->get_data ("tempo_marker"))) == 0) {
if ((marker = reinterpret_cast<Marker *> (item->get_data ("marker"))) == 0) {
fatal << _("programming error: tempo marker canvas item has no marker object pointer!") << endmsg;
/*NOTREACHED*/
}
@ -4213,8 +4213,7 @@ Editor::end_range_markerbar_op (ArdourCanvas::Item* item, GdkEvent* event)
if (!drag_info.first_move) {
drag_range_markerbar_op (item, event);
switch (range_marker_op)
{
switch (range_marker_op) {
case CreateRangeMarker:
begin_reversible_command (_("new range marker"));
session->add_undo (session->locations()->get_memento());

View File

@ -34,6 +34,7 @@
#include <ardour/session.h>
#include <ardour/tempo.h>
#include <gtkmm2ext/doi.h>
#include <gtkmm2ext/utils.h>
#include "editor.h"
#include "marker.h"
@ -48,6 +49,7 @@ using namespace std;
using namespace sigc;
using namespace ARDOUR;
using namespace Gtk;
using namespace Gtkmm2ext;
using namespace Editing;
void
@ -247,9 +249,7 @@ Editor::mouse_add_new_tempo_event (jack_nframes_t frame)
TempoDialog tempo_dialog (map, frame, _("add"));
tempo_dialog.set_position (Gtk::WIN_POS_MOUSE);
// GTK2FIX
// tempo_dialog.realize ();
// tempo_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
tempo_dialog.signal_realize().connect (bind (sigc::ptr_fun (set_decoration), &tempo_dialog, Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
ensure_float (tempo_dialog);
@ -289,9 +289,7 @@ Editor::mouse_add_new_meter_event (jack_nframes_t frame)
MeterDialog meter_dialog (map, frame, _("add"));
meter_dialog.set_position (Gtk::WIN_POS_MOUSE);
// GTK2FIX
// meter_dialog.realize ();
// meter_dialog.get_window()->set_decorations (Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH));
meter_dialog.signal_realize().connect (bind (sigc::ptr_fun (set_decoration), &meter_dialog, Gdk::WMDecoration (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
ensure_float (meter_dialog);

View File

@ -267,25 +267,10 @@ show_ui_callback (void *arg)
return FALSE;
}
gint
jack_fooey (GdkEventAny* ignored)
{
Main::quit ();
return FALSE;
}
void
jack_foobar ()
{
Main::quit ();
}
void
gui_jack_error ()
{
Window win (Gtk::WINDOW_POPUP);
VBox vpacker;
Button ok (_("OK"));
ArdourDialog win (_("ardour: unplugged"));
Label label (_("Ardour could not connect to JACK.\n\
There are several possible reasons:\n\
\n\
@ -294,24 +279,16 @@ There are several possible reasons:\n\
3) There is already another client called \"ardour\".\n\
\n\
Please consider the possibilities, and perhaps (re)start JACK."));
vpacker.set_spacing (12);
vpacker.pack_start (label);
vpacker.pack_start (ok, false, false);
win.set_title (_("ardour: unplugged"));
win.set_border_width (7);
win.add (vpacker);
win.get_vbox()->pack_start (label);
win.add_button (Stock::OK, RESPONSE_ACCEPT);
win.show_all ();
win.signal_delete_event().connect (sigc::ptr_fun (jack_fooey));
win.add_events (Gdk::BUTTON_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK);
win.set_position (Gtk::WIN_POS_CENTER);
ok.signal_clicked().connect (sigc::ptr_fun (jack_foobar));
ok.grab_focus ();
/* we just don't care about the result */
Main::run ();
win.run ();
}
int
@ -475,14 +452,7 @@ To create it from the command line, start ardour as \"ardour --new %1"), path)
}
}
try {
ui->run (text_receiver);
} catch (...) {
}
ui->run (text_receiver);
ui = 0;
out:

View File

@ -240,10 +240,8 @@ Marker::Marker (PublicEditor& ed, ArdourCanvas::Group& parent, guint32 rgba, con
unit_position -= shift;
group = &parent;
group->property_x() = unit_position;
group->property_y() = 1.0;
// cerr << "set mark al points, nc = " << points->num_points << endl;
group = new Group (parent, unit_position, 1.0);
mark = new Polygon (*group);
mark->property_points() = *points;
mark->property_fill_color_rgba() = rgba;

View File

@ -56,15 +56,6 @@ TempoDialog::init (const BBT_Time& when, double bpm, bool movable)
bpm_frame.add (vspacer1);
button_box.set_border_width (10);
button_box.set_spacing (5);
button_box.set_homogeneous (true);
button_box.pack_start (ok_button);
button_box.pack_start (cancel_button);
vpacker.set_border_width (10);
vpacker.set_spacing (5);
if (movable) {
snprintf (buf, sizeof (buf), "%" PRIu32, when.bars);
when_bar_entry.set_text (buf);
@ -94,18 +85,20 @@ TempoDialog::init (const BBT_Time& when, double bpm, bool movable)
when_frame.set_name ("MetricDialogFrame");
when_frame.add (when_table);
vpacker.pack_start (when_frame, false, false);
get_vbox()->pack_start (when_frame, false, false);
}
vpacker.pack_start (bpm_frame, false, false);
vpacker.pack_start (button_box, false, false);
bpm_frame.set_name ("MetricDialogFrame");
bpm_entry.set_name ("MetricEntry");
ok_button.set_name ("MetricButton");
cancel_button.set_name ("MetricButton");
add (vpacker);
get_vbox()->pack_start (bpm_frame, false, false);
add_button (Stock::OK, RESPONSE_ACCEPT);
add_button (Stock::CANCEL, RESPONSE_CANCEL);
get_vbox()->show_all();
bpm_entry.show();
set_name ("MetricDialog");
}
@ -175,8 +168,6 @@ MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool mova
bpb_entry.select_region (0, -1);
Gtkmm2ext::set_size_request_to_display_given_text (bpb_entry, "999999g", 5, 5);
vector<string> strings;
strings.push_back (_("whole (1)"));
strings.push_back (_("second (2)"));
strings.push_back (_("third (3)"));
@ -250,7 +241,7 @@ MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool mova
when_frame.set_name ("MetricDialogFrame");
when_frame.add (when_table);
vpacker.pack_start (when_frame, false, false);
get_vbox()->pack_start (when_frame, false, false);
}
get_vbox()->pack_start (bpb_frame, false, false);
@ -260,10 +251,12 @@ MeterDialog::init (const BBT_Time& when, double bpb, double note_type, bool mova
note_frame.set_name ("MetricDialogFrame");
bpb_entry.set_name ("MetricEntry");
add_action_widget (bpb_entry, RESPONSE_ACCEPT);
add_button (Stock::OK, RESPONSE_ACCEPT);
add_button (Stock::CANCEL, RESPONSE_CANCEL);
get_vbox()->show_all ();
bpb_entry.show ();
set_name ("MetricDialog");
}
@ -283,7 +276,7 @@ double
MeterDialog::get_note_type ()
{
double note_type = 0;
vector<const gchar *>::iterator i;
vector<string>::iterator i;
string text = note_types.get_active_text();
for (i = strings.begin(); i != strings.end(); ++i) {

View File

@ -47,7 +47,7 @@ struct MeterDialog : public ArdourDialog
{
Gtk::Entry bpb_entry;
Gtk::ComboBoxText note_types;
vector<const gchar *> strings;
vector<string> strings;
Gtk::Frame note_frame;
Gtk::Frame bpb_frame;
Gtk::VBox vpacker;

View File

@ -69,7 +69,7 @@ Location::set_start (jack_nframes_t s)
if (_start != s) {
_start = s;
_end = s;
changed(this); /* EMIT SIGNAL */
start_changed(this); /* EMIT SIGNAL */
}
return 0;
}
@ -80,9 +80,10 @@ Location::set_start (jack_nframes_t s)
if (s != _start) {
_start = s;
start_changed(this); /* EMIT SIGNAL */
start_changed(this); /* EMIT SIGNAL */
}
return 0;
return 0;
}
int
@ -92,7 +93,7 @@ Location::set_end (jack_nframes_t e)
if (_start != e) {
_start = e;
_end = e;
changed(this); /* EMIT SIGNAL */
end_changed(this); /* EMIT SIGNAL */
}
return 0;
}
@ -117,10 +118,14 @@ Location::set (jack_nframes_t start, jack_nframes_t end)
return -1;
}
if (_start != start || _end != end) {
if (_start != start) {
_start = start;
start_changed(this); /* EMIT SIGNAL */
}
if (_end != end) {
_end = end;
changed(this); /* EMIT SIGNAL */
end_changed(this); /* EMIT SIGNAL */
}
return 0;
}
@ -467,8 +472,6 @@ Locations::add (Location *loc, bool make_current)
LockMonitor lm (lock, __LINE__, __FILE__);
locations.push_back (loc);
loc->changed.connect (mem_fun (*this, &Locations::location_changed));
if (make_current) {
current_location = loc;
}
@ -525,7 +528,7 @@ Locations::remove (Location *loc)
}
void
Locations::location_changed (Location* ignored)
Locations::location_changed (Location* loc)
{
save_state (X_("location changed"));
changed (); /* EMIT SIGNAL */