Commit ee8f0780 authored by Tony Mancill's avatar Tony Mancill

Imported Upstream version 2.7.0

parent bdac4b10
......@@ -427,7 +427,7 @@ Version 2.6.4 2004-11-21
-------------------------------------------------------------------------
Version 2.6.5 2005-06-01
* fixed IDv3 problem with vorbis tags in OGG files where song titles are
* fixed ID3v1 problem with vorbis tags in OGG files where song titles are
longer than 30 characters
* added basic m3u playlist support (unqualified filenames in target dir);
the config dialog option is in "Files"
......@@ -452,3 +452,11 @@ Version 2.6.7 2005-11-06
receives cursor focus for editing. This circumvents the call to
put_track_title() which was causing the cursor to jump to the end
of the text buffer.
-------------------------------------------------------------------------
Version 2.7.0 2006-04-16
* applied ID3v2 patches (provided by Ben Zonneveld - thanks!)
- compilation now depends on id3lib
* changed how vorbiscomment is invoked for tagging OGG files;
the OGG file no longer has to be copied during tagging
......@@ -6,7 +6,7 @@ The installation procedure is
If you can't be root, use '--prefix=' option when running configure.
To build ripperX, you need gtk. You can get current version of gtk at
www.gtk.org
www.gtk.org. You also need id3lib (http://id3lib.sourceforge.net/)
You will need cdparanoia to rip digital audio from your CD-ROM. You can
get the latest version at http://www.xiph.org/paranoia/index.html
......
These things are on the wishlist for 2.x releases of ripperX; they are
listed in some semblance of priority.
* update CDDB code/protocol version - HTTP seems to be broken due to this
* support ID3v2 tags
* AMD64 support
* support for the "toolame" encoder
* Eject cd when complete (option to spec cdrom?)
* Add the ability to submit CD data to the CDDB if the CD is not found.
* Eject cd when complete (option to spec cdrom?)
ripperx (2.7.0-1) unstable; urgency=low
* new upstream release
- ID3v2 tag support added by Ben Zonneveld
- added build dependency on id3lib-dev
- OGG tag fields can now (safely) exceed 30 characters
(closes: #347331)
-- tony mancill <tmancill@debian.org> Tue, 18 Apr 2006 20:27:50 -0700
ripperx (2.6.7-2) unstable; urgency=low
* update outdated xlibs-dev dependencies (closes: #347038)
-- tony mancill <tmancill@debian.org> Sun, 8 Jan 2006 20:07:28 -0800
ripperx (2.6.7-1) unstable; urgency=low
* new upstream release:
......
......@@ -2,7 +2,7 @@ Source: ripperx
Section: sound
Priority: optional
Maintainer: tony mancill <tmancill@debian.org>
Build-Depends: debhelper (>= 2.0), docbook-to-man, libgtk1.2-dev, libglib1.2-dev, xlibs-dev
Build-Depends: debhelper (>= 4.0), docbook-to-man, libgtk1.2-dev, libglib1.2-dev, libid3-dev
Standards-Version: 3.5.9
Package: ripperx
......@@ -15,5 +15,5 @@ Description: a GTK-based audio CD ripper/encoder
formats using the vorbis tools, FLAC, toolame or other available
MP3 encoders.
.
It includes support for CDDB lookups and IDv1 tags.
It includes support for CDDB lookups and ID3v2 tags.
......@@ -7,7 +7,8 @@ It can be downloaded from:
Original author: TeJun Huh <wineking@adam.kaist.ac.kr>
Bugs/enchancements: Scott Sams <sbsams@eos.ncsu.edu>
Current maintainer: Jos Dehaes <joske@users.sourceforge.net>
Jos Dehaes <joske@users.sourceforge.net>
Current maintainer: tony mancill <tmancill@users.sourceforge.net>
Copyright: GPL
(see /usr/share/common-licenses/GPL)
......@@ -108,10 +108,8 @@
<title>BUGS</title>
<para>Many, I'm sure... Please report them as you find them!</para>
<para>Many, do be sure... Please report them as you find them!</para>
<para>Currently, only ID3v1 tags are supported.</para>
</refsect1>
<refsect1>
......
#!/bin/sh
#
#############################################################
# Automatically added by dh_installmenu
if [ "$1" = "configure" ] && [ -x /usr/bin/update-menus ]; then update-menus ; fi
# End automatically added section
#!/bin/sh
#
#################################################
# Automatically added by dh_installmenu
if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
# End automatically added section
......@@ -6,7 +6,7 @@
export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=2
export DH_COMPAT=4
configure: configure-stamp
configure-stamp:
......
......@@ -59,11 +59,9 @@ toolame (1).
Documentation in /usr/share/doc/ripperx/
.SH "BUGS"
.PP
Many, I'm sure... Please report them as you find them!
.PP
Currently, only ID3v1 tags are supported.
Many, do be sure... Please report them as you find them!
.SH "AUTHOR"
.PP
This manual page was written by tony mancill tmancill@debian.org for
the \fBDebian GNU/Linux\fP system (but may be used by others).
.\" created by instant / docbook-to-man, Fri 03 Jun 2005, 10:05
.\" created by instant / docbook-to-man, Mon 17 Apr 2006, 22:54
%define ver 2.6.6
%define ver 2.7.0
%define prefix /usr
%define rel 1
......@@ -12,7 +12,7 @@ Group: X11/Applications
Requires: cdparanoia
Source: ftp://ftp.sf.net/pub/sourceforge/r/ri/ripperX/ripperX-%{ver}.tar.gz
URL: ripperx.sourceforge.net
Packager: tonyu mancill <tony@mancill.com>
Packager: tony mancill <tmancill@debian.org>
BuildRoot: /var/tmp/ripperX-%{PACKAGE_VERSION}-root
Docdir: %{prefix}/doc
......@@ -60,6 +60,8 @@ rm -rf $RPM_BUILD_ROOT
%{prefix}/share/gnome/apps/Multimedia/ripperX.desktop
%changelog
* Sun Apr 16 2006 tony mancill <tmancill@debian.org>
- version 2.7.0
* Wed Jun 01 2005 tony mancill <tony@mancill.com>
- version 2.6.6
- fixes for cdparanoia output on Fedora Core 3
......
......@@ -11,7 +11,7 @@ mandir = @mandir@
CC = @CC@
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@ @LIBS@ -lutil
LDFLAGS = @LDFLAGS@ @LIBS@ -lutil -lid3
INSTALL = @INSTALL@
CFILES = main.c\
......@@ -28,6 +28,7 @@ CFILES = main.c\
cddbp.c\
cddb.c\
id3.c\
id3lib.c\
misc_utils.c\
OFILES = $(patsubst %.c,%.o,$(CFILES))
......
......@@ -18,11 +18,11 @@ enum lookup_protocol { CDDBP, HTTP };
enum lookup_order { NONE, LOCAL, REMOTE, LOCAL_REMOTE, REMOTE_LOCAL };
int cddb_handle_data( const char *data, char** artist, char** dtitle, char* titles[], int* totaltracks );
int cddb_handle_data( const char *data, char** artist, char** dtitle, char* titles[], int* totaltracks, char** year, char** dgenre );
int do_cddb( char** result, char **disc_category, int tracknum, int duration, long int offset[], const char* server, int port, int proto );
int cddb_handle_data( const char *data, char** artist, char** dtitle, char* titles[], int* totaltracks )
int cddb_handle_data( const char *data, char** artist, char** dtitle, char* titles[], int* totaltracks, char** year, char** dgenre )
{
char * row, *mark;
const char *tmp = data;
......@@ -46,7 +46,28 @@ int cddb_handle_data( const char *data, char** artist, char** dtitle, char* titl
tmp += i;
/* eval the row */
if ( strncmp( row, "TTITLE", 6 ) == 0 ) { /* Track Title */
if( strncmp( row, "DYEAR", 5 ) == 0 ) { /* CD Year */
tempstr=malloc(MAX_YEAR_LENGTH);
strcpy(tempstr,row);
tempstr=strchr( row, '=' );
tempstr++;
j = strlen (tempstr);
( *year )=(char* ) malloc ( j + 1 );
strncpy( ( *year ),tempstr, ( j + 1) );
remove_non_unix_chars(*year);
} else if ( strncmp( row, "DGENRE", 6 ) == 0 ) { /* Disc Genre */
tempstr=malloc(MAX_GENRE_LENGTH);
strcpy(tempstr,row);
tempstr=strchr( row, '=' );
tempstr++;
j = strlen (tempstr);
( *dgenre )=(char* ) malloc( j + 1 );
strncpy( ( *dgenre ),tempstr, ( j + 1 ));
remove_non_unix_chars(*dgenre);
} else if ( strncmp( row, "TTITLE", 6 ) == 0 ) { /* Track Title */
/* get the track number before going on */
/* skip the TTITLE */
mark = row + 6;
......@@ -127,7 +148,7 @@ int cddb_handle_data( const char *data, char** artist, char** dtitle, char* titl
printf( "Artist: %s\n", ( *artist ) );
printf( "Dtitle: %s\n", ( *dtitle ) );
#endif
}
}
/* ignore any other results */
free( row );
......@@ -425,6 +446,8 @@ int cddb_main( _main_data *main_data )
char* dtitle = NULL;
char* category = NULL;
char* titles[ MAX_NUM_TRACK ];
char* year = NULL;
char* dgenre = NULL;
int tracknum = main_data->num_tracks;
int duration = main_data->total_length;
......@@ -450,7 +473,7 @@ int cddb_main( _main_data *main_data )
switch ( err ) {
case REMOTE_OK :
/* successful lookup, now parse the returned data */
cddb_handle_data( result, &artist, &dtitle, titles, &totaltracks );
cddb_handle_data( result, &artist, &dtitle, titles, &totaltracks, &year, &dgenre );
if ( artist == 0 )
strcpy( main_data->disc_artist, "" );
......@@ -462,11 +485,16 @@ int cddb_main( _main_data *main_data )
else
strcpy( main_data->disc_title, dtitle );
free( dtitle );
if ( category == 0 )
if ( dgenre == 0 )
strcpy( main_data->disc_category, "" );
else
strcpy( main_data->disc_category, category );
strcpy( main_data->disc_category, dgenre );
free( category );
if ( year == 0 )
strcpy( main_data->disc_year, "" );
else
strcpy( main_data->disc_year, year );
free( year );
for ( i = 0; i < tracknum; i++ ) /* fixed a sneaky bug here */
{
/* copy the data into the main_data structure */
......
......@@ -282,7 +282,6 @@ int http_query( const char *server, int port, const char *URL,
printf( "=> %s\n", buffer );
#endif
sock = socket_init( server, port );
if ( !sock )
return 999;
......@@ -341,8 +340,7 @@ int http_query( const char *server, int port, const char *URL,
( *category_buffer ) [ *matches ][ i ] = 0; /*terminate the string*/
buffer += i + 1; /* skip to the disk id */
( *id_buffer ) [ *matches ] = ( char* ) malloc( 9 ); /* the disk id is always
8 char long */
( *id_buffer ) [ *matches ] = ( char* ) malloc( 9 ); /* the disk id is always 8 char long */
strncpy( ( *id_buffer ) [ *matches ], buffer, 8 );
( *id_buffer ) [ *matches ][ 8 ] = 0; /*terminate the string */
buffer += 9;
......@@ -493,7 +491,7 @@ int http_read( const char *server, int port, const char *URL,
return 999;
fprintf( sock,
"GET /%s?cmd=cddb+read+%s+%s&hello=%s+%s+%s+%s&proto=1 HTTP/1.0\r\n\r\n",
"GET /%s?cmd=cddb+read+%s+%s&hello=%s+%s+%s+%s&proto=5 HTTP/1.0\r\n\r\n",
URL, category, disk_id, "anonymous", "localhost", client,
version );
......@@ -548,7 +546,7 @@ int http_read_proxy( const char *server, int port, const char *proxy_server, int
return 999;
fprintf( sock,
"GET http://%s:%i/%s?cmd=cddb+read+%s+%s&hello=%s+%s+%s+%s&proto=1 HTTP/1.0\r\n\r\n",
"GET http://%s:%i/%s?cmd=cddb+read+%s+%s&hello=%s+%s+%s+%s&proto=5 HTTP/1.0\r\n\r\n",
server, port, URL, category, disk_id, "anonymous", "localhost", client,
version );
......
......@@ -16,7 +16,7 @@
#include <sys/types.h>
#include "err_dialog_handler.h"
#define VERSION "2.6.7"
#define VERSION "2.7.0"
#ifndef TRUE
#define TRUE 1
......@@ -45,6 +45,7 @@
#define MAX_TITLE_LENGTH 1024
#define MAX_ARTIST_LENGTH 1024
#define MAX_YEAR_LENGTH 30
#define MAX_GENRE_LENGTH 1024
#define CD_SECTORS_PER_SEC (float)75.018
#define CD_SECTORS_PER_FRAME (float)1.959
......@@ -53,7 +54,7 @@
#define WAV 1
#define MP3 2
#define OGG 3
#define FLAC 4
#define FLAC 4
#define MIN_NICE_LEVEL 19
#define MAX_NICE_LEVEL 0
......@@ -124,11 +125,12 @@ typedef struct {
/* Main data structure */
/* All length is in cd sector unit */
typedef struct {
int encoding_type;
int num_tracks;
int total_length;
char disc_artist[ MAX_ARTIST_LENGTH ];
char disc_title[ MAX_ARTIST_LENGTH ];
// char disc_year[ MAX_YEAR_LENGTH ]; // Putting this after category upsets text for Track1 - M.Tyler 6-3-2005
char disc_year[ MAX_YEAR_LENGTH ];
char disc_category[ MAX_ARTIST_LENGTH ];
struct _track {
char title[ MAX_FILE_NAME_LENGTH ];
......
......@@ -377,6 +377,7 @@ int cw_mp3_handler( int ops, _main_data *main_data, GtkWidget *notebook )
static struct {
GtkWidget *menu_item;
int encoding_type;
char *encoder;
char *plugin;
char *description;
......@@ -386,17 +387,17 @@ int cw_mp3_handler( int ops, _main_data *main_data, GtkWidget *notebook )
char *high_qual_op;
char *crc_op;
} plugins[] = {
{ NULL, "toolame", "ripperX_plugin-toolame", "toolame layer 2 encoder", "-b", "", "-v", "", "-e"},
{ NULL, "encode ", "ripperX_plugin-encode", "ISO Encoder v2", "-b", "", "", "", "-e"},
{ NULL, "8hz-mp3 ", "ripperX_plugin-8hz-mp3", "8hz-mp3 Encoder", "-b", "", "", "", ""},
{ NULL, "lame", "ripperX_plugin-lame", "Lame MP3 Encoder", "-b", "--nohist -v", "-V", "-h", "-p"},
{ NULL, "gogo", "ripperX_plugin-gogo", "GoGo MP3 Encoder", "-b", "-v 4", "", "", ""},
{ NULL, "bladeenc", "ripperX_plugin-bladeenc", "BladeEnc MP3 Encoder", "-br", "", "", "", "-crc"},
{ NULL, "xingmp3enc", "ripperX_plugin-xingmp3enc", "Xingmp3enc MP3 Encoder", "-B", "", "", "", ""},
{ NULL, "l3enc", "ripperX_plugin-l3enc", "FHG MP3 Encoder (l3enc v2.72)", "-br", "", "", "-hq", "-crc"},
{ NULL, "mp3enc", "ripperX_plugin-mp3enc", "FHG MP3 Encoder (mp3enc 3.1)", "-br", "", "", "-qual 9", "-crc"},
{ NULL, "oggenc", "ripperX_plugin-oggenc", "OggVorbis encoder", "-b", "", "", "", "" },
{ NULL, "flac", "ripperX_plugin-flac", "FLAC encoder", "", "", "", "", "" }
{ NULL, MP3, "toolame", "ripperX_plugin-toolame", "toolame layer 2 encoder", "-b", "", "-v", "", "-e"},
{ NULL, MP3, "encode ", "ripperX_plugin-encode", "ISO Encoder v2", "-b", "", "", "", "-e"},
{ NULL, MP3, "8hz-mp3 ", "ripperX_plugin-8hz-mp3", "8hz-mp3 Encoder", "-b", "", "", "", ""},
{ NULL, MP3, "lame", "ripperX_plugin-lame", "Lame MP3 Encoder", "-b", "--nohist -v", "-V", "-h", "-p"},
{ NULL, MP3, "gogo", "ripperX_plugin-gogo", "GoGo MP3 Encoder", "-b", "-v 4", "", "", ""},
{ NULL, MP3, "bladeenc", "ripperX_plugin-bladeenc", "BladeEnc MP3 Encoder", "-br", "", "", "", "-crc"},
{ NULL, MP3, "xingmp3enc", "ripperX_plugin-xingmp3enc", "Xingmp3enc MP3 Encoder", "-B", "", "", "", ""},
{ NULL, MP3, "l3enc", "ripperX_plugin-l3enc", "FHG MP3 Encoder (l3enc v2.72)", "-br", "", "", "-hq", "-crc"},
{ NULL, MP3, "mp3enc", "ripperX_plugin-mp3enc", "FHG MP3 Encoder (mp3enc 3.1)", "-br", "", "", "-qual 9", "-crc"},
{ NULL, OGG, "oggenc", "ripperX_plugin-oggenc", "OggVorbis encoder", "-b", "", "", "", "" },
{ NULL, FLAC, "flac", "ripperX_plugin-flac", "FLAC encoder", "", "", "", "", "" }
};
static struct {
......@@ -578,6 +579,7 @@ int cw_mp3_handler( int ops, _main_data *main_data, GtkWidget *notebook )
}
strcpy( config.encoder.encoder, plugins[ cur_plugin ].encoder );
strcpy( config.encoder.plugin, plugins[ cur_plugin ].plugin );
main_data->encoding_type = plugins[ cur_plugin ].encoding_type;
if ( GTK_TOGGLE_BUTTON( use_varbitrate_ckbx ) ->active )
config.encoder.use_varbitrate = 1;
......@@ -670,7 +672,7 @@ int cw_mp3_handler( int ops, _main_data *main_data, GtkWidget *notebook )
config.encoder.use_crc ? plugins[ cur_plugin ].crc_op : "",
config.encoder.use_varbitrate ? vbr_qual_switch : "",
config.encoder.extra_options );
}
}
return 0;
}
}
......
......@@ -280,32 +280,35 @@ extern char * id3_findstyle( int styleid )
return "Unknown Style";
}
void vorbistag(char *ogg_file, id3tag_t *id3tag)
void vorbistag(char *ogg_file,
char *artist,
char *album,
char *title,
unsigned char style,
unsigned char track)
{
char cmd[MAX_COMMAND_LENGTH];
char temp[MAX_TITLE_LENGTH];
gchar *tmpfile;
gchar *tagfile;
FILE *f;
char id3tagtmp[31];
tmpfile = g_strdup_printf("%s.orig", ogg_file);
rename(ogg_file, tmpfile);
snprintf(cmd, sizeof(cmd) - 1, "vorbiscomment -a '%s' '%s'", tmpfile, ogg_file);
f = popen(cmd, "w");
strncpy(id3tagtmp, id3tag->artist, 30);
snprintf(temp, sizeof(temp) - 1, "ARTIST=%s\n", id3tagtmp);
tagfile = g_strdup_printf("%s.tags", ogg_file);
f = fopen(tagfile, "w");
snprintf(temp, sizeof(temp) - 1, "ARTIST=%s\n", artist);
fputs(temp, f);
strncpy(id3tagtmp, id3tag->album, 30);
snprintf(temp, sizeof(temp) - 1, "ALBUM=%s\n", id3tagtmp);
snprintf(temp, sizeof(temp) - 1, "ALBUM=%s\n", album);
fputs(temp, f);
strncpy(id3tagtmp, id3tag->songname, 30);
snprintf(temp, sizeof(temp) - 1, "TITLE=%s\n", id3tagtmp);
snprintf(temp, sizeof(temp) - 1, "TITLE=%s\n", title);
fputs(temp, f);
snprintf(temp, sizeof(temp) - 1, "GENRE=%s\n", id3_findstyle(id3tag->style));
snprintf(temp, sizeof(temp) - 1, "GENRE=%s\n", id3_findstyle(style));
fputs(temp, f);
snprintf(temp, sizeof(temp) - 1, "TRACKNUMBER=%d\n", id3tag->track);
snprintf(temp, sizeof(temp) - 1, "TRACKNUMBER=%d\n", track);
fputs(temp, f);
pclose(f);
unlink(tmpfile);
free(tmpfile);
fclose(f);
snprintf(cmd, sizeof(cmd) - 1, "vorbiscomment -a -c '%s' '%s'", tagfile, ogg_file);
system(cmd);
unlink(tagfile);
free(tagfile);
}
......@@ -67,6 +67,6 @@ extern int id3_replacetag ( FILE *fout, id3tag_t *id3tag );
extern void id3_cleartag( id3tag_t *id3tag );
extern char *id3_findstyle( int styleid );
unsigned char id3_find_cddb_category( char *name );
void vorbistag(char *ogg_file, id3tag_t *id3tag);
void vorbistag(char *ogg_file, char *artist, char *album, char *title, unsigned char style, unsigned char track);
#endif /* #ifndef _ID3_H */
#include <id3.h>
void set_TagField(ID3Tag *myTag,char *data,ID3_FrameID id){
ID3Frame *myFrame;
ID3Frame *pFrame;
myFrame=ID3Frame_NewID(id);
pFrame=ID3Tag_FindFrameWithID(myTag,id);
if (pFrame != NULL) {
ID3Tag_RemoveFrame(myTag,pFrame);
}
ID3Field_SetASCII(ID3Frame_GetField(myFrame,ID3FN_TEXT),data);
ID3Tag_AttachFrame(myTag,myFrame);
return;
}
#include <id3.h>
void set_TagField(ID3Tag *myTag,char *data,ID3_FrameID id)
/* file job_control.c
*
*
* does calling of the ripper or encoder
* handles files
*
......@@ -7,6 +7,10 @@
*/
#include <stdlib.h>
#include <stdio.h> /* for bezo debug */
#include <errno.h> /* for errno */
#include <sys/stat.h> /* defines read and write flags */
#include <time.h>
......@@ -20,6 +24,8 @@
#include <string.h>
#include <gtk/gtk.h>
#include <id3.h>
#include "misc_utils.h"
#include "interface_common.h"
#include "id3.h"
......@@ -51,6 +57,7 @@ typedef struct {
char *msg;
} _dialog_data;
/* Function Prototypes */
int lock_file( char *file_name, int is_temp );
......@@ -415,6 +422,7 @@ void job_finisher( _main_data *main_data )
int madewavs = FALSE;
int mademp3s = FALSE;
int tracksdone = 0;
char s_track_num[2];
char *artist;
FILE *fp_playlist = NULL;
......@@ -440,46 +448,56 @@ void job_finisher( _main_data *main_data )
/* add ID3 tag if requested */
if ( config.cddb_config.create_id3 == TRUE ) {
id3tag_t mytag;
id3_cleartag( &mytag );
strncpy( mytag.songname, main_data->track[ i ].title, 30 );
if ( !(artist = main_data->track[ i ].artist) )
artist = main_data->disc_artist;
strncpy( mytag.artist, artist, 30 );
strncpy( mytag.album, main_data->disc_title, 30 );
// strncpy( mytag.year, main_data->disc_year, 4 ); // M.Tyler 6-3-2005
mytag.track = i + 1;
mytag.style = id3_find_cddb_category( main_data->disc_category );
if (strstr( enc_file, ".ogg" ) == NULL) {
FILE *fptr = NULL;
fptr = fopen( enc_file, "ab" );
if ( fptr != NULL ) {
id3_appendtag( fptr, &mytag );
fclose( fptr );
}
// TODO: fix this to use something like
// if (main_data->encoding_type == OGG) {
if ( !strcmp( config.encoder.encoder, "oggenc") ) {
// TODO: add year to OGG tag
// strncpy( mytag.year, main_data->disc_year, 4 ); // M.Tyler 6-3-2005
vorbistag(enc_file,
artist,
main_data->disc_title,
main_data->track[i].title,
id3_find_cddb_category( main_data->disc_category ),
i + 1 );
} else if ( !strcmp( config.encoder.encoder, "flac" ) ) {
/* nothing to do for FLAC right now */
} else {
vorbistag(enc_file, &mytag);
/* assume MP3 tag is desired */
sprintf(s_track_num,"%d",(i+1));
ID3Tag *myTag;
myTag=ID3Tag_New();
ID3Tag_Link(myTag,enc_file);
set_TagField(myTag, main_data->track[ i ].title, ID3FID_TITLE);
set_TagField(myTag, artist, ID3FID_LEADARTIST);
set_TagField(myTag, main_data->disc_title, ID3FID_ALBUM);
set_TagField(myTag, main_data->disc_year, ID3FID_YEAR);
set_TagField(myTag, s_track_num, ID3FID_TRACKNUM);
set_TagField(myTag, main_data->disc_category, ID3FID_CONTENTTYPE);
ID3Tag_UpdateByTagType(myTag, ID3TT_ID3V2);
ID3Tag_Delete(myTag);
}
}
//dc: strcat() is for sissies!
sprintf(&buffer[strlen(buffer)], "%d: %s\n", ++tracksdone, file_name_without_path(enc_file));
// tm: basic playlist support - thanks to Mark Tyler
if ( config.cddb_config.create_playlist == TRUE )
if ( config.cddb_config.create_playlist == TRUE )
{
if ( fp_playlist == NULL )
{
sprintf(playlist_filespec, "%s/playlist.m3u", file_path_without_name(enc_file));
fp_playlist = fopen(playlist_filespec, "w");
}
// if we succeeded above, we can now write to this
if ( fp_playlist != NULL )
if ( fp_playlist != NULL )
fprintf( fp_playlist, "%s\n", file_name_without_path(enc_file));
}
}
......@@ -632,9 +650,9 @@ void job_controller( int ops, _main_data *main_data )
mp3_cur_track,
wav_file_path,
enc_file_path,
&mp3_pg_pid,
&mp3_pg_pid,
&mp3_pi_pid,
&mp3_read_fd ) < 0 )
&mp3_read_fd ) < 0 )
{
job_finisher( main_data );
return;
......@@ -652,9 +670,9 @@ void job_controller( int ops, _main_data *main_data )
wav_cur_track,
wav_file_path,
enc_file_path,
&wav_pg_pid,
&wav_pg_pid,
&wav_pi_pid,
&wav_read_fd ) < 0 )
&wav_read_fd ) < 0 )
{
job_finisher( main_data );
return;
......
......@@ -47,15 +47,15 @@ void sf_album_entry_changed( GtkWidget *widget, gpointer callback_data )
// patch from M.Tyler
// tm: we're not quite read for this (need updates to cddb.c)
//void sf_year_entry_changed( GtkWidget *widget, gpointer callback_data )
//{
// select_frame_handler( SF_YEAR_ENTRY_CHG, 0, NULL );
//}
//
//void sf_genre_entry_changed( GtkWidget *widget, gpointer callback_data )
//{
// select_frame_handler( SF_GENRE_ENTRY_CHG, 0, NULL );
//}
void sf_year_entry_changed( GtkWidget *widget, gpointer callback_data )
{
select_frame_handler( SF_YEAR_ENTRY_CHG, 0, NULL );
}
void sf_genre_entry_changed( GtkWidget *widget, gpointer callback_data )
{
select_frame_handler( SF_GENRE_ENTRY_CHG, 0, NULL );
}
void sf_filename_entry_changed( GtkWidget *widget, gpointer callback_data )
{
......@@ -96,10 +96,10 @@ void select_frame_handler( int ops, int track, _main_data *main_data )
static GtkWidget *album_label = NULL;
static GtkWidget *album_entry = NULL;
//static GtkWidget *year_label = NULL;
//static GtkWidget *year_entry = NULL;
//static GtkWidget *genre_label = NULL;
//static GtkWidget *genre_entry = NULL;
static GtkWidget *year_label = NULL;
static GtkWidget *year_entry = NULL;
static GtkWidget *genre_label = NULL;
static GtkWidget *genre_entry = NULL;
//static GtkWidget *genre_combo = NULL;
//static GList *genre_combo_items = NULL;
......@@ -114,7 +114,7 @@ void select_frame_handler( int ops, int track, _main_data *main_data )
switch ( ops ) {
case WIDGET_CREATE : {
GtkWidget * main_frame, *vbox, *hbox1, *vbox2, *hbox, *hbox2, *hbox3, *label, *scr_window;
GtkWidget * main_frame, *vbox, *hbox1, *vbox2, *hbox, *hbox2, *hbox3, *hbox4, *hbox5, *hbox6, *label, *scr_window;
GtkWidget *table, *separator, *button;
GtkStyle *style;
GdkGC *gc;
......@@ -214,10 +214,10 @@ void select_frame_handler( int ops, int track, _main_data *main_data )
gtk_container_border_width( GTK_CONTAINER( vbox2 ), 0 );
gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW( scr_window ), vbox2 );
/* artist and album entry fields */
/* artist entry fields */
hbox3 = gtk_hbox_new (FALSE, 0);
artist_label = gtk_label_new("Artist");
artist_label = gtk_label_new("Artist ");
gtk_box_pack_start(GTK_BOX(hbox3), artist_label, FALSE, FALSE, 5);
artist_entry = gtk_entry_new_with_max_length(MAX_ARTIST_LENGTH);
gtk_entry_set_text(GTK_ENTRY(artist_entry), main_data->disc_artist);
......@@ -225,30 +225,45 @@ void select_frame_handler( int ops, int track, _main_data *main_data )
GTK_SIGNAL_FUNC( sf_artist_entry_changed ),
NULL );
gtk_box_pack_start(GTK_BOX(hbox3), artist_entry, TRUE, TRUE, 5);
gtk_box_pack_start(GTK_BOX(vbox2), hbox3, FALSE, FALSE, 5);
/* album entry fields */
hbox4 = gtk_hbox_new (FALSE, 0);
album_label = gtk_label_new("Album");
gtk_box_pack_start(GTK_BOX(hbox3), album_label, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(hbox4), album_label, FALSE, FALSE, 5);
album_entry = gtk_entry_new_with_max_length(MAX_ARTIST_LENGTH);
gtk_entry_set_text(GTK_ENTRY(album_entry), main_data->disc_title);
gtk_signal_connect( GTK_OBJECT( album_entry ), "changed",
GTK_SIGNAL_FUNC( sf_album_entry_changed ),
NULL );
gtk_box_pack_start(GTK_BOX(hbox3), album_entry, TRUE, TRUE, 5);
// year_label = gtk_label_new("Year");
// gtk_box_pack_start(GTK_BOX(hbox3), year_label, FALSE, FALSE, 5);
// year_entry = gtk_entry_new_with_max_length(MAX_YEAR_LENGTH);
// gtk_widget_set_usize(year_entry, 60, -2);
// if ( strlen(main_data->disc_year) < 2 )
// sprintf(main_data->disc_year, "2005");
// gtk_entry_set_text(GTK_ENTRY(year_entry), main_data->disc_year);
// gtk_signal_connect( GTK_OBJECT( year_entry ), "changed",
// GTK_SIGNAL_FUNC( sf_year_entry_changed ),
// NULL );
// gtk_box_pack_start(GTK_BOX(hbox3), year_entry, TRUE, TRUE, 5);
//
// genre_label = gtk_label_new("Genre");
// gtk_box_pack_start(GTK_BOX(hbox3), genre_label, FALSE, FALSE, 5);
gtk_box_pack_start(GTK_BOX(hbox4), album_entry, TRUE, TRUE, 5);
gtk_box_pack_start(GTK_BOX(vbox2), hbox4, FALSE, FALSE, 5);
/* year and genre entry fields */
hbox5 = gtk_hbox_new (FALSE, 0);
year_label = gtk_label_new("Year");
gtk_box_pack_start(GTK_BOX(hbox5), year_label, FALSE, FALSE, 5);
year_entry = gtk_entry_new_with_max_length(MAX_YEAR_LENGTH);
gtk_widget_set_usize(year_entry, 60, -2);
if ( strlen(main_data->disc_year) < 2 )
sprintf(main_data->disc_year, "2005");
gtk_entry_set_text(GTK_ENTRY(year_entry), main_data->disc_year);
gtk_signal_connect( GTK_OBJECT( year_entry ), "changed",
GTK_SIGNAL_FUNC( sf_year_entry_changed ),
NULL );
gtk_box_pack_start(GTK_BOX(hbox5), year_entry, TRUE, TRUE, 5);
genre_label = gtk_label_new("Genre");