summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--junklib.c30
-rw-r--r--plugins/converter/converter.c50
-rw-r--r--plugins/converter/converter.glade232
-rw-r--r--plugins/converter/converter.h7
-rw-r--r--plugins/converter/convgui.c27
-rw-r--r--plugins/converter/interface.c95
6 files changed, 411 insertions, 30 deletions
diff --git a/junklib.c b/junklib.c
index 74db30f7..0ed85419 100644
--- a/junklib.c
+++ b/junklib.c
@@ -3375,6 +3375,7 @@ junk_recode (const char *in, int inlen, char *out, int outlen, const char *cs) {
int
junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const char *id3v1_encoding) {
+ trace ("junk_rewrite_tags %X\n", junk_flags);
int err = -1;
char *buffer = NULL;
DB_FILE *fp = NULL;
@@ -3389,8 +3390,10 @@ junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const
int write_apev2 = junk_flags & JUNK_WRITE_APEV2;
// find the beginning and the end of audio data
- fp = deadbeef->fopen (pl_find_meta (it, ":URI"));
+ const char *fname = pl_find_meta (it, ":URI");
+ fp = deadbeef->fopen (fname);
if (!fp) {
+ trace ("file not found %s\n", fname);
return -1;
}
@@ -3456,7 +3459,7 @@ junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const
if (!strip_id3v2 && !write_id3v2 && id3v2_size > 0) {
if (deadbeef->fseek (fp, id3v2_start, SEEK_SET) == -1) {
- trace ("cmp3_write_metadata: failed to seek to original id3v2 tag position in %s\n", deadbeef->pl_find_meta (it, ":URI"));
+ trace ("cmp3_write_metadata: failed to seek to original id3v2 tag position in %s\n", pl_find_meta (it, ":URI"));
goto error;
}
uint8_t *buf = malloc (id3v2_size);
@@ -3465,18 +3468,19 @@ junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const
goto error;
}
if (deadbeef->fread (buf, 1, id3v2_size, fp) != id3v2_size) {
- trace ("cmp3_write_metadata: failed to read original id3v2 tag from %s\n", deadbeef->pl_find_meta (it, ":URI"));
+ trace ("cmp3_write_metadata: failed to read original id3v2 tag from %s\n", pl_find_meta (it, ":URI"));
free (buf);
goto error;
}
if (fwrite (buf, 1, id3v2_size, out) != id3v2_size) {
- trace ("cmp3_write_metadata: failed to copy original id3v2 tag from %s to temp file\n", deadbeef->pl_find_meta (it, ":URI"));
+ trace ("cmp3_write_metadata: failed to copy original id3v2 tag from %s to temp file\n", pl_find_meta (it, ":URI"));
free (buf);
goto error;
}
free (buf);
}
else if (write_id3v2) {
+ trace ("writing id3v2\n");
if (id3v2_size <= 0 || strip_id3v2 || deadbeef->junk_id3v2_read_full (NULL, &id3v2, fp) != 0) {
deadbeef->junk_id3v2_free (&id3v2);
memset (&id3v2, 0, sizeof (id3v2));
@@ -3576,7 +3580,7 @@ junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const
// write tag
if (junk_id3v2_write (out, &id3v2) != 0) {
- trace ("cmp3_write_metadata: failed to write id3v2 tag to %s\n", deadbeef->pl_find_meta (it, ":URI"))
+ trace ("cmp3_write_metadata: failed to write id3v2 tag to %s\n", pl_find_meta (it, ":URI"))
goto error;
}
}
@@ -3611,7 +3615,7 @@ junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const
if (!write_apev2 && !strip_apev2 && apev2_start != 0) {
trace ("copying original apev2 tag\n");
if (deadbeef->fseek (fp, apev2_start, SEEK_SET) == -1) {
- trace ("cmp3_write_metadata: failed to seek to original apev2 tag position in %s\n", deadbeef->pl_find_meta (it, ":URI"));
+ trace ("cmp3_write_metadata: failed to seek to original apev2 tag position in %s\n", pl_find_meta (it, ":URI"));
goto error;
}
uint8_t *buf = malloc (apev2_size);
@@ -3620,12 +3624,12 @@ junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const
goto error;
}
if (deadbeef->fread (buf, 1, apev2_size, fp) != apev2_size) {
- trace ("cmp3_write_metadata: failed to read original apev2 tag from %s\n", deadbeef->pl_find_meta (it, ":URI"));
+ trace ("cmp3_write_metadata: failed to read original apev2 tag from %s\n", pl_find_meta (it, ":URI"));
free (buf);
goto error;
}
if (fwrite (buf, 1, apev2_size, out) != apev2_size) {
- trace ("cmp3_write_metadata: failed to copy original apev2 tag from %s to temp file\n", deadbeef->pl_find_meta (it, ":URI"));
+ trace ("cmp3_write_metadata: failed to copy original apev2 tag from %s to temp file\n", pl_find_meta (it, ":URI"));
free (buf);
goto error;
}
@@ -3680,7 +3684,7 @@ junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const
// write tag
if (deadbeef->junk_apev2_write (out, &apev2, 0, 1) != 0) {
- trace ("cmp3_write_metadata: failed to write apev2 tag to %s\n", deadbeef->pl_find_meta (it, ":URI"))
+ trace ("cmp3_write_metadata: failed to write apev2 tag to %s\n", pl_find_meta (it, ":URI"))
goto error;
}
}
@@ -3688,23 +3692,23 @@ junk_rewrite_tags (playItem_t *it, uint32_t junk_flags, int id3v2_version, const
if (!write_id3v1 && !strip_id3v1 && id3v1_start != 0) {
trace ("copying original id3v1 tag %d %d %d\n", write_id3v1, strip_id3v1, id3v1_start);
if (deadbeef->fseek (fp, id3v1_start, SEEK_SET) == -1) {
- trace ("cmp3_write_metadata: failed to seek to original id3v1 tag position in %s\n", deadbeef->pl_find_meta (it, ":URI"));
+ trace ("cmp3_write_metadata: failed to seek to original id3v1 tag position in %s\n", pl_find_meta (it, ":URI"));
goto error;
}
char buf[128];
if (deadbeef->fread (buf, 1, 128, fp) != 128) {
- trace ("cmp3_write_metadata: failed to read original id3v1 tag from %s\n", deadbeef->pl_find_meta (it, ":URI"));
+ trace ("cmp3_write_metadata: failed to read original id3v1 tag from %s\n", pl_find_meta (it, ":URI"));
goto error;
}
if (fwrite (buf, 1, 128, out) != 128) {
- trace ("cmp3_write_metadata: failed to copy id3v1 tag from %s to temp file\n", deadbeef->pl_find_meta (it, ":URI"));
+ trace ("cmp3_write_metadata: failed to copy id3v1 tag from %s to temp file\n", pl_find_meta (it, ":URI"));
goto error;
}
}
else if (write_id3v1) {
trace ("writing new id3v1 tag\n");
if (junk_id3v1_write (out, it) != 0) {
- trace ("cmp3_write_metadata: failed to write id3v1 tag to %s\n", deadbeef->pl_find_meta (it, ":URI"))
+ trace ("cmp3_write_metadata: failed to write id3v1 tag to %s\n", pl_find_meta (it, ":URI"))
goto error;
}
}
diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c
index ac84debe..5d6ca1fa 100644
--- a/plugins/converter/converter.c
+++ b/plugins/converter/converter.c
@@ -105,6 +105,24 @@ encoder_preset_load (const char *fname) {
else if (!strcmp (str, "defaultfmt")) {
sscanf (item, "%X", &p->default_format);
}
+ else if (!strcmp (str, "id3v2_version")) {
+ p->id3v2_version = atoi (item);
+ }
+ else if (!strcmp (str, "tag_id3v2")) {
+ p->tag_id3v2 = atoi (item);
+ }
+ else if (!strcmp (str, "tag_id3v1")) {
+ p->tag_id3v1 = atoi (item);
+ }
+ else if (!strcmp (str, "tag_apev2")) {
+ p->tag_apev2 = atoi (item);
+ }
+ else if (!strcmp (str, "tag_flac")) {
+ p->tag_flac = atoi (item);
+ }
+ else if (!strcmp (str, "tag_oggvorbis")) {
+ p->tag_oggvorbis = atoi (item);
+ }
}
if (!p->title) {
@@ -165,6 +183,12 @@ encoder_preset_save (ddb_encoder_preset_t *p, int overwrite) {
fprintf (fp, "method %d\n", p->method);
fprintf (fp, "formats %08X\n", p->formats);
fprintf (fp, "defaultfmt %08X\n", p->default_format);
+ fprintf (fp, "id3v2_version %d\n", p->id3v2_version);
+ fprintf (fp, "tag_id3v2 %d\n", p->tag_id3v2);
+ fprintf (fp, "tag_id3v1 %d\n", p->tag_id3v1);
+ fprintf (fp, "tag_apev2 %d\n", p->tag_apev2);
+ fprintf (fp, "tag_flac %d\n", p->tag_flac);
+ fprintf (fp, "tag_oggvorbis %d\n", p->tag_oggvorbis);
fclose (fp);
return 0;
@@ -178,6 +202,13 @@ encoder_preset_copy (ddb_encoder_preset_t *to, ddb_encoder_preset_t *from) {
to->method = from->method;
to->formats = from->formats;
to->default_format = from->default_format;
+ to->tag_id3v2 = from->tag_id3v2;
+ to->tag_id3v1 = from->tag_id3v1;
+ to->tag_apev2 = from->tag_apev2;
+ to->tag_flac = from->tag_flac;
+ to->tag_oggvorbis = from->tag_oggvorbis;
+ to->tag_mp3xing = from->tag_mp3xing;
+ to->id3v2_version = from->id3v2_version;
}
ddb_encoder_preset_t *
@@ -762,6 +793,25 @@ error:
unlink (input_file_name);
}
+ // write tags
+ uint32_t tagflags = JUNK_STRIP_ID3V2 | JUNK_STRIP_APEV2 | JUNK_STRIP_ID3V1;
+ if (encoder_preset->tag_id3v2) {
+ tagflags |= JUNK_WRITE_ID3V2;
+ }
+ if (encoder_preset->tag_id3v1) {
+ tagflags |= JUNK_WRITE_ID3V1;
+ }
+ if (encoder_preset->tag_apev2) {
+ tagflags |= JUNK_WRITE_APEV2;
+ }
+ DB_playItem_t *out_it = deadbeef->pl_item_alloc ();
+ deadbeef->pl_item_copy (out_it, it);
+ deadbeef->pl_replace_meta (out_it, ":URI", out);
+
+ deadbeef->junk_rewrite_tags (out_it, tagflags, encoder_preset->id3v2_version + 3, "iso8859-1");
+
+ deadbeef->pl_item_unref (out_it);
+
return err;
}
diff --git a/plugins/converter/converter.glade b/plugins/converter/converter.glade
index 93c9f35e..6f5b68ba 100644
--- a/plugins/converter/converter.glade
+++ b/plugins/converter/converter.glade
@@ -859,7 +859,7 @@ Overwrite</property>
</widget>
<packing>
<property name="padding">0</property>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
@@ -953,6 +953,32 @@ Overwrite</property>
</child>
<child>
+ <widget class="GtkLabel" id="label124">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;small&gt;%o - output file name
+%i - temporary input file name&lt;/small&gt;</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
<widget class="GtkHBox" id="hbox73">
<property name="visible">True</property>
<property name="homogeneous">False</property>
@@ -1026,7 +1052,7 @@ Temporary file</property>
<child>
<widget class="GtkVBox" id="vbox35">
- <property name="border_width">12</property>
+ <property name="border_width">8</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">8</property>
@@ -1152,7 +1178,7 @@ Temporary file</property>
</widget>
<packing>
<property name="padding">0</property>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
@@ -1208,7 +1234,7 @@ Temporary file</property>
</widget>
<packing>
<property name="padding">0</property>
- <property name="expand">True</property>
+ <property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
@@ -1246,6 +1272,204 @@ Temporary file</property>
<property name="fill">True</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkFrame" id="frame9">
+ <property name="visible">True</property>
+ <property name="label_xalign">0</property>
+ <property name="label_yalign">0.5</property>
+ <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment21">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">1</property>
+ <property name="yscale">1</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">12</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkTable" id="table2">
+ <property name="border_width">8</property>
+ <property name="visible">True</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">3</property>
+ <property name="homogeneous">False</property>
+ <property name="row_spacing">0</property>
+ <property name="column_spacing">8</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="apev2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">APEv2</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="id3v1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">ID3v1</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="oggvorbis">
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">OggVorbis</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkCheckButton" id="flac">
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">FLAC</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">fill</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox104">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="id3v2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">ID3v2</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="id3v2_version">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">2.3
+2.4</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="right_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="bottom_attach">1</property>
+ <property name="y_options">fill</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label125">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Tag writer&lt;/b&gt;</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="type">label_item</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/plugins/converter/converter.h b/plugins/converter/converter.h
index 8eb723f1..2218c328 100644
--- a/plugins/converter/converter.h
+++ b/plugins/converter/converter.h
@@ -48,6 +48,13 @@ typedef struct ddb_encoder_preset_s {
int method; // pipe or file
uint32_t formats; // combination of supported flags (FMT_*)
uint32_t default_format;
+ int tag_id3v2;
+ int tag_id3v1;
+ int tag_apev2;
+ int tag_flac;
+ int tag_oggvorbis;
+ int tag_mp3xing;
+ int id3v2_version;
} ddb_encoder_preset_t;
typedef struct ddb_dsp_preset_s {
diff --git a/plugins/converter/convgui.c b/plugins/converter/convgui.c
index c19695f4..a8740ad2 100644
--- a/plugins/converter/convgui.c
+++ b/plugins/converter/convgui.c
@@ -147,8 +147,6 @@ converter_worker (void *ctx) {
}
}
- printf ("outpath: %s\n", outpath);
-
converter_plugin->convert (conv->convert_items[n], conv->outfolder, conv->outfile, conv->output_bps, conv->output_is_float, conv->preserve_folder_structure, conv->preserve_root_folder, conv->encoder_preset, conv->dsp_preset, &conv->cancelled);
if (conv->cancelled) {
for (; n < conv->convert_items_count; n++) {
@@ -572,6 +570,13 @@ init_encoder_preset_from_dlg (GtkWidget *dlg, ddb_encoder_preset_t *p) {
p->default_format = DDB_ENCODER_FMT_32BITFLOAT;
break;
}
+
+ p->id3v2_version = gtk_combo_box_get_active (GTK_COMBO_BOX (lookup_widget (dlg, "id3v2_version")));
+ p->tag_id3v2 = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (lookup_widget (dlg, "id3v2")));
+ p->tag_id3v1 = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (lookup_widget (dlg, "id3v1")));
+ p->tag_apev2 = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (lookup_widget (dlg, "apev2")));
+ p->tag_flac = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (lookup_widget (dlg, "flac")));
+ p->tag_oggvorbis = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (lookup_widget (dlg, "oggvorbis")));
}
int
@@ -631,6 +636,13 @@ edit_encoder_preset (char *title, GtkWidget *toplevel, int overwrite) {
gtk_combo_box_set_active (GTK_COMBO_BOX (lookup_widget (dlg, "defaultfmt")), default_fmt);
}
+ gtk_combo_box_set_active (GTK_COMBO_BOX (lookup_widget (dlg, "id3v2_version")), p->id3v2_version);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (dlg, "id3v2")), p->tag_id3v2);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (dlg, "id3v1")), p->tag_id3v1);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (dlg, "apev2")), p->tag_apev2);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (dlg, "flac")), p->tag_flac);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (lookup_widget (dlg, "oggvorbis")), p->tag_oggvorbis);
+
ddb_encoder_preset_t *old = p;
int r = GTK_RESPONSE_CANCEL;
for (;;) {
@@ -650,13 +662,9 @@ edit_encoder_preset (char *title, GtkWidget *toplevel, int overwrite) {
free (old->title);
free (old->ext);
free (old->encoder);
- old->title = p->title;
- old->ext = p->ext;
- old->encoder = p->encoder;
- old->method = p->method;
- old->formats = p->formats;
- old->default_format = p->default_format;
- free (p);
+
+ converter_plugin->encoder_preset_copy (old, p);
+ converter_plugin->encoder_preset_free (p);
}
else {
GtkWidget *warndlg = gtk_message_dialog_new (GTK_WINDOW (gtkui_plugin->get_mainwin ()), GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Failed to save encoder preset"));
@@ -714,6 +722,7 @@ on_encoder_preset_add (GtkButton *button,
current_ctx->current_encoder_preset = converter_plugin->encoder_preset_alloc ();
current_ctx->current_encoder_preset->formats = DDB_ENCODER_FMT_16BIT;
current_ctx->current_encoder_preset->default_format = DDB_ENCODER_FMT_16BIT;
+
if (GTK_RESPONSE_OK == edit_encoder_preset (_("Add new encoder"), toplevel, 0)) {
converter_plugin->encoder_preset_append (current_ctx->current_encoder_preset);
GtkComboBox *combo = GTK_COMBO_BOX (lookup_widget (current_ctx->converter, "encoder"));
diff --git a/plugins/converter/interface.c b/plugins/converter/interface.c
index 8414d2d9..ff220703 100644
--- a/plugins/converter/interface.c
+++ b/plugins/converter/interface.c
@@ -360,6 +360,7 @@ create_convpreset_editor (void)
GtkWidget *hbox93;
GtkWidget *encoder;
GtkWidget *custom4;
+ GtkWidget *label124;
GtkWidget *hbox73;
GtkWidget *label107;
GtkWidget *method;
@@ -376,6 +377,17 @@ create_convpreset_editor (void)
GtkWidget *label123;
GtkWidget *defaultfmt;
GtkWidget *label118;
+ GtkWidget *frame9;
+ GtkWidget *alignment21;
+ GtkWidget *table2;
+ GtkWidget *apev2;
+ GtkWidget *id3v1;
+ GtkWidget *oggvorbis;
+ GtkWidget *flac;
+ GtkWidget *hbox104;
+ GtkWidget *id3v2;
+ GtkWidget *id3v2_version;
+ GtkWidget *label125;
GtkWidget *dialog_action_area6;
GtkWidget *convpreset_cancel;
GtkWidget *convpreset_ok;
@@ -413,7 +425,7 @@ create_convpreset_editor (void)
hbox96 = gtk_hbox_new (FALSE, 9);
gtk_widget_show (hbox96);
- gtk_box_pack_start (GTK_BOX (vbox27), hbox96, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox27), hbox96, FALSE, TRUE, 0);
label120 = gtk_label_new (_("Output file extension:"));
gtk_widget_show (label120);
@@ -451,6 +463,11 @@ create_convpreset_editor (void)
GTK_WIDGET_UNSET_FLAGS (custom4, GTK_CAN_FOCUS);
GTK_WIDGET_UNSET_FLAGS (custom4, GTK_CAN_DEFAULT);
+ label124 = gtk_label_new (_("<small>%o - output file name\n%i - temporary input file name</small>"));
+ gtk_widget_show (label124);
+ gtk_box_pack_start (GTK_BOX (vbox27), label124, FALSE, FALSE, 0);
+ gtk_label_set_use_markup (GTK_LABEL (label124), TRUE);
+
hbox73 = gtk_hbox_new (FALSE, 8);
gtk_widget_show (hbox73);
gtk_box_pack_start (GTK_BOX (vbox27), hbox73, FALSE, TRUE, 0);
@@ -477,11 +494,11 @@ create_convpreset_editor (void)
vbox35 = gtk_vbox_new (FALSE, 8);
gtk_widget_show (vbox35);
gtk_container_add (GTK_CONTAINER (alignment20), vbox35);
- gtk_container_set_border_width (GTK_CONTAINER (vbox35), 12);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox35), 8);
table1 = gtk_table_new (3, 2, FALSE);
gtk_widget_show (table1);
- gtk_box_pack_start (GTK_BOX (vbox35), table1, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox35), table1, FALSE, TRUE, 0);
gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
@@ -517,7 +534,7 @@ create_convpreset_editor (void)
hbox103 = gtk_hbox_new (FALSE, 8);
gtk_widget_show (hbox103);
- gtk_box_pack_start (GTK_BOX (vbox35), hbox103, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox35), hbox103, FALSE, TRUE, 0);
label123 = gtk_label_new (_("Default format:"));
gtk_widget_show (label123);
@@ -537,6 +554,64 @@ create_convpreset_editor (void)
gtk_frame_set_label_widget (GTK_FRAME (frame8), label118);
gtk_label_set_use_markup (GTK_LABEL (label118), TRUE);
+ frame9 = gtk_frame_new (NULL);
+ gtk_widget_show (frame9);
+ gtk_box_pack_start (GTK_BOX (vbox27), frame9, TRUE, TRUE, 0);
+
+ alignment21 = gtk_alignment_new (0.5, 0.5, 1, 1);
+ gtk_widget_show (alignment21);
+ gtk_container_add (GTK_CONTAINER (frame9), alignment21);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment21), 0, 0, 12, 0);
+
+ table2 = gtk_table_new (2, 3, FALSE);
+ gtk_widget_show (table2);
+ gtk_container_add (GTK_CONTAINER (alignment21), table2);
+ gtk_container_set_border_width (GTK_CONTAINER (table2), 8);
+ gtk_table_set_col_spacings (GTK_TABLE (table2), 8);
+
+ apev2 = gtk_check_button_new_with_mnemonic (_("APEv2"));
+ gtk_widget_show (apev2);
+ gtk_table_attach (GTK_TABLE (table2), apev2, 1, 2, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ id3v1 = gtk_check_button_new_with_mnemonic (_("ID3v1"));
+ gtk_widget_show (id3v1);
+ gtk_table_attach (GTK_TABLE (table2), id3v1, 2, 3, 0, 1,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ oggvorbis = gtk_check_button_new_with_mnemonic (_("OggVorbis"));
+ gtk_table_attach (GTK_TABLE (table2), oggvorbis, 2, 3, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ flac = gtk_check_button_new_with_mnemonic (_("FLAC"));
+ gtk_table_attach (GTK_TABLE (table2), flac, 1, 2, 1, 2,
+ (GtkAttachOptions) (GTK_FILL),
+ (GtkAttachOptions) (0), 0, 0);
+
+ hbox104 = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox104);
+ gtk_table_attach (GTK_TABLE (table2), hbox104, 0, 1, 0, 1,
+ (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
+ (GtkAttachOptions) (GTK_FILL), 0, 0);
+
+ id3v2 = gtk_check_button_new_with_mnemonic (_("ID3v2"));
+ gtk_widget_show (id3v2);
+ gtk_box_pack_start (GTK_BOX (hbox104), id3v2, FALSE, FALSE, 0);
+
+ id3v2_version = gtk_combo_box_new_text ();
+ gtk_widget_show (id3v2_version);
+ gtk_box_pack_start (GTK_BOX (hbox104), id3v2_version, TRUE, TRUE, 0);
+ gtk_combo_box_append_text (GTK_COMBO_BOX (id3v2_version), _("2.3"));
+ gtk_combo_box_append_text (GTK_COMBO_BOX (id3v2_version), _("2.4"));
+
+ label125 = gtk_label_new (_("<b>Tag writer</b>"));
+ gtk_widget_show (label125);
+ gtk_frame_set_label_widget (GTK_FRAME (frame9), label125);
+ gtk_label_set_use_markup (GTK_LABEL (label125), TRUE);
+
dialog_action_area6 = GTK_DIALOG (convpreset_editor)->action_area;
gtk_widget_show (dialog_action_area6);
gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area6), GTK_BUTTONBOX_END);
@@ -570,6 +645,7 @@ create_convpreset_editor (void)
GLADE_HOOKUP_OBJECT (convpreset_editor, hbox93, "hbox93");
GLADE_HOOKUP_OBJECT (convpreset_editor, encoder, "encoder");
GLADE_HOOKUP_OBJECT (convpreset_editor, custom4, "custom4");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, label124, "label124");
GLADE_HOOKUP_OBJECT (convpreset_editor, hbox73, "hbox73");
GLADE_HOOKUP_OBJECT (convpreset_editor, label107, "label107");
GLADE_HOOKUP_OBJECT (convpreset_editor, method, "method");
@@ -586,6 +662,17 @@ create_convpreset_editor (void)
GLADE_HOOKUP_OBJECT (convpreset_editor, label123, "label123");
GLADE_HOOKUP_OBJECT (convpreset_editor, defaultfmt, "defaultfmt");
GLADE_HOOKUP_OBJECT (convpreset_editor, label118, "label118");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, frame9, "frame9");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, alignment21, "alignment21");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, table2, "table2");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, apev2, "apev2");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, id3v1, "id3v1");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, oggvorbis, "oggvorbis");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, flac, "flac");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, hbox104, "hbox104");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, id3v2, "id3v2");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, id3v2_version, "id3v2_version");
+ GLADE_HOOKUP_OBJECT (convpreset_editor, label125, "label125");
GLADE_HOOKUP_OBJECT_NO_REF (convpreset_editor, dialog_action_area6, "dialog_action_area6");
GLADE_HOOKUP_OBJECT (convpreset_editor, convpreset_cancel, "convpreset_cancel");
GLADE_HOOKUP_OBJECT (convpreset_editor, convpreset_ok, "convpreset_ok");