annotate src/disk_writer/disk_writer.c @ 906:16e51fb5908e trunk

[svn] - aosd: beta4, ghosd source was rewritten to support argb visual (x composite extension) as an option, this allows to have real transparency in the OSD
author giacomo
date Sat, 31 Mar 2007 17:44:23 -0700
parents 4a2e5c1e7c3b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1 /* XMMS - Cross-platform multimedia player
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2 * Copyright (C) 1998-2004 Peter Alm, Mikael Alm, Olle Hallnas,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
3 * Thomas Nilsson and 4Front Technologies
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
4 * Copyright (C) 1999-2004 Haavard Kvaalen
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
5 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
6 * File name suffix option added by Heikki Orsila 2003
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
7 * <heikki.orsila@iki.fi> (no copyrights claimed)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
8 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
9 * This program is free software; you can redistribute it and/or modify
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
10 * it under the terms of the GNU General Public License as published by
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
12 * (at your option) any later version.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
13 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
14 * This program is distributed in the hope that it will be useful,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
17 * GNU General Public License for more details.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
18 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
19 * You should have received a copy of the GNU General Public License
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
20 * along with this program; if not, write to the Free Software
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
22 */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
23
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
24 #include "config.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
25
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
26 #include <gtk/gtk.h>
527
d124034ebea3 [svn] - glib/gi18n.h -> audacious/i18n.h for automatic dgettext support
nenolod
parents: 447
diff changeset
27 #include <audacious/i18n.h>
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
28 #include <stdio.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
29 #include <string.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
30
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
31 #include "audacious/plugin.h"
3
088092a52fea [svn] - move from (internal) libaudacious/ include path to audacious/ include path
nenolod
parents: 0
diff changeset
32 #include "audacious/beepctrl.h"
088092a52fea [svn] - move from (internal) libaudacious/ include path to audacious/ include path
nenolod
parents: 0
diff changeset
33 #include "audacious/configdb.h"
088092a52fea [svn] - move from (internal) libaudacious/ include path to audacious/ include path
nenolod
parents: 0
diff changeset
34 #include "audacious/util.h"
088092a52fea [svn] - move from (internal) libaudacious/ include path to audacious/ include path
nenolod
parents: 0
diff changeset
35 #include "audacious/vfs.h"
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
36
658
a9199ee8e5c0 [svn] - disk writer: do effects processing.
nenolod
parents: 527
diff changeset
37
a9199ee8e5c0 [svn] - disk writer: do effects processing.
nenolod
parents: 527
diff changeset
38 struct format_info {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
39 AFormat format;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
40 int frequency;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
41 int channels;
658
a9199ee8e5c0 [svn] - disk writer: do effects processing.
nenolod
parents: 527
diff changeset
42 };
a9199ee8e5c0 [svn] - disk writer: do effects processing.
nenolod
parents: 527
diff changeset
43 struct format_info input;
a9199ee8e5c0 [svn] - disk writer: do effects processing.
nenolod
parents: 527
diff changeset
44
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
45 struct wavhead
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
46 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
47 guint32 main_chunk;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
48 guint32 length;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
49 guint32 chunk_type;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
50 guint32 sub_chunk;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
51 guint32 sc_len;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
52 guint16 format;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
53 guint16 modus;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
54 guint32 sample_fq;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
55 guint32 byte_p_sec;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
56 guint16 byte_p_spl;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
57 guint16 bit_p_spl;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
58 guint32 data_chunk;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
59 guint32 data_length;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
60 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
61
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
62 static GtkWidget *configure_win = NULL, *configure_vbox;
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
63 static GtkWidget *path_hbox, *path_label, *path_dirbrowser;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
64 static GtkWidget *configure_separator;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
65 static GtkWidget *configure_bbox, *configure_ok, *configure_cancel;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
66
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
67 static GtkWidget *saveplace_hbox, *saveplace;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
68 static gboolean save_original = TRUE;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
69
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
70 static GtkWidget *use_suffix_toggle = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
71 static gboolean use_suffix = FALSE;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
72
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
73 static gchar *file_path = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
74 static VFSFile *output_file = NULL;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
75 static struct wavhead header;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
76 static guint64 written = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
77 static AFormat afmt;
403
2a762925c469 [svn] - reopen on flush(0)
nenolod
parents: 12
diff changeset
78 static gint arate, ach;
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
79 gint ctrlsocket_get_session_id(void); /* FIXME */
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
80
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
81 static void disk_init(void);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
82 static gint disk_open(AFormat fmt, gint rate, gint nch);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
83 static void disk_write(void *ptr, gint length);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
84 static void disk_close(void);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
85 static void disk_flush(gint time);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
86 static void disk_pause(short p);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
87 static gint disk_free(void);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
88 static gint disk_playing(void);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
89 static gint disk_get_written_time(void);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
90 static gint disk_get_output_time(void);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
91 static void disk_configure(void);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
92 static void disk_getvol(gint *, gint *);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
93 static void disk_setvol(gint, gint);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
94
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
95 static int lvol = 0, rvol = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
96
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
97 OutputPlugin disk_op =
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
98 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
99 NULL,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
100 NULL,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
101 NULL,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
102 disk_init,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
103 NULL,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
104 NULL,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
105 disk_configure,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
106 disk_getvol,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
107 disk_setvol,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
108 disk_open,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
109 disk_write,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
110 disk_close,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
111 disk_flush,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
112 disk_pause,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
113 disk_free,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
114 disk_playing,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
115 disk_get_output_time,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
116 disk_get_written_time,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
117 NULL
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
118 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
119
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
120 OutputPlugin *get_oplugin_info(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
121 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
122 disk_op.description = g_strdup_printf(_("Disk Writer Plugin %s"), VERSION);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
123 return &disk_op;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
124 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
125
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
126 static void disk_init(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
127 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
128 ConfigDb *db;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
129
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
130 db = bmp_cfg_db_open();
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
131 bmp_cfg_db_get_string(db, "disk_writer", "file_path", &file_path);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
132 bmp_cfg_db_get_bool(db, "disk_writer", "save_original", &save_original);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
133 bmp_cfg_db_get_bool(db, "disk_writer", "use_suffix", &use_suffix);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
134 bmp_cfg_db_close(db);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
135
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
136 if (!file_path)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
137 file_path = g_strdup(g_get_home_dir());
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
138 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
139
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
140 static gint disk_open(AFormat fmt, gint rate, gint nch)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
141 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
142 gchar *filename, *title, *temp;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
143 gint pos;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
144
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
145 written = 0;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
146 afmt = fmt;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
147 arate = rate;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
148 ach = nch;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
149
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
150 if (xmms_check_realtime_priority())
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
151 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
152 xmms_show_message(_("Error"),
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
153 _("You cannot use the Disk Writer plugin\n"
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
154 "when you're running in realtime mode."),
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
155 _("OK"), FALSE, NULL, NULL);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
156 return 0;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
157 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
158
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
159 pos = xmms_remote_get_playlist_pos(ctrlsocket_get_session_id());
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
160 title = xmms_remote_get_playlist_file(ctrlsocket_get_session_id(), pos);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
161 if (!use_suffix) {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
162 if (title != NULL && (temp = strrchr(title, '.')) != NULL) {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
163 *temp = '\0';
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
164 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
165 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
166 if (title == NULL || strlen(g_basename(title)) == 0)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
167 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
168 g_free(title);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
169 /* No filename, lets try title instead */
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
170 title = xmms_remote_get_playlist_title(ctrlsocket_get_session_id(), pos);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
171 while (title != NULL && (temp = strchr(title, '/')) != NULL)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
172 *temp = '-';
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
173
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
174 if (title == NULL || strlen(g_basename(title)) == 0)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
175 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
176 g_free(title);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
177 /* No title either. Just set it to something. */
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
178 title = g_strdup_printf("xmms-%d", pos);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
179 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
180 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
181
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
182 if (save_original)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
183 filename = g_strdup_printf("%s.wav", title);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
184 else
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
185 filename = g_strdup_printf("%s/%s.wav", file_path, g_basename(title));
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
186 // FIXME: check if filename equals title
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
187 g_free(title);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
188
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
189 output_file = vfs_fopen(filename, "wb");
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
190 g_free(filename);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
191
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
192 if (!output_file)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
193 return 0;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
194
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
195 memcpy(&header.main_chunk, "RIFF", 4);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
196 header.length = GUINT32_TO_LE(0);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
197 memcpy(&header.chunk_type, "WAVE", 4);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
198 memcpy(&header.sub_chunk, "fmt ", 4);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
199 header.sc_len = GUINT32_TO_LE(16);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
200 header.format = GUINT16_TO_LE(1);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
201 header.modus = GUINT16_TO_LE(nch);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
202 header.sample_fq = GUINT32_TO_LE(rate);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
203 if (fmt == FMT_U8 || fmt == FMT_S8)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
204 header.bit_p_spl = GUINT16_TO_LE(8);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
205 else
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
206 header.bit_p_spl = GUINT16_TO_LE(16);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
207 header.byte_p_sec = GUINT32_TO_LE(rate * header.modus * (GUINT16_FROM_LE(header.bit_p_spl) / 8));
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
208 header.byte_p_spl = GUINT16_TO_LE((GUINT16_FROM_LE(header.bit_p_spl) / (8 / nch)));
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
209 memcpy(&header.data_chunk, "data", 4);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
210 header.data_length = GUINT32_TO_LE(0);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
211 vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
212
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
213 input.format = fmt;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
214 input.frequency = rate;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
215 input.channels = nch;
658
a9199ee8e5c0 [svn] - disk writer: do effects processing.
nenolod
parents: 527
diff changeset
216
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
217 return 1;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
218 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
219
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
220 static void convert_buffer(gpointer buffer, gint length)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
221 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
222 gint i;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
223
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
224 if (afmt == FMT_S8)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
225 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
226 guint8 *ptr1 = buffer;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
227 gint8 *ptr2 = buffer;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
228
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
229 for (i = 0; i < length; i++)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
230 *(ptr1++) = *(ptr2++) ^ 128;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
231 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
232 if (afmt == FMT_S16_BE)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
233 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
234 gint16 *ptr = buffer;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
235
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
236 for (i = 0; i < length >> 1; i++, ptr++)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
237 *ptr = GUINT16_SWAP_LE_BE(*ptr);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
238 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
239 if (afmt == FMT_S16_NE)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
240 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
241 gint16 *ptr = buffer;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
242
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
243 for (i = 0; i < length >> 1; i++, ptr++)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
244 *ptr = GINT16_TO_LE(*ptr);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
245 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
246 if (afmt == FMT_U16_BE)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
247 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
248 gint16 *ptr1 = buffer;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
249 guint16 *ptr2 = buffer;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
250
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
251 for (i = 0; i < length >> 1; i++, ptr2++)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
252 *(ptr1++) = GINT16_TO_LE(GUINT16_FROM_BE(*ptr2) ^ 32768);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
253 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
254 if (afmt == FMT_U16_LE)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
255 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
256 gint16 *ptr1 = buffer;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
257 guint16 *ptr2 = buffer;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
258
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
259 for (i = 0; i < length >> 1; i++, ptr2++)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
260 *(ptr1++) = GINT16_TO_LE(GUINT16_FROM_LE(*ptr2) ^ 32768);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
261 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
262 if (afmt == FMT_U16_NE)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
263 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
264 gint16 *ptr1 = buffer;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
265 guint16 *ptr2 = buffer;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
266
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
267 for (i = 0; i < length >> 1; i++, ptr2++)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
268 *(ptr1++) = GINT16_TO_LE((*ptr2) ^ 32768);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
269 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
270 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
271
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
272 static void disk_write(void *ptr, gint length)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
273 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
274 AFormat new_format;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
275 int new_frequency, new_channels;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
276 EffectPlugin *ep;
658
a9199ee8e5c0 [svn] - disk writer: do effects processing.
nenolod
parents: 527
diff changeset
277
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
278 new_format = input.format;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
279 new_frequency = input.frequency;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
280 new_channels = input.channels;
658
a9199ee8e5c0 [svn] - disk writer: do effects processing.
nenolod
parents: 527
diff changeset
281
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
282 ep = get_current_effect_plugin();
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
283 if ( effects_enabled() && ep && ep->query_format ) {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
284 ep->query_format(&new_format,&new_frequency,&new_channels);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
285 }
658
a9199ee8e5c0 [svn] - disk writer: do effects processing.
nenolod
parents: 527
diff changeset
286
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
287 if ( effects_enabled() && ep && ep->mod_samples ) {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
288 length = ep->mod_samples(&ptr,length,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
289 input.format,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
290 input.frequency,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
291 input.channels );
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
292 }
658
a9199ee8e5c0 [svn] - disk writer: do effects processing.
nenolod
parents: 527
diff changeset
293
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
294 if (afmt == FMT_S8 || afmt == FMT_S16_BE ||
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
295 afmt == FMT_U16_LE || afmt == FMT_U16_BE || afmt == FMT_U16_NE)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
296 convert_buffer(ptr, length);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
297 #ifdef WORDS_BIGENDIAN
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
298 if (afmt == FMT_S16_NE)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
299 convert_buffer(ptr, length);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
300 #endif
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
301 written += vfs_fwrite(ptr, 1, length, output_file);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
302 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
303
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
304 static void disk_close(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
305 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
306 if (output_file)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
307 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
308 header.length = GUINT32_TO_LE(written + sizeof (struct wavhead) - 8);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
309
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
310 header.data_length = GUINT32_TO_LE(written);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
311 vfs_fseek(output_file, 0, SEEK_SET);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
312 vfs_fwrite(&header, sizeof (struct wavhead), 1, output_file);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
313
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
314 vfs_fclose(output_file);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
315 written = 0;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
316 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
317 output_file = NULL;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
318 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
319
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
320 static void disk_flush(gint time)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
321 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
322 if (time == 0)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
323 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
324 disk_close();
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
325 disk_open(afmt, arate, ach);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
326 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
327 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
328
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
329 static void disk_pause(short p)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
330 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
331 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
332
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
333 static gint disk_free(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
334 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
335 return 1000000;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
336 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
337
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
338 static gint disk_playing(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
339 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
340 return 0;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
341 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
342
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
343 static gint disk_get_written_time(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
344 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
345 if(header.byte_p_sec != 0)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
346 return (gint) ((written * 1000) / header.byte_p_sec);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
347 return 0;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
348 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
349
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
350 static gint disk_get_output_time(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
351 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
352 return disk_get_written_time();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
353 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
354
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
355 static void configure_ok_cb(gpointer data)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
356 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
357 ConfigDb *db;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
358
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
359 if (file_path)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
360 g_free(file_path);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
361 file_path = g_strdup(gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(path_dirbrowser)));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
362
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
363 use_suffix =
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
364 gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(use_suffix_toggle));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
365
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
366 db = bmp_cfg_db_open();
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
367 bmp_cfg_db_set_string(db, "disk_writer", "file_path", file_path);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
368 bmp_cfg_db_set_bool(db, "disk_writer", "save_original", save_original);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
369 bmp_cfg_db_set_bool(db, "disk_writer", "use_suffix", use_suffix);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
370 bmp_cfg_db_close(db);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
371
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
372 gtk_widget_destroy(configure_win);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
373 if (path_dirbrowser)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
374 gtk_widget_destroy(path_dirbrowser);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
375 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
376
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
377 static void saveplace_original_cb(GtkWidget *button, gpointer data)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
378 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
379 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
380 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
381 gtk_widget_set_sensitive(path_hbox, FALSE);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
382 save_original = TRUE;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
383 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
384 }
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
385
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
386 static void saveplace_custom_cb(GtkWidget *button, gpointer data)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
387 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
388 if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
389 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
390 gtk_widget_set_sensitive(path_hbox, TRUE);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
391 save_original = FALSE;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
392 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
393 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
394
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
395 static void configure_destroy(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
396 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
397 if (path_dirbrowser)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
398 gtk_widget_destroy(path_dirbrowser);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
399 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
400
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
401 static void disk_configure(void)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
402 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
403 GtkTooltips *use_suffix_tooltips;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
404
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
405 if (!configure_win)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
406 {
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
407 configure_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
408
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
409 gtk_signal_connect(GTK_OBJECT(configure_win), "destroy",
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
410 GTK_SIGNAL_FUNC(configure_destroy), NULL);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
411 gtk_signal_connect(GTK_OBJECT(configure_win), "destroy",
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
412 GTK_SIGNAL_FUNC(gtk_widget_destroyed),
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
413 &configure_win);
404
41f98fe0c353 [svn] Replace xmms_create_dir_browser & fix other issues. Patch by external contributor Michael Faerber <01mf02 -at- gmail.com>
kiyoshi
parents: 403
diff changeset
414
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
415 gtk_window_set_title(GTK_WINDOW(configure_win),
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
416 _("Disk Writer Configuration"));
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
417 gtk_window_set_position(GTK_WINDOW(configure_win), GTK_WIN_POS_MOUSE);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
418
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
419 gtk_container_set_border_width(GTK_CONTAINER(configure_win), 10);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
420
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
421 configure_vbox = gtk_vbox_new(FALSE, 10);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
422 gtk_container_add(GTK_CONTAINER(configure_win), configure_vbox);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
423
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
424 saveplace_hbox = gtk_hbox_new(FALSE, 5);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
425 gtk_container_add(GTK_CONTAINER(configure_vbox), saveplace_hbox);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
426
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
427 saveplace = gtk_radio_button_new_with_label(NULL, _("Save into original directory"));
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
428 g_signal_connect(G_OBJECT(saveplace), "toggled", G_CALLBACK(saveplace_original_cb), NULL);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
429 gtk_box_pack_start(GTK_BOX(saveplace_hbox), saveplace, FALSE, FALSE, 0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
430
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
431 saveplace = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(saveplace),
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
432 _("Save into custom directory"));
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
433 g_signal_connect(G_OBJECT(saveplace), "toggled", G_CALLBACK(saveplace_custom_cb), NULL);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
434 gtk_box_pack_start(GTK_BOX(saveplace_hbox), saveplace, FALSE, FALSE, 0);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
435
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
436 if (!save_original)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
437 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(saveplace), TRUE);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
438
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
439
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
440
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
441 path_hbox = gtk_hbox_new(FALSE, 5);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
442 gtk_box_pack_start(GTK_BOX(configure_vbox), path_hbox, FALSE, FALSE, 0);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
443
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
444 path_label = gtk_label_new(_("Output file folder:"));
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
445 gtk_box_pack_start(GTK_BOX(path_hbox), path_label, FALSE, FALSE, 0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
446
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
447 path_dirbrowser =
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
448 gtk_file_chooser_button_new ("Pick a folder",
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
449 GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
450 gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(path_dirbrowser),
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
451 file_path);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
452 gtk_box_pack_start(GTK_BOX(path_hbox), path_dirbrowser, TRUE, TRUE, 0);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
453
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
454 if (save_original)
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
455 gtk_widget_set_sensitive(path_hbox, FALSE);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
456
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
457
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
458
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
459 use_suffix_toggle = gtk_check_button_new_with_label(_("Don't strip file name extension"));
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
460 gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(use_suffix_toggle), use_suffix);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
461 gtk_box_pack_start(GTK_BOX(configure_vbox), use_suffix_toggle, FALSE, FALSE, 0);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
462 use_suffix_tooltips = gtk_tooltips_new();
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
463 gtk_tooltips_set_tip(use_suffix_tooltips, use_suffix_toggle, "If enabled, the extension from the original filename will not be stripped before adding the .wav extension to the end.", NULL);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
464 gtk_tooltips_enable(use_suffix_tooltips);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
465
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
466 configure_separator = gtk_hseparator_new();
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
467 gtk_box_pack_start(GTK_BOX(configure_vbox), configure_separator,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
468 FALSE, FALSE, 0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
469
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
470 configure_bbox = gtk_hbutton_box_new();
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
471 gtk_button_box_set_layout(GTK_BUTTON_BOX(configure_bbox),
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
472 GTK_BUTTONBOX_END);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
473 gtk_button_box_set_spacing(GTK_BUTTON_BOX(configure_bbox), 5);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
474 gtk_box_pack_start(GTK_BOX(configure_vbox), configure_bbox,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
475 FALSE, FALSE, 0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
476
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
477 configure_ok = gtk_button_new_from_stock(GTK_STOCK_OK);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
478 gtk_signal_connect(GTK_OBJECT(configure_ok), "clicked",
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
479 GTK_SIGNAL_FUNC(configure_ok_cb), NULL);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
480 gtk_box_pack_start(GTK_BOX(configure_bbox), configure_ok,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
481 TRUE, TRUE, 0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
482
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
483 configure_cancel = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
484 gtk_signal_connect_object(GTK_OBJECT(configure_cancel), "clicked",
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
485 GTK_SIGNAL_FUNC(gtk_widget_destroy),
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
486 GTK_OBJECT(configure_win));
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
487 gtk_box_pack_start(GTK_BOX(configure_bbox), configure_cancel,
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
488 TRUE, TRUE, 0);
404
41f98fe0c353 [svn] Replace xmms_create_dir_browser & fix other issues. Patch by external contributor Michael Faerber <01mf02 -at- gmail.com>
kiyoshi
parents: 403
diff changeset
489
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
490 gtk_widget_show_all(configure_win);
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
491 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
492 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
493
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
494 static void disk_getvol(gint *l, gint *r)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
495 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
496 (*l) = lvol;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
497 (*r) = rvol;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
498 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
499
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
500 static void disk_setvol(gint l, gint r)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
501 {
904
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
502 lvol = l;
4a2e5c1e7c3b [svn] - Added option to save output files to original file directory
mf0102
parents: 658
diff changeset
503 rvol = r;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
504 }