src/xi.c : Expose string info for application and title.

Based on a patch from Stefan Sauer <ensonic@users.sf.net>.

Closes: https://github.com/erikd/libsndfile/pull/53
This commit is contained in:
Erik de Castro Lopo 2013-12-22 11:45:01 +11:00
parent f6c5617f1a
commit 13e58306ca

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2003-2012 Erik de Castro Lopo <erikd@mega-nerd.com>
** Copyright (C) 2003-2013 Erik de Castro Lopo <erikd@mega-nerd.com>
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
@ -352,11 +352,19 @@ xi_read_header (SF_PRIVATE *psf)
return SFE_XI_BAD_HEADER ;
buffer [22] = 0 ;
for (k = 21 ; k >= 0 && buffer [k] == ' ' ; k --)
buffer [k] = 0 ;
psf_log_printf (psf, "Extended Instrument : %s\n", buffer) ;
psf_store_string (psf, SF_STR_TITLE, buffer) ;
psf_binheader_readf (psf, "be2", buffer, 20, &version) ;
buffer [19] = 0 ;
for (k = 18 ; k >= 0 && buffer [k] == ' ' ; k --)
buffer [k] = 0 ;
psf_log_printf (psf, "Software : %s\nVersion : %d.%02d\n", buffer, version / 256, version % 256) ;
psf_store_string (psf, SF_STR_SOFTWARE, buffer) ;
/* Jump note numbers (96), volume envelope (48), pan envelope (48),
** volume points (1), pan points (1)