spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 38cc7f2343a14150e7554b98581579b94f12ffc7
parent 98b2cb0ab868bcae5a8cbce73672b3ef435ca4f5
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Wed, 15 Aug 2012 09:54:40 -0700

Draw file properties

Diffstat:
Msrc/spek-spectrogram.cc | 10++++++++++
Msrc/spek-spectrogram.vala | 19-------------------
2 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/src/spek-spectrogram.cc b/src/spek-spectrogram.cc @@ -136,6 +136,16 @@ void SpekSpectrogram::render(wxDC& dc) // Draw the spectrogram. wxBitmap bmp(this->image.Scale(w - LPAD - RPAD, h - TPAD - BPAD /*TODO:, wxIMAGE_QUALITY_HIGH*/)); dc.DrawBitmap(bmp, LPAD, TPAD); + + // File name. + dc.SetFont(large_font); + // TODO: ellipsize + dc.DrawText(this->path, LPAD, TPAD - 2 * GAP - normal_height - large_height); + + // File properties. + dc.SetFont(normal_font); + // TODO: ellipsize + dc.DrawText(this->desc, LPAD, TPAD - GAP - normal_height); } // Border around the spectrogram. diff --git a/src/spek-spectrogram.vala b/src/spek-spectrogram.vala @@ -92,25 +92,6 @@ namespace Spek { cr.translate (LPAD, TPAD); rate_ruler.draw (cr, layout); cr.identity_matrix (); - - // File properties. - cr.move_to (LPAD, TPAD - GAP); - layout.set_font_description (FontDescription.from_string ( - "Sans " + (9 * FONT_SCALE).to_string ())); - layout.set_width ((int) (w - LPAD - RPAD) * Pango.SCALE); - layout.set_ellipsize (EllipsizeMode.END); - layout.set_text (info, -1); - cairo_show_layout_line (cr, layout.get_line (0)); - layout.get_pixel_size (out text_width, out text_height); - - // File name. - cr.move_to (LPAD, TPAD - 2 * GAP - text_height); - layout.set_font_description (FontDescription.from_string ( - "Sans Bold " + (10 * FONT_SCALE).to_string ())); - layout.set_width ((int) (w - LPAD - RPAD) * Pango.SCALE); - layout.set_ellipsize (EllipsizeMode.START); - layout.set_text (file_name, -1); - cairo_show_layout_line (cr, layout.get_line (0)); } // Prepare to draw the ruler.