annotate Plugins/Input/wma/wma.c @ 138:afcdbd5aef24 trunk

[svn] Rename bmp-wma.c to wma.c.
author nenolod
date Thu, 10 Nov 2005 14:57:56 -0800
parents Plugins/Input/wma/bmp-wma.c@b8d4c1faa6d7
children 15c2210499ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
137
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
1 /*
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
2 * Audacious, a cross-platform multimedia player.
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
3 * Copyright (C) 2005 Audacious Team
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
4 *
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
5 * Based on BMP-WMA:
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
6 * Copyright (C) 2004 Roman Bogorodskiy <bogorodskiy@inbox.ru>
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
7 *
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
8 * This program is free software; you can redistribute it and/or modify
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
9 * it under the terms of the GNU General Public License as published by
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
11 * (at your option) any later version.
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
12 *
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
16 * GNU General Public License for more details.
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
17 *
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
18 * You should have received a copy of the GNU General Public License
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
19 * along with this program; if not, write to the Free Software
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
21 */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
22
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
23 #ifdef HAVE_MALLOC_H
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
24 #include <malloc.h>
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
25 #endif
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
26 #include <pthread.h>
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
27
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
28 #include <glib.h>
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
29 #include <glib/gprintf.h>
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
30
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
31 #include <audacious/plugin.h>
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
32 #include <audacious/configfile.h>
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
33 #include <audacious/util.h>
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
34 #include <audacious/titlestring.h>
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
35 #include <audacious/vfs.h>
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
36
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
37 #ifdef HAVE_CONFIG_H
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
38 # include "config.h"
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
39 #endif
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
40
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
41 #include "avcodec.h"
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
42 #include "avformat.h"
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
43 #include "iir.h"
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
44
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
45 #define ST_BUFF 1024
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
46
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
47 static GtkWidget *about_dialog;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
48 static GtkWidget *dialog;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
49
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
50 static gboolean wma_decode = 0;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
51 static gboolean wma_pause = 0;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
52 static gboolean wma_eq_on = 0;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
53 static int wma_seekpos = -1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
54 static int wma_st_buff, wma_idx;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
55 static pthread_t wma_decode_thread;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
56 static pthread_mutex_t wma_mutex = PTHREAD_MUTEX_INITIALIZER;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
57 static AVCodecContext *c = NULL;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
58 static AVFormatContext *ic = NULL;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
59 static uint8_t *wma_outbuf, *wma_s_outbuf;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
60
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
61 char description[64];
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
62 static void wma_about(void);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
63 static void wma_init(void);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
64 static int wma_is_our_file(char *filename);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
65 static void wma_play_file(char *filename);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
66 static void wma_stop(void);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
67 static void wma_seek(int time);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
68 static void wma_do_pause(short p);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
69 static int wma_get_time(void);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
70 static void wma_get_song_info(char *filename, char **title, int *length);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
71 static void wma_file_info_box(char *filename);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
72 static void wma_set_eq(int q_on, float q_preamp, float *q_bands);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
73 static char *wsong_title;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
74 static int wsong_time;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
75
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
76 InputPlugin *get_iplugin_info(void);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
77
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
78 InputPlugin wma_ip =
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
79 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
80 NULL, /* Filled in by xmms */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
81 NULL, /* Filled in by xmms */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
82 description, /* The description that is shown in the preferences box */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
83 wma_init, /* Called when the plugin is loaded */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
84 wma_about, /* Show the about box */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
85 NULL, /* Show the configure box */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
86 wma_is_our_file, /* Return 1 if the plugin can handle the file */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
87 NULL, /* Scan dir */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
88 wma_play_file, /* Play file */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
89 wma_stop, /* Stop */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
90 wma_do_pause, /* Pause */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
91 wma_seek, /* Seek */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
92 wma_set_eq, /* Set the equalizer, most plugins won't be able to do this */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
93 wma_get_time, /* Get the time, usually returns the output plugins output time */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
94 NULL, /* Get volume */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
95 NULL, /* Set volume */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
96 NULL, /* OBSOLETE! */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
97 NULL, /* OBSOLETE! */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
98 NULL, /* Send data to the visualization plugins */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
99 NULL, /* Fill in the stuff that is shown in the player window */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
100 NULL, /* Show some text in the song title box. */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
101 wma_get_song_info, /* Function to grab the title string */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
102 wma_file_info_box, /* Bring up an info window for the filename passed in */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
103 NULL /* Handle to the current output plugin. */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
104 };
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
105
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
106 InputPlugin *get_iplugin_info(void)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
107 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
108 wma_ip.description = g_strdup_printf("WMA Audio Plugin");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
109 return &wma_ip;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
110 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
111
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
112 static void wma_about(void)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
113 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
114 static GtkWidget *aboutbox;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
115 gchar *text;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
116
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
117 if (aboutbox)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
118 return;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
119
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
120 text = g_strdup_printf("WMA Plugin %s\n\n"
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
121 "Created by Roman Bogorodskiy <bogorodskiy@inbox.ru>\n"
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
122 "Based on xmms-wma written by Mokrushin I.V. aka McMCC <mcmcc@mail.ru>\n"
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
123 "See AUTHORS for details\n",
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
124 VERSION);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
125
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
126 aboutbox = xmms_show_message("About the WMA decoder",
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
127 text,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
128 "OK", FALSE, NULL, NULL);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
129
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
130 g_free(text);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
131 gtk_signal_connect(GTK_OBJECT(aboutbox), "destroy",
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
132 GTK_SIGNAL_FUNC(gtk_widget_destroyed), &aboutbox);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
133 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
134
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
135 static void wma_init(void)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
136 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
137
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
138 avcodec_init();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
139 avcodec_register_all();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
140 av_register_all();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
141 init_iir();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
142 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
143
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
144 static int wma_is_our_file(char *filename)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
145 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
146 gchar *ext;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
147 ext = strrchr(filename, '.');
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
148
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
149 if (ext)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
150 if (!strncasecmp(ext, ".wma", 4))
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
151 return TRUE;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
152
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
153 return FALSE;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
154 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
155
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
156 static void wma_do_pause(short p)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
157 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
158
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
159 wma_pause = p;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
160 wma_ip.output->pause(wma_pause);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
161 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
162
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
163 static void wma_seek(int time)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
164 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
165 wma_seekpos = time;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
166 if (wma_pause)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
167 wma_ip.output->pause(0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
168
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
169 while (wma_decode && wma_seekpos!=-1)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
170 xmms_usleep(10000);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
171
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
172 if (wma_pause)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
173 wma_ip.output->pause(1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
174 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
175
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
176 static int wma_get_time(void)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
177 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
178 wma_ip.output->buffer_free();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
179 if (wma_decode)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
180 return wma_ip.output->output_time();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
181
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
182 return -1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
183 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
184
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
185 static void wma_set_eq(int q_on, float q_preamp, float *q_bands)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
186 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
187 int chn;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
188 int index;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
189 float value;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
190
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
191 wma_eq_on = q_on;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
192
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
193 if (wma_eq_on) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
194 q_preamp = q_preamp/1.6;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
195 for (chn = 0; chn < c->channels; chn++)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
196 preamp[chn] = 1.0 + 0.0932471 * q_preamp + 0.00279033 * q_preamp * q_preamp;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
197
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
198 for (index = 0; index < 10; index++) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
199 value = q_bands[index]/1.2;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
200
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
201 for (chn = 0; chn < c->channels; chn++)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
202 gain[index][chn] = 0.03 * value + 0.000999999 * value * value;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
203 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
204 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
205 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
206
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
207 static gchar *extname(const char *filename)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
208 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
209 gchar *ext = strrchr(filename, '.');
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
210
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
211 if (ext != NULL)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
212 ++ext;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
213 return ext;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
214 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
215
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
216 static char* w_getstr(char* str)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
217 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
218 /* TODO
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
219 * Seems, this function was stolen from mpg123 xmms plugin,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
220 * we need to get rid of it since I feel it is not useful)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
221 */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
222
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
223 if (str && strlen(str) > 0)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
224 return str;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
225
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
226 return NULL;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
227 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
228
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
229 static gchar *get_song_title(AVFormatContext *in, gchar * filename)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
230 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
231 gchar *ret = NULL;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
232 TitleInput *input;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
233
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
234 XMMS_NEW_TITLEINPUT(input);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
235
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
236 if ((in->title[0] != '\0') || (in->author[0] != '\0') || (in->album[0] != '\0') ||
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
237 (in->comment[0] != '\0') || (in->genre[0] != '\0') || (in->year != 0) || (in->track != 0))
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
238 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
239 input->performer = w_getstr(in->author);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
240 input->album_name = w_getstr(in->album);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
241 input->track_name = w_getstr(in->title);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
242 input->year = in->year;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
243 input->track_number = in->track;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
244 input->genre = w_getstr(in->genre);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
245 input->comment = w_getstr(in->comment);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
246 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
247
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
248 input->file_name = (gchar *)g_basename(filename);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
249 input->file_path = filename;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
250 input->file_ext = extname(filename);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
251 ret = xmms_get_titlestring(xmms_get_gentitle_format(), input);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
252
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
253 g_free(input);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
254
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
255 if (!ret) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
256 ret = g_strdup(g_basename(filename));
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
257
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
258 if (extname(ret) != NULL)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
259 *(extname(ret) - 1) = '\0';
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
260 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
261
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
262 return ret;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
263 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
264
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
265 static guint get_song_time(AVFormatContext *in)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
266 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
267
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
268 if (in->duration)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
269 return in->duration/1000;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
270 else
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
271 return 0;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
272 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
273
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
274 static void wma_get_song_info(char *filename, char **title_real, int *len_real)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
275 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
276 AVFormatContext *in = NULL;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
277
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
278 (*len_real) = -1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
279 (*title_real) = NULL;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
280
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
281 if (av_open_input_file(&in, filename, NULL, 0, NULL) < 0)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
282 return;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
283
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
284 av_find_stream_info(in);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
285 (*len_real) = get_song_time(in);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
286 (*title_real) = get_song_title(in, filename);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
287 av_close_input_file(in);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
288 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
289
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
290 static void wma_playbuff(int out_size)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
291 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
292 FifoBuffer f;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
293 int sst_buff;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
294
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
295 fifo_init(&f, out_size*2);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
296 fifo_write(&f, wma_outbuf, out_size, &f.wptr);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
297
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
298 while (!fifo_read(&f, wma_s_outbuf, wma_st_buff, &f.rptr) && wma_decode) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
299 if (wma_eq_on)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
300 sst_buff = iir((gpointer)&wma_s_outbuf, wma_st_buff);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
301 else
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
302 sst_buff = wma_st_buff;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
303
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
304 if (wma_pause)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
305 memset(wma_s_outbuf, 0, sst_buff);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
306
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
307 while (wma_ip.output->buffer_free() < wma_st_buff)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
308 xmms_usleep(20000);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
309
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
310 if (wma_seekpos == -1)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
311 wma_ip.add_vis_pcm(wma_ip.output->written_time(), FMT_S16_NE,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
312 c->channels, sst_buff, (short *)wma_s_outbuf);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
313
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
314 wma_ip.output->write_audio((short *)wma_s_outbuf, sst_buff);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
315 memset(wma_s_outbuf, 0, sst_buff);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
316 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
317
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
318 fifo_free(&f);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
319
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
320 return;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
321 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
322
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
323 static void *wma_play_loop(void *arg)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
324 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
325 uint8_t *inbuf_ptr;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
326 int out_size, size, len;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
327 AVPacket pkt;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
328
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
329 pthread_mutex_lock(&wma_mutex);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
330
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
331 while (wma_decode) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
332 if (wma_seekpos != -1) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
333 av_seek_frame(ic, wma_idx, wma_seekpos * 1000000LL);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
334 wma_ip.output->flush(wma_seekpos * 1000);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
335 wma_seekpos = -1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
336 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
337
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
338 if (av_read_frame(ic, &pkt) < 0)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
339 break;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
340
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
341 size = pkt.size;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
342 inbuf_ptr = pkt.data;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
343
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
344 if (size == 0)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
345 break;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
346
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
347 while (size > 0) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
348 len = avcodec_decode_audio(c, (short *)wma_outbuf,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
349 &out_size, inbuf_ptr, size);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
350
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
351 if (len < 0)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
352 break;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
353
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
354 if (out_size <= 0)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
355 continue;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
356
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
357 wma_playbuff(out_size);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
358
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
359 size -= len;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
360 inbuf_ptr += len;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
361
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
362 if (pkt.data)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
363 av_free_packet(&pkt);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
364 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
365 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
366
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
367 while (wma_decode && wma_ip.output->buffer_playing())
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
368 xmms_usleep(30000);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
369
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
370 wma_decode = 0;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
371
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
372 /* XXX
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
373 * that's all odd
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
374 */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
375
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
376 if (wma_s_outbuf)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
377 g_free(wma_s_outbuf);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
378
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
379 if (wma_outbuf)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
380 g_free(wma_outbuf);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
381
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
382 if (pkt.data)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
383 av_free_packet(&pkt);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
384 if (c)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
385 avcodec_close(c);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
386 if (ic)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
387 av_close_input_file(ic);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
388
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
389 pthread_mutex_unlock(&wma_mutex);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
390 pthread_exit(NULL);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
391 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
392
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
393 static void wma_play_file(char *filename)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
394 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
395 AVCodec *codec;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
396
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
397 if (av_open_input_file(&ic, filename, NULL, 0, NULL) < 0)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
398 return;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
399
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
400 for (wma_idx = 0; wma_idx < ic->nb_streams; wma_idx++) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
401 c = &ic->streams[wma_idx]->codec;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
402
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
403 if(c->codec_type == CODEC_TYPE_AUDIO)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
404 break;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
405 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
406
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
407 av_find_stream_info(ic);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
408
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
409 codec = avcodec_find_decoder(c->codec_id);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
410
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
411 if (!codec)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
412 return;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
413
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
414 if (avcodec_open(c, codec) < 0)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
415 return;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
416
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
417 wsong_title = get_song_title(ic, filename);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
418 wsong_time = get_song_time(ic);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
419
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
420 if (wma_ip.output->open_audio(FMT_S16_NE, c->sample_rate, c->channels) <= 0)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
421 return;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
422
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
423 wma_st_buff = ST_BUFF;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
424
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
425 wma_ip.set_info(wsong_title, wsong_time, c->bit_rate, c->sample_rate, c->channels);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
426
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
427 wma_s_outbuf = g_malloc0(wma_st_buff);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
428 wma_outbuf = g_malloc0(AVCODEC_MAX_AUDIO_FRAME_SIZE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
429 wma_seekpos = -1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
430 wma_decode = 1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
431 pthread_create(&wma_decode_thread, NULL, wma_play_loop, NULL);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
432 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
433
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
434 static void wma_stop(void)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
435 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
436 wma_decode = 0;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
437
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
438 if (wma_pause)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
439 wma_do_pause(0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
440
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
441 pthread_join(wma_decode_thread, NULL);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
442 wma_ip.output->close_audio();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
443 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
444
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
445 static void wma_file_info_box (char *filename)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
446 {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
447 GtkWidget *dialog_vbox1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
448 GtkWidget *vbox1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
449 GtkWidget *hbox1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
450 GtkWidget *label_name;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
451 GtkWidget *entry_filename;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
452 GtkWidget *hbox2;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
453 GtkWidget *frame_wma_info;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
454 GtkWidget *alignment1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
455 GtkWidget *table1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
456 GtkWidget *label_album;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
457 GtkWidget *label_year;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
458 GtkWidget *label_track;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
459 GtkWidget *label_genre;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
460 GtkWidget *label_comments;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
461 /*GtkWidget *label_copyright;*/
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
462 GtkWidget *label_wma_version;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
463 GtkWidget *label_bitrate;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
464 GtkWidget *label_rate;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
465 GtkWidget *label_chans;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
466 GtkWidget *label_play_time;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
467 GtkWidget *label_filesize;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
468 GtkWidget *label_wma_vers_val;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
469 GtkWidget *label_bitrate_val;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
470 GtkWidget *label_rate_val;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
471 GtkWidget *label_chans_val;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
472 GtkWidget *label_playtime_val;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
473 GtkWidget *label_filesize_val;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
474 GtkWidget *label4;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
475 GtkWidget *frame_tags;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
476 GtkWidget *alignment2;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
477 GtkWidget *table2;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
478 GtkWidget *label_artist;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
479 GtkWidget *label_title;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
480 GtkWidget *entry_artist;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
481 GtkWidget *entry_album;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
482 GtkWidget *entry_year;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
483 GtkWidget *entry_title;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
484 GtkWidget *entry_track;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
485 GtkWidget *entry_genre;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
486 GtkWidget *entry_comments;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
487 /* GtkWidget *entry_copyright;*/
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
488 GtkWidget *label5;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
489 GtkWidget *dialog_action_area1;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
490 GtkWidget *okbutton;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
491
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
492 AVFormatContext *in = NULL;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
493 AVCodecContext *s = NULL;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
494 AVCodec *codec;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
495 gint tns, thh, tmm, tss;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
496 gint i;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
497 gchar *title,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
498 *channels,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
499 *bitrate,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
500 *playtime,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
501 *samplerate,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
502 *filesize;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
503 VFSFile *f;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
504
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
505 if (dialog) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
506 (void)g_printf("Info dialog is already opened!\n");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
507 return;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
508 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
509
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
510 if (av_open_input_file(&in, filename, NULL, 0, NULL) < 0)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
511 return;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
512
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
513 for(i = 0; i < in->nb_streams; i++) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
514 s = &in->streams[i]->codec;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
515 if(s->codec_type == CODEC_TYPE_AUDIO)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
516 break;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
517 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
518
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
519 av_find_stream_info(in);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
520 codec = avcodec_find_decoder(s->codec_id);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
521
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
522 /* window title */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
523 title = g_strdup_printf("File Info - %s", g_basename(filename));
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
524
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
525 /* channels */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
526 if (s->channels == 1)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
527 channels = g_strdup("MONO");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
528 else
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
529 channels = g_strdup("STEREO");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
530
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
531 /* bitrate */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
532 bitrate = g_strdup_printf("%d Kb/s", (s->bit_rate / 1000));
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
533
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
534 /* playtime */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
535 if (in->duration != 0) {
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
536 tns = in->duration/1000000LL;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
537 thh = tns/3600;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
538 tmm = (tns%3600)/60;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
539 tss = (tns%60);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
540 playtime = g_strdup_printf("%02d:%02d:%02d", thh, tmm, tss);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
541 } else
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
542 playtime = g_strdup("N/A");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
543
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
544 /* samplerate */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
545 samplerate = g_strdup_printf("%d Hz", s->sample_rate);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
546
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
547 /* filesize */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
548 f = vfs_fopen(filename, "rb");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
549
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
550 if (f == NULL)
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
551 return;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
552
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
553 vfs_fseek(f, 0, SEEK_END);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
554 filesize = g_strdup_printf("%lu Bytes", vfs_ftell(f));
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
555 vfs_fclose(f);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
556
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
557 dialog = gtk_dialog_new();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
558
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
559 gtk_signal_connect(GTK_OBJECT(dialog), "destroy",
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
560 GTK_SIGNAL_FUNC(gtk_widget_destroyed), &dialog);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
561
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
562 gtk_window_set_title(GTK_WINDOW(dialog), title);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
563 gtk_window_set_type_hint(GTK_WINDOW(dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
564 gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
565
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
566 dialog_vbox1 = GTK_DIALOG(dialog)->vbox;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
567 gtk_widget_show(dialog_vbox1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
568
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
569 vbox1 = gtk_vbox_new(FALSE, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
570 gtk_widget_show(vbox1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
571 gtk_box_pack_start(GTK_BOX(dialog_vbox1), vbox1, TRUE, TRUE, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
572
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
573 hbox1 = gtk_hbox_new (FALSE, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
574 gtk_widget_show (hbox1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
575 gtk_box_pack_start(GTK_BOX(vbox1), hbox1, FALSE, FALSE, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
576
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
577 label_name = gtk_label_new("<b>Name:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
578 gtk_widget_show(label_name);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
579 gtk_box_pack_start(GTK_BOX (hbox1), label_name, FALSE, FALSE, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
580 gtk_misc_set_alignment(GTK_MISC (label_name), 0.48, 0.51);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
581 gtk_misc_set_padding(GTK_MISC (label_name), 10, 10);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
582 gtk_label_set_use_markup(GTK_LABEL(label_name), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
583
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
584 entry_filename = gtk_entry_new();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
585 gtk_widget_show(entry_filename);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
586 gtk_box_pack_start(GTK_BOX(hbox1), entry_filename, TRUE, TRUE, 4);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
587 gtk_editable_set_editable(GTK_EDITABLE(entry_filename), FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
588 gtk_entry_set_text(GTK_ENTRY(entry_filename), filename);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
589
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
590 hbox2 = gtk_hbox_new(FALSE, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
591 gtk_widget_show(hbox2);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
592 gtk_box_pack_start(GTK_BOX(vbox1), hbox2, TRUE, TRUE, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
593
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
594 frame_wma_info = gtk_frame_new(NULL);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
595 gtk_widget_show(frame_wma_info);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
596 gtk_box_pack_start(GTK_BOX(hbox2), frame_wma_info, TRUE, TRUE, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
597 gtk_frame_set_shadow_type(GTK_FRAME (frame_wma_info), GTK_SHADOW_ETCHED_IN);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
598 gtk_container_set_border_width (GTK_CONTAINER(frame_wma_info), 10);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
599
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
600 alignment1 = gtk_alignment_new(0.5, 0.5, 1, 1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
601 gtk_widget_show(alignment1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
602 gtk_container_add(GTK_CONTAINER(frame_wma_info), alignment1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
603 gtk_alignment_set_padding(GTK_ALIGNMENT(alignment1), 0, 0, 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
604 gtk_container_set_border_width(GTK_CONTAINER(alignment1), 2);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
605
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
606 table1 = gtk_table_new(6, 2, FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
607 gtk_widget_show(table1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
608 gtk_container_add(GTK_CONTAINER(alignment1), table1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
609 gtk_container_set_border_width(GTK_CONTAINER(table1), 6);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
610 gtk_table_set_row_spacings(GTK_TABLE(table1), 3);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
611 gtk_table_set_col_spacings(GTK_TABLE(table1), 8);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
612
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
613 /* WMA Version label */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
614 label_wma_version = gtk_label_new("<b>WMA Version:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
615 gtk_widget_show(label_wma_version);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
616 gtk_table_attach(GTK_TABLE(table1), label_wma_version, 0, 1, 0, 1,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
617 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
618 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
619 gtk_misc_set_alignment(GTK_MISC(label_wma_version), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
620 gtk_label_set_use_markup(GTK_LABEL(label_wma_version), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
621
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
622 /* Bitrate */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
623 label_bitrate = gtk_label_new("<b>Bitrate:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
624 gtk_widget_show(label_bitrate);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
625 gtk_table_attach(GTK_TABLE(table1), label_bitrate, 0, 1, 1, 2,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
626 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
627 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
628 gtk_misc_set_alignment(GTK_MISC(label_bitrate), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
629 gtk_label_set_use_markup(GTK_LABEL(label_bitrate), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
630
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
631 /* Samplerate */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
632 label_rate = gtk_label_new("<b>Samplerate:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
633 gtk_widget_show(label_rate);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
634 gtk_table_attach(GTK_TABLE(table1), label_rate, 0, 1, 2, 3,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
635 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
636 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
637 gtk_misc_set_alignment(GTK_MISC(label_rate), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
638 gtk_label_set_use_markup(GTK_LABEL(label_rate), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
639
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
640 /* Channels */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
641 label_chans = gtk_label_new("<b>Channels:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
642 gtk_widget_show(label_chans);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
643 gtk_table_attach(GTK_TABLE (table1), label_chans, 0, 1, 3, 4,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
644 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
645 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
646 gtk_misc_set_alignment(GTK_MISC(label_chans), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
647 gtk_label_set_use_markup(GTK_LABEL(label_chans), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
648
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
649 /* Play time */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
650 label_play_time = gtk_label_new("<b>Play time:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
651 gtk_widget_show(label_play_time);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
652 gtk_table_attach(GTK_TABLE (table1), label_play_time, 0, 1, 4, 5,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
653 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
654 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
655 gtk_misc_set_alignment(GTK_MISC(label_play_time), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
656 gtk_label_set_use_markup(GTK_LABEL(label_play_time), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
657
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
658 /* Filesize */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
659 label_filesize = gtk_label_new("<b>Filesize:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
660 gtk_widget_show(label_filesize);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
661 gtk_table_attach(GTK_TABLE(table1), label_filesize, 0, 1, 5, 6,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
662 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
663 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
664 gtk_misc_set_alignment(GTK_MISC(label_filesize), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
665 gtk_label_set_use_markup(GTK_LABEL(label_filesize), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
666
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
667
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
668 label_wma_vers_val = gtk_label_new(codec->name);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
669 gtk_widget_show(label_wma_vers_val);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
670 gtk_table_attach(GTK_TABLE(table1), label_wma_vers_val, 1, 2, 0, 1,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
671 (GtkAttachOptions)(GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
672 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
673 gtk_misc_set_alignment(GTK_MISC(label_wma_vers_val), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
674
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
675 label_bitrate_val = gtk_label_new(bitrate);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
676 gtk_widget_show(label_bitrate_val);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
677 gtk_table_attach(GTK_TABLE(table1), label_bitrate_val, 1, 2, 1, 2,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
678 (GtkAttachOptions)(GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
679 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
680 gtk_misc_set_alignment(GTK_MISC(label_bitrate_val), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
681
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
682 label_rate_val = gtk_label_new(samplerate);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
683 gtk_widget_show(label_rate_val);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
684 gtk_table_attach(GTK_TABLE(table1), label_rate_val, 1, 2, 2, 3,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
685 (GtkAttachOptions)(GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
686 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
687 gtk_misc_set_alignment(GTK_MISC(label_rate_val), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
688
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
689 label_chans_val = gtk_label_new(channels);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
690 gtk_widget_show(label_chans_val);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
691 gtk_table_attach(GTK_TABLE(table1), label_chans_val, 1, 2, 3, 4,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
692 (GtkAttachOptions)(GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
693 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
694 gtk_misc_set_alignment(GTK_MISC (label_chans_val), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
695
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
696 label_playtime_val = gtk_label_new(playtime);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
697 gtk_widget_show(label_playtime_val);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
698 gtk_table_attach(GTK_TABLE(table1), label_playtime_val, 1, 2, 4, 5,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
699 (GtkAttachOptions)(GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
700 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
701 gtk_misc_set_alignment(GTK_MISC(label_playtime_val), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
702
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
703 label_filesize_val = gtk_label_new(filesize);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
704 gtk_widget_show(label_filesize_val);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
705 gtk_table_attach(GTK_TABLE (table1), label_filesize_val, 1, 2, 5, 6,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
706 (GtkAttachOptions)(GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
707 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
708 gtk_misc_set_alignment(GTK_MISC(label_filesize_val), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
709
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
710 label4 = gtk_label_new ("WMA Info");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
711 gtk_widget_show(label4);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
712 gtk_frame_set_label_widget(GTK_FRAME(frame_wma_info), label4);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
713
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
714 frame_tags = gtk_frame_new (NULL);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
715 gtk_widget_show (frame_tags);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
716 gtk_box_pack_start (GTK_BOX (hbox2), frame_tags, TRUE, TRUE, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
717 gtk_frame_set_shadow_type (GTK_FRAME (frame_tags), GTK_SHADOW_ETCHED_IN);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
718 gtk_container_set_border_width (GTK_CONTAINER (frame_tags), 10);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
719
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
720
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
721 alignment2 = gtk_alignment_new (0.5, 0.5, 1, 1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
722 gtk_widget_show (alignment2);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
723 gtk_container_add (GTK_CONTAINER (frame_tags), alignment2);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
724 gtk_alignment_set_padding (GTK_ALIGNMENT (alignment2), 0, 0, 12, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
725 gtk_container_set_border_width (GTK_CONTAINER (alignment2), 2);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
726
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
727
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
728 table2 = gtk_table_new(8, 2, FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
729 gtk_widget_show(table2);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
730 gtk_container_add(GTK_CONTAINER(alignment2), table2);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
731 gtk_container_set_border_width(GTK_CONTAINER(table2), 6);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
732 gtk_table_set_row_spacings(GTK_TABLE(table2), 3);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
733 gtk_table_set_col_spacings(GTK_TABLE(table2), 8);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
734
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
735 /* Artist */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
736 label_artist = gtk_label_new("<b>Artist:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
737 gtk_widget_show(label_artist);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
738 gtk_table_attach(GTK_TABLE (table2), label_artist, 0, 1, 0, 1,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
739 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
740 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
741 gtk_misc_set_alignment(GTK_MISC(label_artist), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
742 gtk_label_set_use_markup(GTK_LABEL(label_artist), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
743
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
744 /* Title */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
745 label_title = gtk_label_new("<b>Title:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
746 gtk_widget_show(label_title);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
747 gtk_table_attach(GTK_TABLE (table2), label_title, 0, 1, 1, 2,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
748 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
749 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
750 gtk_misc_set_alignment(GTK_MISC(label_title), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
751 gtk_label_set_use_markup(GTK_LABEL(label_title), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
752
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
753 /* Album */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
754 label_album = gtk_label_new("<b>Album:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
755 gtk_widget_show(label_album);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
756 gtk_table_attach(GTK_TABLE (table2), label_album, 0, 1, 2, 3,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
757 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
758 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
759 gtk_misc_set_alignment(GTK_MISC(label_album), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
760 gtk_label_set_use_markup(GTK_LABEL(label_album), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
761
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
762 /* Comments */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
763 label_comments = gtk_label_new("<b>Comments:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
764 gtk_widget_show(label_comments);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
765 gtk_table_attach(GTK_TABLE(table2), label_comments, 0, 1, 3, 4,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
766 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
767 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
768 gtk_misc_set_alignment(GTK_MISC(label_comments), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
769 gtk_label_set_use_markup(GTK_LABEL(label_comments), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
770
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
771 /* Year */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
772 label_year = gtk_label_new("<b>Year:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
773 gtk_widget_show(label_year);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
774 gtk_table_attach(GTK_TABLE (table2), label_year, 0, 1, 4, 5,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
775 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
776 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
777 gtk_misc_set_alignment(GTK_MISC(label_year), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
778 gtk_label_set_use_markup(GTK_LABEL(label_year), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
779
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
780 /* Track */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
781 label_track = gtk_label_new("<b>Track:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
782 gtk_widget_show(label_track);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
783 gtk_table_attach(GTK_TABLE (table2), label_track, 0, 1, 5, 6,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
784 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
785 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
786 gtk_misc_set_alignment(GTK_MISC(label_track), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
787 gtk_label_set_use_markup(GTK_LABEL(label_track), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
788
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
789 /* Genre */
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
790 label_genre = gtk_label_new("<b>Genre:</b>");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
791 gtk_widget_show(label_genre);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
792 gtk_table_attach(GTK_TABLE (table2), label_genre, 0, 1, 6, 7,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
793 (GtkAttachOptions) (GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
794 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
795 gtk_misc_set_alignment(GTK_MISC (label_genre), 0, 0.5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
796 gtk_label_set_use_markup(GTK_LABEL(label_genre), TRUE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
797
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
798
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
799 entry_artist = gtk_entry_new();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
800 gtk_widget_show (entry_artist);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
801 gtk_table_attach (GTK_TABLE (table2), entry_artist, 1, 2, 0, 1,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
802 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
803 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
804 gtk_editable_set_editable (GTK_EDITABLE (entry_artist), FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
805 gtk_entry_set_text(GTK_ENTRY(entry_artist), in->author);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
806
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
807 entry_title = gtk_entry_new();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
808 gtk_widget_show(entry_title);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
809 gtk_table_attach (GTK_TABLE (table2), entry_title, 1, 2, 1, 2,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
810 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
811 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
812 gtk_editable_set_editable(GTK_EDITABLE (entry_title), FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
813 gtk_entry_set_text(GTK_ENTRY(entry_title), in->title);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
814
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
815 entry_album = gtk_entry_new();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
816 gtk_widget_show(entry_album);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
817 gtk_table_attach(GTK_TABLE (table2), entry_album, 1, 2, 2, 3,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
818 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
819 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
820 gtk_editable_set_editable(GTK_EDITABLE (entry_album), FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
821 gtk_entry_set_text(GTK_ENTRY(entry_album), in->album);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
822
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
823 entry_comments = gtk_entry_new();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
824 gtk_widget_show(entry_comments);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
825 gtk_table_attach(GTK_TABLE (table2), entry_comments, 1, 2, 3, 4,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
826 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
827 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
828 gtk_editable_set_editable(GTK_EDITABLE (entry_comments), FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
829 gtk_entry_set_text(GTK_ENTRY(entry_comments), in->comment);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
830
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
831 entry_year = gtk_entry_new();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
832 gtk_widget_show(entry_year);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
833 gtk_table_attach(GTK_TABLE (table2), entry_year, 1, 2, 4, 5,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
834 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
835 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
836 gtk_editable_set_editable(GTK_EDITABLE (entry_year), FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
837 gtk_entry_set_text(GTK_ENTRY(entry_year), g_strdup_printf("%d", in->year));
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
838
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
839 entry_track = gtk_entry_new();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
840 gtk_widget_show(entry_track);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
841 gtk_table_attach(GTK_TABLE (table2), entry_track, 1, 2, 5, 6,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
842 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
843 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
844 gtk_editable_set_editable(GTK_EDITABLE (entry_track), FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
845 gtk_entry_set_text(GTK_ENTRY(entry_track), g_strdup_printf("%d", in->track));
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
846
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
847 entry_genre = gtk_entry_new();
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
848 gtk_widget_show(entry_genre);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
849 gtk_table_attach(GTK_TABLE (table2), entry_genre, 1, 2, 6, 7,
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
850 (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
851 (GtkAttachOptions) (0), 0, 0);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
852 gtk_editable_set_editable(GTK_EDITABLE (entry_genre), FALSE);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
853 gtk_entry_set_text(GTK_ENTRY(entry_genre), in->genre);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
854
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
855
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
856 label5 = gtk_label_new("Tags");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
857 gtk_widget_show(label5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
858 gtk_frame_set_label_widget(GTK_FRAME(frame_tags), label5);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
859
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
860
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
861 dialog_action_area1 = GTK_DIALOG(dialog)->action_area;
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
862 gtk_widget_show(dialog_action_area1);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
863 gtk_button_box_set_layout(GTK_BUTTON_BOX(dialog_action_area1), GTK_BUTTONBOX_END);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
864
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
865 okbutton = gtk_button_new_from_stock("gtk-ok");
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
866 gtk_widget_show(okbutton);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
867 gtk_dialog_add_action_widget(GTK_DIALOG(dialog), okbutton, GTK_RESPONSE_OK);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
868 GTK_WIDGET_SET_FLAGS(okbutton, GTK_CAN_DEFAULT);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
869
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
870 gtk_signal_connect_object(GTK_OBJECT(okbutton), "clicked",
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
871 GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(dialog));
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
872
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
873 gtk_widget_show(dialog);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
874
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
875 g_free(title);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
876 g_free(channels);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
877 g_free(bitrate);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
878 g_free(playtime);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
879 g_free(samplerate);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
880 g_free(filesize);
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
881 }
b8d4c1faa6d7 [svn] Import WMA decoder into SVN.
nenolod
parents:
diff changeset
882