summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-10-10 17:46:22 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-10-10 17:46:22 +0000
commitf95d814143060efc7a69164362a3311b3a3b54a4 (patch)
treec1a4dffddbc1a0888b9c423aebff899ac29fc06e
parent6c56eb646b9c00f4c38c56717d0f5419f1b0d07b (diff)
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
-rw-r--r--gtk2_ardour/SConscript5
-rwxr-xr-xgtk2_ardour/ardev_common.sh2
-rw-r--r--gtk2_ardour/ardour_ui2.cc16
-rw-r--r--gtk2_ardour/audio_clock.cc83
-rw-r--r--gtk2_ardour/audio_clock.h1
-rw-r--r--gtk2_ardour/editor.cc20
-rw-r--r--gtk2_ardour/icons/nudge_left.pngbin0 -> 263 bytes
-rw-r--r--gtk2_ardour/icons/nudge_right.pngbin0 -> 252 bytes
-rw-r--r--gtk2_ardour/icons/tool_audition.pngbin0 -> 314 bytes
-rw-r--r--gtk2_ardour/icons/tool_gain.pngbin0 -> 417 bytes
-rw-r--r--gtk2_ardour/icons/tool_object.pngbin0 -> 461 bytes
-rw-r--r--gtk2_ardour/icons/tool_object.xpm54
-rw-r--r--gtk2_ardour/icons/tool_stretch.pngbin0 -> 284 bytes
-rw-r--r--gtk2_ardour/icons/tool_zoom.pngbin0 -> 355 bytes
-rw-r--r--gtk2_ardour/icons/transport_end.pngbin0 -> 284 bytes
-rw-r--r--gtk2_ardour/icons/transport_loop.pngbin0 -> 472 bytes
-rw-r--r--gtk2_ardour/icons/transport_play.pngbin0 -> 267 bytes
-rw-r--r--gtk2_ardour/icons/transport_range.pngbin0 -> 277 bytes
-rw-r--r--gtk2_ardour/icons/transport_record.pngbin0 -> 344 bytes
-rw-r--r--gtk2_ardour/icons/transport_start.pngbin0 -> 320 bytes
-rw-r--r--gtk2_ardour/icons/transport_stop.pngbin0 -> 203 bytes
-rw-r--r--gtk2_ardour/icons/tw_edit_icons_07.xcfbin0 -> 5600 bytes
-rw-r--r--gtk2_ardour/icons/zoom_full.pngbin0 -> 365 bytes
-rw-r--r--gtk2_ardour/icons/zoom_in.pngbin0 -> 354 bytes
-rw-r--r--gtk2_ardour/icons/zoom_out.pngbin0 -> 346 bytes
-rw-r--r--gtk2_ardour/utils.cc16
-rw-r--r--gtk2_ardour/utils.h3
27 files changed, 137 insertions, 63 deletions
diff --git a/gtk2_ardour/SConscript b/gtk2_ardour/SConscript
index 072965ca94..b60e6f00c6 100644
--- a/gtk2_ardour/SConscript
+++ b/gtk2_ardour/SConscript
@@ -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 +
diff --git a/gtk2_ardour/ardev_common.sh b/gtk2_ardour/ardev_common.sh
index df4bb025c0..165db68369 100755
--- a/gtk2_ardour/ardev_common.sh
+++ b/gtk2_ardour/ardev_common.sh
@@ -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
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index 337362d9da..9a964fe519 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -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);
diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc
index d04285c5ef..575f45ca38 100644
--- a/gtk2_ardour/audio_clock.cc
+++ b/gtk2_ardour/audio_clock.cc
@@ -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;
+
+ }
+}
diff --git a/gtk2_ardour/audio_clock.h b/gtk2_ardour/audio_clock.h
index d55a4b8610..e0431ba16e 100644
--- a/gtk2_ardour/audio_clock.h
+++ b/gtk2_ardour/audio_clock.h
@@ -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];
};
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index ecf3870c7f..ed09a03597 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -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"));
diff --git a/gtk2_ardour/icons/nudge_left.png b/gtk2_ardour/icons/nudge_left.png
new file mode 100644
index 0000000000..c88547771a
--- /dev/null
+++ b/gtk2_ardour/icons/nudge_left.png
Binary files differ
diff --git a/gtk2_ardour/icons/nudge_right.png b/gtk2_ardour/icons/nudge_right.png
new file mode 100644
index 0000000000..a6c1581363
--- /dev/null
+++ b/gtk2_ardour/icons/nudge_right.png
Binary files differ
diff --git a/gtk2_ardour/icons/tool_audition.png b/gtk2_ardour/icons/tool_audition.png
new file mode 100644
index 0000000000..65f52e1fb0
--- /dev/null
+++ b/gtk2_ardour/icons/tool_audition.png
Binary files differ
diff --git a/gtk2_ardour/icons/tool_gain.png b/gtk2_ardour/icons/tool_gain.png
new file mode 100644
index 0000000000..f54be9403a
--- /dev/null
+++ b/gtk2_ardour/icons/tool_gain.png
Binary files differ
diff --git a/gtk2_ardour/icons/tool_object.png b/gtk2_ardour/icons/tool_object.png
new file mode 100644
index 0000000000..0b5739e5a9
--- /dev/null
+++ b/gtk2_ardour/icons/tool_object.png
Binary files differ
diff --git a/gtk2_ardour/icons/tool_object.xpm b/gtk2_ardour/icons/tool_object.xpm
new file mode 100644
index 0000000000..b6b2fea299
--- /dev/null
+++ b/gtk2_ardour/icons/tool_object.xpm
@@ -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- "};
diff --git a/gtk2_ardour/icons/tool_stretch.png b/gtk2_ardour/icons/tool_stretch.png
new file mode 100644
index 0000000000..a599fbe51d
--- /dev/null
+++ b/gtk2_ardour/icons/tool_stretch.png
Binary files differ
diff --git a/gtk2_ardour/icons/tool_zoom.png b/gtk2_ardour/icons/tool_zoom.png
new file mode 100644
index 0000000000..f6b5e2781d
--- /dev/null
+++ b/gtk2_ardour/icons/tool_zoom.png
Binary files differ
diff --git a/gtk2_ardour/icons/transport_end.png b/gtk2_ardour/icons/transport_end.png
new file mode 100644
index 0000000000..d9cc8a1721
--- /dev/null
+++ b/gtk2_ardour/icons/transport_end.png
Binary files differ
diff --git a/gtk2_ardour/icons/transport_loop.png b/gtk2_ardour/icons/transport_loop.png
new file mode 100644
index 0000000000..1ea8fdaf18
--- /dev/null
+++ b/gtk2_ardour/icons/transport_loop.png
Binary files differ
diff --git a/gtk2_ardour/icons/transport_play.png b/gtk2_ardour/icons/transport_play.png
new file mode 100644
index 0000000000..5e0c2dcd78
--- /dev/null
+++ b/gtk2_ardour/icons/transport_play.png
Binary files differ
diff --git a/gtk2_ardour/icons/transport_range.png b/gtk2_ardour/icons/transport_range.png
new file mode 100644
index 0000000000..a46ea1a6ef
--- /dev/null
+++ b/gtk2_ardour/icons/transport_range.png
Binary files differ
diff --git a/gtk2_ardour/icons/transport_record.png b/gtk2_ardour/icons/transport_record.png
new file mode 100644
index 0000000000..1d9ecf91f7
--- /dev/null
+++ b/gtk2_ardour/icons/transport_record.png
Binary files differ
diff --git a/gtk2_ardour/icons/transport_start.png b/gtk2_ardour/icons/transport_start.png
new file mode 100644
index 0000000000..d27bcb5b8d
--- /dev/null
+++ b/gtk2_ardour/icons/transport_start.png
Binary files differ
diff --git a/gtk2_ardour/icons/transport_stop.png b/gtk2_ardour/icons/transport_stop.png
new file mode 100644
index 0000000000..a92a2ca64e
--- /dev/null
+++ b/gtk2_ardour/icons/transport_stop.png
Binary files differ
diff --git a/gtk2_ardour/icons/tw_edit_icons_07.xcf b/gtk2_ardour/icons/tw_edit_icons_07.xcf
new file mode 100644
index 0000000000..fefae94082
--- /dev/null
+++ b/gtk2_ardour/icons/tw_edit_icons_07.xcf
Binary files differ
diff --git a/gtk2_ardour/icons/zoom_full.png b/gtk2_ardour/icons/zoom_full.png
new file mode 100644
index 0000000000..fdb2e1dcf2
--- /dev/null
+++ b/gtk2_ardour/icons/zoom_full.png
Binary files differ
diff --git a/gtk2_ardour/icons/zoom_in.png b/gtk2_ardour/icons/zoom_in.png
new file mode 100644
index 0000000000..b3ef4e8ac8
--- /dev/null
+++ b/gtk2_ardour/icons/zoom_in.png
Binary files differ
diff --git a/gtk2_ardour/icons/zoom_out.png b/gtk2_ardour/icons/zoom_out.png
new file mode 100644
index 0000000000..50effceb78
--- /dev/null
+++ b/gtk2_ardour/icons/zoom_out.png
Binary files differ
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index 1e283a6973..76b237713a 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -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)
{
diff --git a/gtk2_ardour/utils.h b/gtk2_ardour/utils.h
index a48a32c10e..bb2a21d6c3 100644
--- a/gtk2_ardour/utils.h
+++ b/gtk2_ardour/utils.h
@@ -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>&);