1
/* wavpack_header.c - 2007/02/15 */
3
* EasyTAG - Tag editor for many file types
4
* Copyright (C) 2007 Maarten Maathuis (madman2003@gmail.com)
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
#include <glib/gi18n-lib.h>
30
#include <wavpack/wavpack.h>
36
#include "wavpack_header.h"
39
gboolean Wavpack_Header_Read_File_Info(gchar *filename, ET_File_Info *ETFileInfo)
43
wpc = WavpackOpenFileInput(filename, NULL, 0, 0);
49
ETFileInfo->version = WavpackGetVersion(wpc);
50
/* .wvc correction file not counted */
51
ETFileInfo->bitrate = WavpackGetAverageBitrate(wpc, 0)/1000;
52
ETFileInfo->samplerate = WavpackGetSampleRate(wpc);
53
ETFileInfo->mode = WavpackGetNumChannels(wpc);
54
ETFileInfo->size = WavpackGetFileSize(wpc);
55
ETFileInfo->duration = WavpackGetNumSamples(wpc)/ETFileInfo->samplerate;
57
WavpackCloseFile(wpc);
63
gboolean Wavpack_Header_Display_File_Info_To_UI(gchar *filename_utf8, ET_File_Info *ETFileInfo)
72
gtk_label_set_text(GTK_LABEL(VersionLabel),_("Encoder:"));
73
text = g_strdup_printf("%d",ETFileInfo->version);
74
gtk_label_set_text(GTK_LABEL(VersionValueLabel),text);
78
text = g_strdup_printf(_("%d kb/s"),ETFileInfo->bitrate);
79
gtk_label_set_text(GTK_LABEL(BitrateValueLabel),text);
83
text = g_strdup_printf(_("%d Hz"),ETFileInfo->samplerate);
84
gtk_label_set_text(GTK_LABEL(SampleRateValueLabel),text);
88
gtk_label_set_text(GTK_LABEL(ModeLabel),_("Channels:"));
89
text = g_strdup_printf("%d",ETFileInfo->mode);
90
gtk_label_set_text(GTK_LABEL(ModeValueLabel),text);
94
size = Convert_Size(ETFileInfo->size);
95
size1 = Convert_Size(ETCore->ETFileDisplayedList_TotalSize);
96
text = g_strdup_printf("%s (%s)",size,size1);
97
gtk_label_set_text(GTK_LABEL(SizeValueLabel),text);
103
time = Convert_Duration(ETFileInfo->duration);
104
time1 = Convert_Duration(ETCore->ETFileDisplayedList_TotalDuration);
105
text = g_strdup_printf("%s (%s)",time,time1);
106
gtk_label_set_text(GTK_LABEL(DurationValueLabel),text);
114
#endif /* ENABLE_FLAC */