fix audio clock field widths, change minsec display to include fractional seconds, add and use thorwil's new icons

git-svn-id: svn://localhost/ardour2/trunk@971 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-10-10 17:46:22 +00:00
parent 6c56eb646b
commit f95d814143
27 changed files with 137 additions and 63 deletions

View File

@ -206,7 +206,8 @@ fft_graph.cc
fft_result.cc
""")
pixmap_files=glob.glob('pixmaps/*.xpm')
pixmap_files = glob.glob('pixmaps/*.xpm')
icon_files = glob.glob ('icons/*.png')
intl_files = gtkardour_files + glob.glob('*.h')
@ -304,6 +305,7 @@ env.Alias('install', env.Install(os.path.join(config_prefix, 'ardour2'), 'ardour
# data files
env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2'), 'splash.ppm'))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/pixmaps'), pixmap_files))
env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/icons'), icon_files))
#dist
@ -318,6 +320,7 @@ env.Alias ('tarball', env.Distribute (env['DISTTREE'],
gtkardour_files +
vst_files +
pixmap_files +
icon_files +
skipped_files +
audiounit_files +
fft_analysis_files +

View File

@ -2,7 +2,7 @@ cd `dirname "$0"`/..
#export G_DEBUG=fatal_criticals
export ARDOUR_PATH=gtk2_ardour/glade:gtk2_ardour/pixmaps:gtk2_ardour
export ARDOUR_PATH=gtk2_ardour/icons:gtk2_ardour/pixmaps:gtk2_ardour
export LD_LIBRARY_PATH=libs/surfaces/control_protocol:libs/ardour:libs/midi++2:libs/pbd:libs/soundtouch:libs/gtkmm2ext:libs/sigc++2:libs/glibmm2:libs/gtkmm2/atk:libs/gtkmm2/pango:libs/gtkmm2/gdk:libs/gtkmm2/gtk:libs/libgnomecanvasmm:libs/libsndfile:libs/appleutility:$LD_LIBRARY_PATH

View File

@ -242,26 +242,26 @@ ARDOUR_UI::setup_transport ()
Widget* w;
stop_button.set_active (true);
w = manage (new Image (Stock::MEDIA_PREVIOUS, ICON_SIZE_BUTTON));
w = manage (new Image (get_icon (X_("transport_start"))));
w->show();
goto_start_button.add (*w);
w = manage (new Image (Stock::MEDIA_NEXT, ICON_SIZE_BUTTON));
w = manage (new Image (get_icon (X_("transport_end"))));
w->show();
goto_end_button.add (*w);
w = manage (new Image (Stock::MEDIA_PLAY, ICON_SIZE_BUTTON));
w = manage (new Image (get_icon (X_("transport_play"))));
w->show();
roll_button.add (*w);
w = manage (new Image (Stock::MEDIA_STOP, ICON_SIZE_BUTTON));
w = manage (new Image (get_icon (X_("transport_stop"))));
w->show();
stop_button.add (*w);
w = manage (new Image (Stock::MEDIA_PLAY, ICON_SIZE_BUTTON));
w = manage (new Image (get_icon (X_("transport_range"))));
w->show();
play_selection_button.add (*w);
w = manage (new Image (Stock::MEDIA_RECORD, ICON_SIZE_BUTTON));
w = manage (new Image (get_icon (X_("transport_record"))));
w->show();
rec_button.add (*w);
w = manage (new Image (get_xpm("loop.xpm")));
w = manage (new Image (get_icon (X_("transport_loop"))));
w->show();
auto_loop_button.add (*w);

View File

@ -326,34 +326,7 @@ AudioClock::on_realize ()
/* styles are not available until the widgets are bound to a window */
switch (_mode) {
case SMPTE:
Gtkmm2ext::set_size_request_to_display_given_text (hours_label, "-88", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (minutes_label, "88", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (seconds_label, "88", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (frames_label, "88", 0, 2);
break;
case BBT:
Gtkmm2ext::set_size_request_to_display_given_text (bars_label, "-888", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (beats_label, "88", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ticks_label, "8888", 0, 2);
break;
case MinSec:
Gtkmm2ext::set_size_request_to_display_given_text (ms_hours_label, "99", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ms_minutes_label, "99", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ms_seconds_label, "99", 0, 2);
break;
case Frames:
Gtkmm2ext::set_size_request_to_display_given_text (audio_frames_label, "4294967296", 0, 2);
break;
case Off:
break;
}
set_size_requests ();
}
void
@ -436,13 +409,13 @@ AudioClock::set_minsec (nframes_t when, bool force)
secs = left / (float) session->frame_rate();
if (force || hrs != ms_last_hrs) {
sprintf (buf, "%d", hrs);
sprintf (buf, "%02d", hrs);
ms_hours_label.set_text (buf);
ms_last_hrs = hrs;
}
if (force || mins != ms_last_mins) {
sprintf (buf, "%d", mins);
sprintf (buf, "%02d", mins);
ms_minutes_label.set_text (buf);
ms_last_mins = mins;
}
@ -1775,40 +1748,66 @@ AudioClock::set_mode (Mode m)
}
_mode = m;
switch (_mode) {
case SMPTE:
clock_base.add (smpte_packer_hbox);
Gtkmm2ext::set_size_request_to_display_given_text (hours_label, "-88", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (minutes_label, "88", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (seconds_label, "88", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (frames_label, "88", 0, 2);
break;
case BBT:
clock_base.add (bbt_packer_hbox);
Gtkmm2ext::set_size_request_to_display_given_text (bars_label, "-888", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (beats_label, "88", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ticks_label, "8888", 0, 2);
break;
case MinSec:
clock_base.add (minsec_packer_hbox);
Gtkmm2ext::set_size_request_to_display_given_text (ms_hours_label, "99", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ms_minutes_label, "99", 0, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ms_seconds_label, "99", 0, 2);
break;
case Frames:
clock_base.add (frames_packer_hbox);
Gtkmm2ext::set_size_request_to_display_given_text (audio_frames_label, "4294967296", 0, 2);
break;
case Off:
break;
}
set_size_requests ();
set (last_when, true);
clock_base.show_all ();
key_entry_state = 0;
}
void
AudioClock::set_size_requests ()
{
/* note that in some fonts, "88" is narrower than "00", hence the 2 pixel padding */
switch (_mode) {
case SMPTE:
Gtkmm2ext::set_size_request_to_display_given_text (hours_label, "-88", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (minutes_label, "88", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (seconds_label, "88", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (frames_label, "88", 2, 2);
break;
case BBT:
Gtkmm2ext::set_size_request_to_display_given_text (bars_label, "-888", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (beats_label, "88", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ticks_label, "8888", 2, 2);
break;
case MinSec:
Gtkmm2ext::set_size_request_to_display_given_text (ms_hours_label, "99", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ms_minutes_label, "99", 2, 2);
Gtkmm2ext::set_size_request_to_display_given_text (ms_seconds_label, "99.999", 2, 2);
break;
case Frames:
Gtkmm2ext::set_size_request_to_display_given_text (audio_frames_label, "4294967296", 2, 2);
break;
case Off:
break;
}
}

View File

@ -176,6 +176,7 @@ class AudioClock : public Gtk::HBox
void setup_events ();
void smpte_offset_changed ();
void set_size_requests ();
static const uint32_t field_length[(int)AudioFrames+1];
};

View File

@ -666,8 +666,8 @@ Editor::Editor (AudioEngine& eng)
/* nudge stuff */
nudge_forward_button.add (*(manage (new Image (get_xpm("right_arrow.xpm")))));
nudge_backward_button.add (*(manage (new Image (get_xpm("left_arrow.xpm")))));
nudge_forward_button.add (*(manage (new Image (::get_icon("nudge_right")))));
nudge_backward_button.add (*(manage (new Image (::get_icon("nudge_left")))));
ARDOUR_UI::instance()->tooltips().set_tip (nudge_forward_button, _("Nudge Region/Selection Forwards"));
ARDOUR_UI::instance()->tooltips().set_tip (nudge_backward_button, _("Nudge Region/Selection Backwards"));
@ -2468,22 +2468,22 @@ Editor::setup_toolbar ()
vector<ToggleButton *> mouse_mode_buttons;
mouse_move_button.add (*(manage (new Image (get_xpm("tool_object.xpm")))));
mouse_move_button.add (*(manage (new Image (::get_icon("tool_object")))));
mouse_move_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_move_button);
mouse_select_button.add (*(manage (new Image (get_xpm("tool_range.xpm")))));
mouse_select_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_select_button);
mouse_gain_button.add (*(manage (new Image (get_xpm("tool_gain.xpm")))));
mouse_gain_button.add (*(manage (new Image (::get_icon("tool_gain")))));
mouse_gain_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_gain_button);
mouse_zoom_button.add (*(manage (new Image (get_xpm("tool_zoom.xpm")))));
mouse_zoom_button.add (*(manage (new Image (::get_icon("tool_zoom")))));
mouse_zoom_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_zoom_button);
mouse_timefx_button.add (*(manage (new Image (get_xpm("tool_stretch.xpm")))));
mouse_timefx_button.add (*(manage (new Image (::get_icon("tool_stretch")))));
mouse_timefx_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_timefx_button);
mouse_audition_button.add (*(manage (new Image (get_xpm("tool_audition.xpm")))));
mouse_audition_button.add (*(manage (new Image (::get_icon("tool_audition")))));
mouse_audition_button.set_relief(Gtk::RELIEF_NONE);
mouse_mode_buttons.push_back (&mouse_audition_button);
@ -2564,17 +2564,17 @@ Editor::setup_toolbar ()
zoom_box.set_border_width (2);
zoom_in_button.set_name ("EditorTimeButton");
zoom_in_button.add (*(manage (new Image (get_xpm("zoom_in.xpm")))));
zoom_in_button.add (*(manage (new Image (::get_icon("zoom_in")))));
zoom_in_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::temporal_zoom_step), false));
ARDOUR_UI::instance()->tooltips().set_tip (zoom_in_button, _("Zoom In"));
zoom_out_button.set_name ("EditorTimeButton");
zoom_out_button.add (*(manage (new Image (get_xpm("zoom_out.xpm")))));
zoom_out_button.add (*(manage (new Image (::get_icon("zoom_out")))));
zoom_out_button.signal_clicked().connect (bind (mem_fun(*this, &Editor::temporal_zoom_step), true));
ARDOUR_UI::instance()->tooltips().set_tip (zoom_out_button, _("Zoom Out"));
zoom_out_full_button.set_name ("EditorTimeButton");
zoom_out_full_button.add (*(manage (new Image (get_xpm("zoom_full.xpm")))));
zoom_out_full_button.add (*(manage (new Image (::get_icon("zoom_full")))));
zoom_out_full_button.signal_clicked().connect (mem_fun(*this, &Editor::temporal_zoom_session));
ARDOUR_UI::instance()->tooltips().set_tip (zoom_out_full_button, _("Zoom to Session"));

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

View File

@ -0,0 +1,54 @@
/* XPM */
static char * tool_object_xpm[] = {
"16 12 39 1",
" c None",
". c #000000",
"+ c #0C0C0C",
"@ c #151515",
"# c #D1D1D1",
"$ c #121212",
"% c #161616",
"& c #DADADA",
"* c #131313",
"= c #D6D6D6",
"- c #0F0F0F",
"; c #050505",
"> c #D3D3D3",
", c #0A0A0A",
"' c #070707",
") c #E5E5E5",
"! c #292929",
"~ c #B0B0B0",
"{ c #262626",
"] c #5C5C5C",
"^ c #333333",
"/ c #0E0E0E",
"( c #111111",
"_ c #3D3D3D",
": c #F4F4F4",
"< c #FFFFFF",
"[ c #EBEBEB",
"} c #D0D0D0",
"| c #030303",
"1 c #F1F1F1",
"2 c #FDFDFD",
"3 c #C3C3C3",
"4 c #101010",
"5 c #141414",
"6 c #F2F2F2",
"7 c #4E4E4E",
"8 c #686868",
"9 c #0B0B0B",
"0 c #020202",
" .+. ",
" @#$ ",
" %&* ",
" +=-.. ",
" ;>.,,-.. ",
" .')!~{]^/ ",
" (_:<<<[}| ",
" '12<<<<<| ",
" -~<<<<<34 ",
" .56<<<<7| ",
" /8<<<),. ",
" .9|||0- "};

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 354 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 346 B

View File

@ -468,6 +468,22 @@ get_xpm (std::string name)
return (xpm_map[name]);
}
Glib::RefPtr<Gdk::Pixbuf>
get_icon (const char* cname)
{
string name = cname;
name += X_(".png");
string path = ARDOUR::find_data_file (name, "icons");
if (path.empty()) {
fatal << string_compose (_("cannot find icon image for %1"), name) << endmsg;
/*NOTREACHED*/
}
return Gdk::Pixbuf::create_from_file (path);
}
string
longest (vector<string>& strings)
{

View File

@ -76,7 +76,8 @@ void set_color (Gdk::Color&, int);
bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev);
Glib::RefPtr<Gdk::Pixbuf> get_xpm(std::string);
Glib::RefPtr<Gdk::Pixbuf> get_xpm (std::string);
Glib::RefPtr<Gdk::Pixbuf> get_icon (const char*);
static std::map<std::string, Glib::RefPtr<Gdk::Pixbuf> > xpm_map;
const char* const *get_xpm_data (std::string path);
std::string longest (std::vector<std::string>&);