Репозитории ALT
5.1: | 1.3.8-alt0.4 |
4.1: | 1.3.7-alt3 |
4.0: | 1.3.7-alt3 |
3.0: | 1.3.5-alt1 |
Группа :: Звук
Пакет: mpfc
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: mpfc-svn-r269-alt.patch
Скачать
Скачать
configure.ac | 4 +++
doc/mpfc.texi | 5 +++
libmpfc/Makefile.am | 4 +--
libmpfc/cfg_rcfile.c | 1 -
libmpfc/charset.c | 2 +-
libmpfc/command.c | 1 -
libmpfc/file.c | 20 +++++---------
libmpfc/file_http.c | 4 +--
libmpfc/id3.c | 42 +++++++++++++----------------
libmpfc/logger.c | 2 +
libmpfc/plugin_input.c | 3 +-
libmpfc/plugin_mng.c | 4 ++-
libmpfc/song_info.c | 2 -
libmpfc/string.c | 3 --
libmpfc/util.c | 4 +--
libmpfc/vfs.c | 4 +-
libmpfcwnd/Makefile.am | 4 +-
libmpfcwnd/wnd.c | 7 +---
libmpfcwnd/wnd_checkbox.c | 2 +-
libmpfcwnd/wnd_checkbox.h | 2 +-
libmpfcwnd/wnd_class.c | 1 -
libmpfcwnd/wnd_combobox.c | 2 +
libmpfcwnd/wnd_def_handlers.c | 2 +-
libmpfcwnd/wnd_editbox.c | 4 ++-
libmpfcwnd/wnd_filebox.c | 2 +
libmpfcwnd/wnd_hbox.c | 1 -
libmpfcwnd/wnd_kbd.c | 3 +-
libmpfcwnd/wnd_label.c | 2 +-
libmpfcwnd/wnd_label.h | 2 +-
libmpfcwnd/wnd_listbox.c | 2 +-
libmpfcwnd/wnd_mouse.c | 3 +-
libmpfcwnd/wnd_multiview_dialog.c | 1 -
libmpfcwnd/wnd_print.c | 1 -
libmpfcwnd/wnd_radio.c | 2 +-
libmpfcwnd/wnd_radio.h | 2 +-
libmpfcwnd/wnd_repval.c | 1 +
libmpfcwnd/wnd_root.c | 1 +
libmpfcwnd/wnd_vbox.c | 1 -
mpfc.pc.in | 8 +++---
plugins/input/audiocd/Makefile.am | 5 ++-
plugins/input/audiocd/audiocd.c | 7 ++---
plugins/input/audiocd/cddb.c | 2 +-
plugins/input/mp3/Makefile.am | 6 ++--
plugins/input/mp3/mp3.c | 13 +++------
plugins/input/mp3/mp3.h | 4 +++
plugins/input/ogg/Makefile.am | 6 ++--
plugins/input/ogg/ogg.c | 12 +++-----
plugins/input/wav/Makefile.am | 5 ++-
plugins/input/wav/wav.h | 2 +
plugins/output/alsa/Makefile.am | 5 ++-
plugins/output/alsa/alsa.c | 13 ++++-----
plugins/output/disk_writer/Makefile.am | 5 ++-
plugins/output/disk_writer/writer.c | 5 +++-
plugins/output/oss/Makefile.am | 5 ++-
plugins/output/oss/oss.c | 1 +
src/browser.c | 11 ++------
src/browser.h | 2 +-
src/eqwnd.c | 2 +-
src/info_rw_thread.c | 1 +
src/inp.h | 3 ++
src/outp.h | 3 ++
src/player.c | 44 +++++++++++--------------------
src/plist.c | 16 +++++------
src/pmng.h | 3 ++
src/song.c | 2 -
src/undo.c | 4 +--
src/util.h | 5 ++-
67 files changed, 168 insertions(+), 185 deletions(-)
diff --git a/configure.ac b/configure.ac
index 68196ac..72eae25 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,6 @@
AC_INIT(src/main.c)
AM_INIT_AUTOMAKE(mpfc, 1.3.8-svn)
+AC_USE_SYSTEM_EXTENSIONS
AC_PROG_CC
AC_C_BIGENDIAN
AC_PROG_LIBTOOL
@@ -209,6 +210,9 @@ for plugin in $ALL_GENERAL_PLUGINS; do
GENERAL_SUMMARY="$GENERAL_SUMMARY\n$plugin: $SUMMARY_MSG"
done
+PLUGINS_DIR=${libdir}/$PACKAGE
+
+AC_SUBST(PLUGINS_DIR)
AC_SUBST(GENERAL_PLUGINS)
AC_SUBST(CHARSET_PLUGINS)
AC_SUBST(EFFECT_PLUGINS)
diff --git a/doc/mpfc.texi b/doc/mpfc.texi
index b2b6ec6..39c8483 100644
--- a/doc/mpfc.texi
+++ b/doc/mpfc.texi
@@ -26,6 +26,11 @@ Copyright @copyright{} 2003-2005 SG Software.
@contents
@ifinfo
+@dircategory Sound
+@direntry
+ * MPFC: (mpfc). Music player for console.
+@end direntry
+
@node Top, Introduction, (dir), (dir)
@top MPFC 1.3.6
diff --git a/libmpfc/Makefile.am b/libmpfc/Makefile.am
index b3ac9d5..e27a70c 100644
--- a/libmpfc/Makefile.am
+++ b/libmpfc/Makefile.am
@@ -1,7 +1,5 @@
lib_LTLIBRARIES = libmpfc.la
-libdir = $(prefix)/lib/
-
libmpfchdrdir = $(prefix)/include/mpfc
libmpfchdr_HEADERS = ../mpfc-config.h ../src/types.h ../src/cfg.h \
../src/charset.h \
@@ -18,6 +16,6 @@ libmpfc_la_SOURCES = cfg.c charset.c file.c file_http.c file_reg.c \
song_info.c string.c vfs.c logger.c cfg_rcfile.c \
plugin.c plugin_general.c command.c \
$(libmpfchdr_HEADERS)
-libmpfc_la_LIBADD = @COMMON_LIBS@ @RESOLV_LIBS@
+libmpfc_la_LIBADD = @COMMON_LIBS@ @RESOLV_LIBS@ @DL_LIBS@ @PTHREAD_LIBS@
INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/libmpfcwnd
localedir = $(datadir)/locale
diff --git a/libmpfc/cfg_rcfile.c b/libmpfc/cfg_rcfile.c
index 1169f65..159b566 100644
--- a/libmpfc/cfg_rcfile.c
+++ b/libmpfc/cfg_rcfile.c
@@ -250,7 +250,6 @@ void cfg_rcfile_read( cfg_node_t *list, char *name )
/* Read one line from the configuration file */
void cfg_rcfile_parse_line( cfg_node_t *list, char *str )
{
- int i, j, len;
char *var_name, *var_value, *real_name;
char ch, token;
cfg_var_op_t op;
diff --git a/libmpfc/charset.c b/libmpfc/charset.c
index 3c4adae..680e8a2 100644
--- a/libmpfc/charset.c
+++ b/libmpfc/charset.c
@@ -199,7 +199,7 @@ void cs_unicode2str( cs_output_t *str, dword unicode, cs_info_t *info )
/* UTF-8 */
else if (info->m_id == CS_UTF8)
{
- int bytes, bits = 32;
+ int bits = 32;
dword code = unicode;
/* Get number of significant bits */
diff --git a/libmpfc/command.c b/libmpfc/command.c
index b717f40..18b6c8e 100644
--- a/libmpfc/command.c
+++ b/libmpfc/command.c
@@ -134,7 +134,6 @@ wnd_msg_data_t player_msg_command_new( char *cmd, cmd_params_list_t *params )
{
wnd_msg_data_t msg_data;
player_msg_command_t *data;
- va_list ap;
data = (player_msg_command_t *)malloc(sizeof(*data));
data->m_command = strdup(cmd);
diff --git a/libmpfc/file.c b/libmpfc/file.c
index 8ed52b9..a798c4c 100644
--- a/libmpfc/file.c
+++ b/libmpfc/file.c
@@ -172,16 +172,10 @@ void file_set_min_buf_size( file_t *f, int size )
/* Get content type */
char *file_get_content_type( file_t *f )
{
- if (f == NULL)
- return;
-
- switch (f->m_type)
- {
- case FILE_TYPE_REGULAR:
- return NULL;
- case FILE_TYPE_HTTP:
- return fhttp_get_content_type(f);
- }
+ if (f != NULL)
+ if (f->m_type == FILE_TYPE_HTTP)
+ return fhttp_get_content_type(f);
+ return NULL;
} /* End of 'file_get_content_type' function */
/* Write line to file */
@@ -203,7 +197,7 @@ void file_puts( char *s, file_t *f )
char *file_gets( char *s, int size, file_t *f )
{
if (f == NULL)
- return;
+ return NULL;
switch (f->m_type)
{
@@ -219,7 +213,7 @@ char *file_gets( char *s, int size, file_t *f )
bool_t file_eof( file_t *f )
{
if (f == NULL)
- return;
+ return FALSE;
switch (f->m_type)
{
@@ -235,7 +229,7 @@ bool_t file_eof( file_t *f )
str_t *file_get_str( file_t *f )
{
if (f == NULL)
- return;
+ return NULL;
switch (f->m_type)
{
diff --git a/libmpfc/file_http.c b/libmpfc/file_http.c
index 54a4190..ed94eae 100644
--- a/libmpfc/file_http.c
+++ b/libmpfc/file_http.c
@@ -35,6 +35,7 @@
#include "file.h"
#include "file_http.h"
#include "mystring.h"
+#include "util.h"
/* Get file data */
#define FHTTP_GET_DATA(data, file) \
@@ -43,7 +44,6 @@
/* Open a file */
file_t *fhttp_open( file_t *f, char *mode )
{
- int i;
file_http_data_t *data;
struct hostent *he;
struct sockaddr_in their_addr;
@@ -465,8 +465,6 @@ bool_t fhttp_eof( file_t *f )
str_t *fhttp_get_str( file_t *f )
{
char s[1024];
- str_t *str;
- FHTTP_GET_DATA(data, f);
fhttp_gets(s, sizeof(s), f);
return str_new(s);
diff --git a/libmpfc/id3.c b/libmpfc/id3.c
index 93770e5..9f50ac6 100644
--- a/libmpfc/id3.c
+++ b/libmpfc/id3.c
@@ -60,11 +60,11 @@ id3_tag_t *id3_read( char *filename )
/* Find tags */
file_read(id, 1, 3, fd);
- if (!strncmp(id, "ID3", 3))
+ if (!strncmp((const char*)id, "ID3", 3))
has_v2 = TRUE;
file_seek(fd, -ID3_V1_TOTAL_SIZE, SEEK_END);
file_read(id, 1, 3, fd);
- if (!strncmp(id, "TAG", 3))
+ if (!strncmp((const char*)id, "TAG", 3))
has_v1 = TRUE;
/* No tag found */
@@ -98,15 +98,11 @@ id3_tag_t *id3_read( char *filename )
/* Save tag to file */
bool_t id3_write( id3_tag_t *tag, char *filename )
{
- bool_t ret1, ret2;
-
if (tag == NULL || filename == NULL)
- return;
+ return FALSE;
/* Write tags */
- ret1 = id3_v1_write(&tag->m_v1, filename);
- ret2 = id3_v2_write(&tag->m_v2, filename);
- return (ret1 || ret2);
+ return (id3_v1_write(&tag->m_v1, filename) || id3_v2_write(&tag->m_v2, filename));
} /* End of 'id3_write' function */
/* Extract next frame from tag */
@@ -205,7 +201,7 @@ void id3_v1_read( id3_tag_data_t *tag, file_t *fd )
void id3_v2_read( id3_tag_data_t *tag, file_t *fd )
{
byte flags;
- int real_size, ext_size, v2_version;
+ int real_size, ext_size;
byte header[ID3_HEADER_SIZE];
/* Seek to tag start */
@@ -312,7 +308,7 @@ bool_t id3_v2_write( id3_tag_data_t *tag, char *filename )
if (data == NULL)
{
fclose(fd);
- return;
+ return FALSE;
}
/* Fill data */
@@ -326,7 +322,7 @@ bool_t id3_v2_write( id3_tag_data_t *tag, char *filename )
if (fd == NULL)
{
free(data);
- return;
+ return FALSE;
}
fwrite(data, 1, file_size + size, fd);
fclose(fd);
@@ -401,7 +397,7 @@ void id3_v2_next_frame( id3_tag_data_t *tag, id3_frame_t *frame )
memcpy(frame->m_name, tag->m_cur_frame, 4);
frame->m_name[4] = 0;
tag->m_cur_frame += 4;
- size = id3_read_frame_size(tag->m_cur_frame, tag->m_v2_version);
+ size = id3_read_frame_size((char*)tag->m_cur_frame, tag->m_v2_version);
tag->m_cur_frame += 4;
flags = *(word *)tag->m_cur_frame;
tag->m_cur_frame += 2;
@@ -449,15 +445,15 @@ void id3_v2_next_frame( id3_tag_data_t *tag, id3_frame_t *frame )
void id3_v1_set_frame( id3_tag_data_t *tag, char *name, char *val )
{
if (!strcmp(name, ID3_FRAME_TITLE))
- strncpy(tag->m_stream + ID3_V1_TITLE_OFFSET, val, ID3_V1_TITLE_SIZE);
+ strncpy((char*)tag->m_stream + ID3_V1_TITLE_OFFSET, val, ID3_V1_TITLE_SIZE);
else if (!strcmp(name, ID3_FRAME_ARTIST))
- strncpy(tag->m_stream + ID3_V1_ARTIST_OFFSET, val, ID3_V1_ARTIST_SIZE);
+ strncpy((char*)tag->m_stream + ID3_V1_ARTIST_OFFSET, val, ID3_V1_ARTIST_SIZE);
else if (!strcmp(name, ID3_FRAME_ALBUM))
- strncpy(tag->m_stream + ID3_V1_ALBUM_OFFSET, val, ID3_V1_ALBUM_SIZE);
+ strncpy((char*)tag->m_stream + ID3_V1_ALBUM_OFFSET, val, ID3_V1_ALBUM_SIZE);
else if (!strcmp(name, ID3_FRAME_YEAR))
- strncpy(tag->m_stream + ID3_V1_YEAR_OFFSET, val, ID3_V1_YEAR_SIZE);
+ strncpy((char*)tag->m_stream + ID3_V1_YEAR_OFFSET, val, ID3_V1_YEAR_SIZE);
else if (!strcmp(name, ID3_FRAME_COMMENT))
- strncpy(tag->m_stream + ID3_V1_COMMENT_OFFSET, val,
+ strncpy((char*)tag->m_stream + ID3_V1_COMMENT_OFFSET, val,
ID3_V1_COMMENT_SIZE);
else if (!strcmp(name, ID3_FRAME_TRACK))
{
@@ -492,8 +488,8 @@ void id3_v2_set_frame( id3_tag_data_t *tag, char *name, char *val, char *cs )
char *id;
/* Read frame header */
- id = p;
- size = id3_read_frame_size(p + 4, tag->m_v2_version);
+ id = (char*)p;
+ size = id3_read_frame_size((char*)p + 4, tag->m_v2_version);
/* Frames finished */
if (!ID3_IS_VALID_FRAME_NAME(id) ||
@@ -533,7 +529,7 @@ void id3_v2_set_frame( id3_tag_data_t *tag, char *name, char *val, char *cs )
/* Write */
memset(p, 0, new_size + 10);
memcpy(p, name, 4);
- id3_write_frame_size(p + 4, new_size, tag->m_v2_version);
+ id3_write_frame_size((char*)p + 4, new_size, tag->m_v2_version);
if (cs != NULL && !strcasecmp(cs, "utf-8") && len > 0)
*(p + 10) = ID3_UTF8;
memcpy(p + 11, val, len);
@@ -555,7 +551,7 @@ void id3_v2_set_frame( id3_tag_data_t *tag, char *name, char *val, char *cs )
/* Write frame */
memset(p, 0, new_size + 10);
memcpy(p, name, 4);
- id3_write_frame_size(p + 4, new_size, tag->m_v2_version);
+ id3_write_frame_size((char*)p + 4, new_size, tag->m_v2_version);
if (cs != NULL && !strcasecmp(cs, "utf-8") && len > 0)
*(p + 10) = ID3_UTF8;
memcpy(p + 11, val, len);
@@ -639,7 +635,7 @@ void id3_remove( char *filename )
fclose(fd);
/* Find and remove ID3V2 */
- if (file_size >= 10 && !strncmp(buf, "ID3", 3))
+ if (file_size >= 10 && !strncmp((const char*)buf, "ID3", 3))
{
dword size;
int v2_version;
@@ -660,7 +656,7 @@ void id3_remove( char *filename )
/* Find and remove ID3V1 */
if (file_size >= ID3_V1_TOTAL_SIZE &&
- !strncmp(buf + file_size - ID3_V1_TOTAL_SIZE, "TAG", 3))
+ !strncmp((const char*)buf + file_size - ID3_V1_TOTAL_SIZE, "TAG", 3))
file_size -= ID3_V1_TOTAL_SIZE;
/* Save */
diff --git a/libmpfc/logger.c b/libmpfc/logger.c
index c8ab673..e9283a8 100644
--- a/libmpfc/logger.c
+++ b/libmpfc/logger.c
@@ -28,6 +28,8 @@
#include "cfg.h"
#include "logger.h"
+int logger_get_level( logger_t *log );
+
/* Initialize logger */
logger_t *logger_new( cfg_node_t *cfg_list, char *file_name )
{
diff --git a/libmpfc/plugin_input.c b/libmpfc/plugin_input.c
index 0ae0024..27c98b2 100644
--- a/libmpfc/plugin_input.c
+++ b/libmpfc/plugin_input.c
@@ -27,7 +27,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include "types.h"
#include "inp.h"
#include "mystring.h"
#include "plugin.h"
@@ -253,7 +252,7 @@ void inp_spec_func( in_plugin_t *p, int index, char *filename )
str_t *inp_set_song_title( in_plugin_t *p, char *filename )
{
if (filename == NULL)
- return;
+ return NULL;
if (p != NULL && p->m_pd.m_set_song_title != NULL)
return p->m_pd.m_set_song_title(filename);
diff --git a/libmpfc/plugin_mng.c b/libmpfc/plugin_mng.c
index e731983..8a7fdff 100644
--- a/libmpfc/plugin_mng.c
+++ b/libmpfc/plugin_mng.c
@@ -88,11 +88,13 @@ void pmng_add_plugin( pmng_t *pmng, plugin_t *p )
pmng->m_plugins[pmng->m_num_plugins ++] = p;
} /* End of 'pmng_add_plugin' function */
+extern void wnd_msg_send( struct tag_wnd_t *wnd,
+ char *name, wnd_msg_data_t data ) __attribute__((weak));
/* Execute a command with a list of parameters */
void pmng_player_command_obj( pmng_t *pmng, char *cmd,
cmd_params_list_t *params )
{
- wnd_msg_send(pmng->m_player_wnd, "command",
+ wnd_msg_send(pmng->m_player_wnd, "command", /* XXX */
player_msg_command_new(cmd, params));
} /* End of 'pmng_player_command_obj' function */
diff --git a/libmpfc/song_info.c b/libmpfc/song_info.c
index ae33869..faafd0b 100644
--- a/libmpfc/song_info.c
+++ b/libmpfc/song_info.c
@@ -245,8 +245,6 @@ void si_set_charset( song_info_t *si, char *cs )
/* Convert info fields from one charset to another */
void si_convert_cs( song_info_t *si, char *new_cs, pmng_t *pmng )
{
- char *str;
-
if (si == NULL || new_cs == NULL || pmng == NULL)
return;
diff --git a/libmpfc/string.c b/libmpfc/string.c
index 5423365..99ef0b8 100644
--- a/libmpfc/string.c
+++ b/libmpfc/string.c
@@ -37,7 +37,6 @@ static void str_allocate( str_t *str, int new_len );
str_t *str_new( char *s )
{
str_t *str;
- int len;
if (s == NULL)
return NULL;
@@ -77,8 +76,6 @@ void str_free( str_t *str )
/* Copy string from (char *) */
str_t *str_copy_cptr( str_t *dest, char *src )
{
- int len;
-
if (dest == NULL || src == NULL)
return NULL;
diff --git a/libmpfc/util.c b/libmpfc/util.c
index 026977b..120f454 100644
--- a/libmpfc/util.c
+++ b/libmpfc/util.c
@@ -123,7 +123,7 @@ char *util_short_name( char *name )
} /* End of 'util_get_file_short_name' function */
/* Convert file name to the one with escaped special symbols */
-char *util_escape_fname( char *out, char *in )
+void util_escape_fname( char *out, char *in )
{
int i, j, len;
char in_name[MAX_FILE_NAME];
@@ -220,8 +220,6 @@ void util_del_nl( char *dest, char *src )
/* Remove multiple slashes in file name */
void util_rem_slashes( char *name )
{
- int len = strlen(name);
-
while (*name)
{
if (((*name) == '/') && ((*(name + 1)) == '/'))
diff --git a/libmpfc/vfs.c b/libmpfc/vfs.c
index 6435c18..8ae8341 100644
--- a/libmpfc/vfs.c
+++ b/libmpfc/vfs.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <ctype.h>
#include "types.h"
#include "inp.h"
#include "pmng.h"
@@ -201,7 +202,6 @@ void vfs_visit_match( vfs_t *vfs, vfs_file_t *file, vfs_callback_t callback,
void *data, int level, int max_level, vfs_glob_flags_t flags )
{
struct stat st;
- int ret;
/* Check recursion level */
if (level > max_level)
@@ -250,7 +250,7 @@ void vfs_visit_match( vfs_t *vfs, vfs_file_t *file, vfs_callback_t callback,
list = vfs_glob_list_new();
for ( ;; )
{
- str_t *dir_name, *full_name;
+ str_t *dir_name;
char *name = vfs_readdir(dh);
if (name == NULL)
break;
diff --git a/libmpfcwnd/Makefile.am b/libmpfcwnd/Makefile.am
index 88a7f24..bf11849 100644
--- a/libmpfcwnd/Makefile.am
+++ b/libmpfcwnd/Makefile.am
@@ -1,5 +1,4 @@
lib_LTLIBRARIES = libmpfcwnd.la
-libdir = $(prefix)/lib/
libmpfcwndhdrdir = $(prefix)/include/mpfc/libmpfcwnd
libmpfcwndhdr_HEADERS = wnd.h wnd_print.h wnd_msg.h wnd_kbd.h \
wnd_def_handlers.h wnd_root.h wnd_mouse.h wnd_types.h \
@@ -18,6 +17,7 @@ libmpfcwnd_la_SOURCES = wnd.c wnd_print.c wnd_msg.c wnd_kbd.c \
wnd_views.c wnd_multiview_dialog.c wnd_listbox.c \
wnd_repval.c \
$(libmpfcwndhdr_HEADERS)
-libmpfcwnd_la_LIBADD = @COMMON_LIBS@ @GPM_LIBS@ @PTHREAD_LIBS@ @CURSES_LIBS@
+libmpfcwnd_la_LIBADD = @COMMON_LIBS@ @GPM_LIBS@ @PTHREAD_LIBS@ @CURSES_LIBS@ \
+ $(top_builddir)/libmpfc/libmpfc.la
INCLUDES = -I$(top_builddir)/src
localedir = $(datadir)/locale
diff --git a/libmpfcwnd/wnd.c b/libmpfcwnd/wnd.c
index 58f823e..b96375f 100644
--- a/libmpfcwnd/wnd.c
+++ b/libmpfcwnd/wnd.c
@@ -25,6 +25,7 @@
#include <string.h>
#include <sys/ioctl.h>
#include "types.h"
+#include "util.h"
#include "cfg.h"
#include "logger.h"
#include "wnd.h"
@@ -220,7 +221,6 @@ wnd_t *wnd_new( wnd_t *parent, char *title, int x, int y,
bool_t wnd_construct( wnd_t *wnd, wnd_t *parent, char *title, int x, int y,
int width, int height, wnd_flags_t flags )
{
- wnd_t *cur_focus;
int sx, sy;
char cfg_name[32];
wnd_t *child;
@@ -995,8 +995,6 @@ void wnd_next_focus( wnd_t *wnd )
/* Set focus to the previous child of this window */
void wnd_prev_focus( wnd_t *wnd )
{
- wnd_t *child;
-
assert(wnd);
/* This function does nothing if there are no children */
@@ -1047,7 +1045,6 @@ void wnd_sync_screen( wnd_t *wnd )
int x = 0, y = 0;
wnd_t *wnd_focus;
static bool_t prev_cursor_state = TRUE;
- static int count = 0;
pthread_mutex_lock(&WND_CURSES_MUTEX(wnd));
@@ -1413,7 +1410,7 @@ void wnd_update_visibility( wnd_t *wnd )
{
struct wnd_display_buf_t *db = &WND_DISPLAY_BUF(wnd);
struct wnd_display_buf_symbol_t *pos;
- wnd_t *cur, *parent, *child;
+ wnd_t *child;
int dist, i, j;
/* Set visibility tag for each of the window's positions */
diff --git a/libmpfcwnd/wnd_checkbox.c b/libmpfcwnd/wnd_checkbox.c
index 5233f60..629b816 100644
--- a/libmpfcwnd/wnd_checkbox.c
+++ b/libmpfcwnd/wnd_checkbox.c
@@ -86,7 +86,7 @@ wnd_msg_retcode_t checkbox_on_action( wnd_t *wnd, char *action )
} /* End of 'checkbox_on_action' function */
/* 'display' message handler */
-wnd_msg_retcode_t checkbox_on_display( wnd_t *wnd )
+void checkbox_on_display( wnd_t *wnd )
{
checkbox_t *cb = CHECKBOX_OBJ(wnd);
diff --git a/libmpfcwnd/wnd_checkbox.h b/libmpfcwnd/wnd_checkbox.h
index ced6bda..0421e0a 100644
--- a/libmpfcwnd/wnd_checkbox.h
+++ b/libmpfcwnd/wnd_checkbox.h
@@ -55,7 +55,7 @@ bool_t checkbox_construct( checkbox_t *cb, wnd_t *parent, char *title,
wnd_msg_retcode_t checkbox_on_action( wnd_t *wnd, char *action );
/* 'display' message handler */
-wnd_msg_retcode_t checkbox_on_display( wnd_t *wnd );
+void checkbox_on_display( wnd_t *wnd );
/* 'mouse_ldown' message handler */
wnd_msg_retcode_t checkbox_on_mouse( wnd_t *wnd, int x, int y,
diff --git a/libmpfcwnd/wnd_class.c b/libmpfcwnd/wnd_class.c
index 92c831a..30ff801 100644
--- a/libmpfcwnd/wnd_class.c
+++ b/libmpfcwnd/wnd_class.c
@@ -34,7 +34,6 @@ wnd_class_t *wnd_class_new( wnd_global_data_t *global, char *name,
cfg_set_default_values_t set_def_styles )
{
wnd_class_t *klass, *prev_klass = NULL;
- int i;
assert(global);
diff --git a/libmpfcwnd/wnd_combobox.c b/libmpfcwnd/wnd_combobox.c
index 4a34480..381dffd 100644
--- a/libmpfcwnd/wnd_combobox.c
+++ b/libmpfcwnd/wnd_combobox.c
@@ -23,11 +23,13 @@
#include <stdlib.h>
#include <string.h>
#include "types.h"
+#include "util.h"
#include "wnd.h"
#include "wnd_combobox.h"
#include "wnd_dlgitem.h"
#include "wnd_editbox.h"
#include "wnd_hbox.h"
+#include "wnd_label.h"
/* Create a new combo box */
combo_t *combo_new( wnd_t *parent, char *id, char *text, char letter,
diff --git a/libmpfcwnd/wnd_def_handlers.c b/libmpfcwnd/wnd_def_handlers.c
index ecc740a..566baf2 100644
--- a/libmpfcwnd/wnd_def_handlers.c
+++ b/libmpfcwnd/wnd_def_handlers.c
@@ -22,6 +22,7 @@
#include <assert.h>
#include <stdlib.h>
+#include <strings.h>
#include "types.h"
#include "wnd.h"
#include "wnd_def_handlers.h"
@@ -201,7 +202,6 @@ void wnd_default_destructor( wnd_t *wnd )
wnd_msg_retcode_t wnd_default_on_parent_repos( wnd_t *wnd,
int px, int py, int pw, int ph, int nx, int ny, int nw, int nh )
{
- wnd_t *child;
int x, y, w, h;
assert(wnd);
diff --git a/libmpfcwnd/wnd_editbox.c b/libmpfcwnd/wnd_editbox.c
index e8d5ff4..97f19e4 100644
--- a/libmpfcwnd/wnd_editbox.c
+++ b/libmpfcwnd/wnd_editbox.c
@@ -22,12 +22,15 @@
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include "types.h"
+#include "util.h"
#include "mystring.h"
#include "wnd.h"
#include "wnd_dlgitem.h"
#include "wnd_editbox.h"
#include "wnd_hbox.h"
+#include "wnd_label.h"
/* Create a new edit box */
editbox_t *editbox_new( wnd_t *parent, char *id, char *text, char letter,
@@ -157,7 +160,6 @@ void editbox_delch( editbox_t *eb, int pos )
/* Move cursor */
void editbox_move( editbox_t *eb, int new_pos )
{
- int old_cur = eb->m_cursor;
int len = EDITBOX_LEN(eb);
/* Set cursor position */
diff --git a/libmpfcwnd/wnd_filebox.c b/libmpfcwnd/wnd_filebox.c
index 58e51d3..d39c0d9 100644
--- a/libmpfcwnd/wnd_filebox.c
+++ b/libmpfcwnd/wnd_filebox.c
@@ -28,11 +28,13 @@
#include <string.h>
#include <unistd.h>
#include "types.h"
+#include "util.h"
#include "mystring.h"
#include "wnd.h"
#include "wnd_editbox.h"
#include "wnd_filebox.h"
#include "wnd_hbox.h"
+#include "wnd_label.h"
/* Create a new file box */
filebox_t *filebox_new( wnd_t *parent, char *id, char *text, char letter,
diff --git a/libmpfcwnd/wnd_hbox.c b/libmpfcwnd/wnd_hbox.c
index 1bff8c4..1e10bc6 100644
--- a/libmpfcwnd/wnd_hbox.c
+++ b/libmpfcwnd/wnd_hbox.c
@@ -31,7 +31,6 @@
hbox_t *hbox_new( wnd_t *parent, char *title, int dist )
{
hbox_t *hbox;
- wnd_class_t *klass;
/* Allocate memory for box */
hbox = (hbox_t *)malloc(sizeof(*hbox));
diff --git a/libmpfcwnd/wnd_kbd.c b/libmpfcwnd/wnd_kbd.c
index 994cf38..9985c45 100644
--- a/libmpfcwnd/wnd_kbd.c
+++ b/libmpfcwnd/wnd_kbd.c
@@ -277,14 +277,13 @@ void wnd_kbd_free( wnd_kbd_data_t *data )
void *wnd_kbd_thread( void *arg )
{
wnd_kbd_data_t *data = (wnd_kbd_data_t *)arg;
- wnd_t *wnd_root = data->m_wnd_root;
char buf[32];
int buf_ptr = 0;
wnd_key_t keycode;
struct timeval was_tv, now_tv;
- int was_btn;
int key;
wnd_global_data_t *global = data->m_global;
+ int was_btn = 0;
gettimeofday(&was_tv, NULL);
for ( ; !data->m_end_thread; )
diff --git a/libmpfcwnd/wnd_label.c b/libmpfcwnd/wnd_label.c
index b8cf854..3cc66de 100644
--- a/libmpfcwnd/wnd_label.c
+++ b/libmpfcwnd/wnd_label.c
@@ -117,7 +117,7 @@ void label_get_desired_size( dlgitem_t *di, int *width, int *height )
} /* End of 'label_get_desired_size' function */
/* 'display' message handler */
-wnd_msg_retcode_t label_on_display( wnd_t *wnd )
+void label_on_display( wnd_t *wnd )
{
wnd_move(wnd, 0, 0, 0);
wnd_apply_default_style(wnd);
diff --git a/libmpfcwnd/wnd_label.h b/libmpfcwnd/wnd_label.h
index e774f9d..097416d 100644
--- a/libmpfcwnd/wnd_label.h
+++ b/libmpfcwnd/wnd_label.h
@@ -68,7 +68,7 @@ void label_set_text( label_t *l, char *text );
void label_get_desired_size( dlgitem_t *di, int *width, int *height );
/* 'display' message handler */
-wnd_msg_retcode_t label_on_display( wnd_t *wnd );
+void label_on_display( wnd_t *wnd );
/* Display label-like text */
void label_display_text( wnd_t *wnd, char *text, wnd_color_t fg,
diff --git a/libmpfcwnd/wnd_listbox.c b/libmpfcwnd/wnd_listbox.c
index 8009866..f055fea 100644
--- a/libmpfcwnd/wnd_listbox.c
+++ b/libmpfcwnd/wnd_listbox.c
@@ -95,7 +95,7 @@ int listbox_add( listbox_t *lb, char *item, void *data )
lb->m_list = (struct listbox_item_t *)realloc(lb->m_list,
sizeof(struct listbox_item_t) * (lb->m_list_size + 1));
if (lb->m_list == NULL)
- return;
+ return 0;
pos = lb->m_list_size;
lb->m_list[pos].m_name = strdup(item);
lb->m_list[pos].m_data = data;
diff --git a/libmpfcwnd/wnd_mouse.c b/libmpfcwnd/wnd_mouse.c
index 947f6b0..7052682 100644
--- a/libmpfcwnd/wnd_mouse.c
+++ b/libmpfcwnd/wnd_mouse.c
@@ -26,6 +26,7 @@
#endif
#include <stdlib.h>
#include <string.h>
+#include "util.h"
#include "wnd.h"
/* Initialize mouse */
@@ -224,7 +225,7 @@ void *wnd_mouse_thread( void *arg )
{
if (Gpm_GetEvent(&event) > 0)
{
- wnd_mouse_button_t btn;
+ wnd_mouse_button_t btn = -1;
wnd_mouse_event_t type = -1;
if (event.buttons & GPM_B_LEFT)
diff --git a/libmpfcwnd/wnd_multiview_dialog.c b/libmpfcwnd/wnd_multiview_dialog.c
index 8e85d06..445fb9a 100644
--- a/libmpfcwnd/wnd_multiview_dialog.c
+++ b/libmpfcwnd/wnd_multiview_dialog.c
@@ -87,7 +87,6 @@ void mview_dialog_add_view( mview_dialog_t *mvd, vbox_t *view,
void mview_dialog_on_switch_clicked( wnd_t *wnd )
{
wnd_t *view;
- button_t *btn = BUTTON_OBJ(wnd);
/* Get the connected view */
view = (wnd_t *)cfg_get_var_ptr(wnd->m_cfg_list, "connected_view");
diff --git a/libmpfcwnd/wnd_print.c b/libmpfcwnd/wnd_print.c
index 460de10..92ed19e 100644
--- a/libmpfcwnd/wnd_print.c
+++ b/libmpfcwnd/wnd_print.c
@@ -76,7 +76,6 @@ void wnd_move( wnd_t *wnd, wnd_move_style_t style, int x, int y )
/* Low-level character printing */
void wnd_putc( wnd_t *wnd, dword ch )
{
- int cx, cy;
struct wnd_display_buf_symbol_t *pos;
/* This function doesn't print not-printable characters */
diff --git a/libmpfcwnd/wnd_radio.c b/libmpfcwnd/wnd_radio.c
index 283404a..865b8c4 100644
--- a/libmpfcwnd/wnd_radio.c
+++ b/libmpfcwnd/wnd_radio.c
@@ -93,7 +93,7 @@ wnd_msg_retcode_t radio_on_action( wnd_t *wnd, char *action )
} /* End of 'radio_on_action' function */
/* 'display' message handler */
-wnd_msg_retcode_t radio_on_display( wnd_t *wnd )
+void radio_on_display( wnd_t *wnd )
{
radio_t *r = RADIO_OBJ(wnd);
diff --git a/libmpfcwnd/wnd_radio.h b/libmpfcwnd/wnd_radio.h
index 2670f3f..3793a89 100644
--- a/libmpfcwnd/wnd_radio.h
+++ b/libmpfcwnd/wnd_radio.h
@@ -52,7 +52,7 @@ bool_t radio_construct( radio_t *r, wnd_t *parent, char *title, char *id,
wnd_msg_retcode_t radio_on_action( wnd_t *wnd, char *action );
/* 'display' message handler */
-wnd_msg_retcode_t radio_on_display( wnd_t *wnd );
+void radio_on_display( wnd_t *wnd );
/* 'mouse_ldown' message handler */
wnd_msg_retcode_t radio_on_mouse( wnd_t *wnd, int x, int y,
diff --git a/libmpfcwnd/wnd_repval.c b/libmpfcwnd/wnd_repval.c
index 3f3542f..f4b1c33 100644
--- a/libmpfcwnd/wnd_repval.c
+++ b/libmpfcwnd/wnd_repval.c
@@ -25,6 +25,7 @@
#include "wnd_dialog.h"
#include "wnd_editbox.h"
#include "wnd_repval.h"
+#include "wnd_label.h"
/* Create a repeat value dialog */
dialog_t *wnd_repval_new( wnd_t *parent, void *on_ok, int dig )
diff --git a/libmpfcwnd/wnd_root.c b/libmpfcwnd/wnd_root.c
index 6a5b758..6d85932 100644
--- a/libmpfcwnd/wnd_root.c
+++ b/libmpfcwnd/wnd_root.c
@@ -22,6 +22,7 @@
#include <assert.h>
#include <stdlib.h>
+#include <string.h>
#include "types.h"
#include "wnd.h"
#include "wnd_root.h"
diff --git a/libmpfcwnd/wnd_vbox.c b/libmpfcwnd/wnd_vbox.c
index b969038..212bb62 100644
--- a/libmpfcwnd/wnd_vbox.c
+++ b/libmpfcwnd/wnd_vbox.c
@@ -31,7 +31,6 @@
vbox_t *vbox_new( wnd_t *parent, char *title, int dist )
{
vbox_t *vbox;
- wnd_class_t *klass;
/* Allocate memory for box */
vbox = (vbox_t *)malloc(sizeof(*vbox));
diff --git a/mpfc.pc.in b/mpfc.pc.in
index 12fb665..4232593 100644
--- a/mpfc.pc.in
+++ b/mpfc.pc.in
@@ -1,8 +1,8 @@
prefix=@prefix@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib
-includedir=${prefix}/include
-plugindir=${libdir}/mpfc
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+plugindir=@libdir@/mpfc
Name: mpfc
Description: Music Player For Linux Console
diff --git a/plugins/input/audiocd/Makefile.am b/plugins/input/audiocd/Makefile.am
index 93ce5d3..c3b590b 100644
--- a/plugins/input/audiocd/Makefile.am
+++ b/plugins/input/audiocd/Makefile.am
@@ -1,7 +1,8 @@
lib_LTLIBRARIES = libaudiocd.la
-libdir = $(prefix)/lib/mpfc/input
+libdir = $(PLUGINS_DIR)/input
libaudiocd_la_SOURCES = audiocd.c audiocd.h cddb.c cddb.h
-libaudiocd_la_LIBADD = @COMMON_LIBS@ @RESOLV_LIBS@
+libaudiocd_la_LIBADD = @COMMON_LIBS@ @RESOLV_LIBS@ ../../../libmpfc/libmpfc.la ../../../libmpfcwnd/libmpfcwnd.la
+libaudiocd_la_LDFLAGS = -export-dynamic -avoid-version
INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/libmpfcwnd
diff --git a/plugins/input/audiocd/audiocd.c b/plugins/input/audiocd/audiocd.c
index 5e56f00..7f24348 100644
--- a/plugins/input/audiocd/audiocd.c
+++ b/plugins/input/audiocd/audiocd.c
@@ -29,6 +29,8 @@
#include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <sys/soundcard.h>
+#include <unistd.h>
+#include <limits.h>
#include "types.h"
#include "audiocd.h"
#include "cddb.h"
@@ -125,8 +127,6 @@ bool_t acd_start( char *filename )
{
int fd, track;
struct cdrom_msf msf;
- struct cdrom_subchnl info;
- bool_t playing = FALSE;
int mixer_fd;
int format = AFMT_S16_LE, ch = 2, rate = 44100;
@@ -366,7 +366,6 @@ void acd_resume( void )
void acd_seek( int shift )
{
int fd;
- struct cdrom_subchnl info;
struct cdrom_msf msf;
if (acd_cur_track < 0 || acd_cur_track >= acd_num_tracks)
@@ -446,7 +445,7 @@ bool_t acd_save_info( char *filename, song_info_t *info )
track = acd_fname2trk(filename);
if (track < 0 || track >= acd_num_tracks ||
track > acd_tracks_info[acd_num_tracks - 1].m_number)
- return;
+ return FALSE;
/* Save info */
return cddb_save_trk_info(track, info);
diff --git a/plugins/input/audiocd/cddb.c b/plugins/input/audiocd/cddb.c
index 6c98395..c08c5e0 100644
--- a/plugins/input/audiocd/cddb.c
+++ b/plugins/input/audiocd/cddb.c
@@ -547,7 +547,7 @@ void cddb_reload( char *filename )
void cddb_submit( char *filename )
{
char *email, *category;
- int sockfd = -1, i;
+ int sockfd = -1;
char buf[CDDB_BUF_SIZE];
struct hostent *he;
struct sockaddr_in their_addr;
diff --git a/plugins/input/mp3/Makefile.am b/plugins/input/mp3/Makefile.am
index d3b6147..4511620 100644
--- a/plugins/input/mp3/Makefile.am
+++ b/plugins/input/mp3/Makefile.am
@@ -1,9 +1,9 @@
lib_LTLIBRARIES = libmp3.la
-libdir = $(prefix)/lib/mpfc/input
+libdir = $(PLUGINS_DIR)/input
libmp3_la_SOURCES = mp3.c mp3.h
INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/libmpfcwnd
-libmp3_la_LDFLAGS = -Xcompiler -nostartfiles
-libmp3_la_LIBADD = @COMMON_LIBS@ @MAD_LIBS@ @MATH_LIBS@
+libmp3_la_LDFLAGS = -Xcompiler -nostartfiles -export-dynamic -avoid-version
+libmp3_la_LIBADD = ../../../libmpfc/libmpfc.la ../../../libmpfcwnd/libmpfcwnd.la @COMMON_LIBS@ @MAD_LIBS@ @MATH_LIBS@
localedir = $(datadir)/locale
diff --git a/plugins/input/mp3/mp3.c b/plugins/input/mp3/mp3.c
index d871608..34dd7a5 100644
--- a/plugins/input/mp3/mp3.c
+++ b/plugins/input/mp3/mp3.c
@@ -215,7 +215,6 @@ static int mp3_get_len_correct( char *filename, int *num_frames )
unsigned char buffer[8192];
unsigned int buflen = 0;
file_t *fd;
- int i = 0;
/* Check if we want to get current song length */
if (!strcmp(filename, mp3_file_name))
@@ -290,8 +289,6 @@ static short mp3_mad_fixed_to_short( mad_fixed_t sample )
bool_t mp3_save_info( char *filename, song_info_t *info )
{
id3_tag_t *tag;
- byte *data = NULL;
- int size;
bool_t ret = TRUE;
/* Supported only for regular files */
@@ -410,7 +407,7 @@ int mp3_get_xing_frames( char *filename )
buflen = file_read(buf, 1, sizeof(buf), fd);
for ( i = 0, xing = buf; i < buflen - 12; i ++, xing ++ )
{
- if (!strncmp(xing, "Xing", 4))
+ if (!strncmp((const char*)xing, "Xing", 4))
{
found = TRUE;
break;
@@ -440,7 +437,7 @@ end:
static song_info_t *mp3_read_info( char *filename, int *len, int *nf )
{
struct mad_header head;
- int i, filesize;
+ int filesize;
id3_tag_t *tag;
char own_data[1024];
song_info_t *si = NULL;
@@ -450,8 +447,6 @@ static song_info_t *mp3_read_info( char *filename, int *len, int *nf )
* output audio parameters */
if (file_get_type(filename) != FILE_TYPE_REGULAR)
{
- int br;
-
/* May return anything only for current song */
if (strcmp(filename, mp3_file_name))
{
@@ -466,7 +461,7 @@ static song_info_t *mp3_read_info( char *filename, int *len, int *nf )
si->m_flags |= SI_ONLY_OWN;
snprintf(own_data, sizeof(own_data),
_("MPEG %s, layer %i\n"
- "Bitrate: %i kb/s\n"
+ "Bitrate: %lu kb/s\n"
"Samplerate: %i Hz\n"
"%s\n"
"Error protection: %s\n"
@@ -593,7 +588,7 @@ static song_info_t *mp3_read_info( char *filename, int *len, int *nf )
snprintf(own_data, sizeof(own_data),
_("MPEG %s, layer %i\n"
- "Bitrate: %i kb/s\n"
+ "Bitrate: %lu kb/s\n"
"Samplerate: %i Hz\n"
"%s\n"
"Error protection: %s\n"
diff --git a/plugins/input/mp3/mp3.h b/plugins/input/mp3/mp3.h
index abf49a4..49fba7f 100644
--- a/plugins/input/mp3/mp3.h
+++ b/plugins/input/mp3/mp3.h
@@ -48,17 +48,21 @@ void mp3_set_eq( void );
/* Get audio parameters */
void mp3_get_audio_params( int *ch, int *freq, dword *fmt, int *bitrate );
+#if 0
/* Decode a frame */
static void mp3_decode_frame( void );
/* Save ID3 tag */
static void mp3_save_tag( char *filename, byte *tag, int tag_size );
+#endif
/* Apply equalizer to frame */
static void mp3_apply_eq( void );
+#if 0
/* Buffering read from file */
static int mp3_read( void *ptr, int size, file_t *fd );
+#endif
/* Read song parameters */
static void mp3_read_song_params( void );
diff --git a/plugins/input/ogg/Makefile.am b/plugins/input/ogg/Makefile.am
index 8c8b40c..33ff8bb 100644
--- a/plugins/input/ogg/Makefile.am
+++ b/plugins/input/ogg/Makefile.am
@@ -1,8 +1,8 @@
lib_LTLIBRARIES = libogg_vorbis.la
-libdir = $(prefix)/lib/mpfc/input
+libdir = $(PLUGINS_DIR)/input
libogg_vorbis_la_SOURCES = ogg.c vcedit.c vcedit.h
INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/libmpfcwnd
-libogg_vorbis_la_LDFLAGS = -Xcompiler -nostartfiles
-libogg_vorbis_la_LIBADD = @COMMON_LIBS@ @OGG_LIBS@
+libogg_vorbis_la_LDFLAGS = -Xcompiler -nostartfiles -export-dynamic -avoid-version
+libogg_vorbis_la_LIBADD = ../../../libmpfc/libmpfc.la ../../../libmpfcwnd/libmpfcwnd.la @COMMON_LIBS@ @OGG_LIBS@
diff --git a/plugins/input/ogg/ogg.c b/plugins/input/ogg/ogg.c
index 1a52321..7c69e47 100644
--- a/plugins/input/ogg/ogg.c
+++ b/plugins/input/ogg/ogg.c
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <sys/soundcard.h>
#include <pthread.h>
#include <vorbis/codec.h>
@@ -89,9 +90,6 @@ static char *ogg_author = "Sergey E. Galanov <sgsoftware@mail.ru>";
/* Start playing with an opened file descriptor */
bool_t ogg_start_with_fd( char *filename, file_t *fd )
{
- vorbis_comment *comment;
- int i;
-
/* Open file */
if (fd == NULL)
{
@@ -375,8 +373,8 @@ song_info_t *ogg_get_info( char *filename, int *len )
si = si_new();
si->m_flags |= SI_ONLY_OWN;
snprintf(own_data, sizeof(own_data),
- _("Nominal bitrate: %i kb/s\n"
- "Samplerate: %i Hz\n"
+ _("Nominal bitrate: %li kb/s\n"
+ "Samplerate: %li Hz\n"
"Channels: %i"),
ogg_vi->bitrate_nominal / 1000, ogg_vi->rate,
ogg_vi->channels);
@@ -416,8 +414,8 @@ song_info_t *ogg_get_info( char *filename, int *len )
if (vi != NULL)
{
snprintf(own_data, sizeof(own_data),
- _("Nominal bitrate: %i kb/s\n"
- "Samplerate: %i Hz\n"
+ _("Nominal bitrate: %li kb/s\n"
+ "Samplerate: %li Hz\n"
"Channels: %i\n"
"Length: %i seconds\n"
"File size: %i bytes"),
diff --git a/plugins/input/wav/Makefile.am b/plugins/input/wav/Makefile.am
index e962d23..f02d0df 100644
--- a/plugins/input/wav/Makefile.am
+++ b/plugins/input/wav/Makefile.am
@@ -1,7 +1,8 @@
lib_LTLIBRARIES = libwav.la
-libdir = $(prefix)/lib/mpfc/input
+libdir = $(PLUGINS_DIR)/input
libwav_la_SOURCES = wav.c wav.h
-libwav_la_LIBADD = @COMMON_LIBS@
+libwav_la_LIBADD = @COMMON_LIBS@ ../../../libmpfc/libmpfc.la ../../../libmpfcwnd/libmpfcwnd.la
+libwav_la_LDFLAGS = -export-dynamic -avoid-version
INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/libmpfcwnd
diff --git a/plugins/input/wav/wav.h b/plugins/input/wav/wav.h
index be62261..aea3014 100644
--- a/plugins/input/wav/wav.h
+++ b/plugins/input/wav/wav.h
@@ -70,8 +70,10 @@ void wav_get_audio_params( int *ch, int *freq, dword *fmt, int *bitrate );
static bool_t wav_read_next_chunk( file_t *fd, void **fmt_buf,
dword *data_size );
+#if 0
/* Read and decode data from ADPCM */
static int wav_read_adpcm( void *buf, int size );
+#endif
/* End of 'wav.h' file */
diff --git a/plugins/output/alsa/Makefile.am b/plugins/output/alsa/Makefile.am
index 982d43c..40d286c 100644
--- a/plugins/output/alsa/Makefile.am
+++ b/plugins/output/alsa/Makefile.am
@@ -1,8 +1,9 @@
lib_LTLIBRARIES = libalsa.la
-libdir = $(prefix)/lib/mpfc/output
+libdir = $(PLUGINS_DIR)/output
libalsa_la_SOURCES = alsa.c
INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/libmpfcwnd
-libalsa_la_LIBADD = @COMMON_LIBS@ @ASOUND_LIBS@
+libalsa_la_LIBADD = ../../../libmpfc/libmpfc.la ../../../libmpfcwnd/libmpfcwnd.la @COMMON_LIBS@ @ASOUND_LIBS@
+libalsa_la_LDFLAGS = -export-dynamic -avoid-version
localedir = $(datadir)/locale
diff --git a/plugins/output/alsa/alsa.c b/plugins/output/alsa/alsa.c
index b2f3cd4..9e1e7e6 100644
--- a/plugins/output/alsa/alsa.c
+++ b/plugins/output/alsa/alsa.c
@@ -31,7 +31,6 @@
static snd_pcm_t *handle = NULL;
static snd_pcm_hw_params_t *hwparams = NULL;
-static snd_pcm_sw_params_t *swparams = NULL;
static pmng_t *alsa_pmng = NULL;
static int alsa_fmt = SND_PCM_FORMAT_S16_LE;
static int alsa_size = 2;
@@ -48,8 +47,7 @@ static char *alsa_author =
static cfg_node_t *alsa_cfg = NULL;
static logger_t *alsa_log = NULL;
-static snd_pcm_sframes_t alsa_buffer_size;
-static snd_pcm_sframes_t alsa_period_size;
+static snd_pcm_uframes_t alsa_buffer_size;
/* Mixer types table */
static char *alsa_mixer_types_table[] =
@@ -136,7 +134,7 @@ bool_t alsa_start ()
}
logger_debug(alsa_log, "setting channels to %d", alsa_channels);
- err = snd_pcm_hw_params_set_channels_near (handle, hwparams, &alsa_channels);
+ err = snd_pcm_hw_params_set_channels_near (handle, hwparams, (unsigned int*)&alsa_channels);
logger_debug(alsa_log, "channels are set to %d", alsa_channels);
if (err < 0) {
logger_message(alsa_log, 0, "snd_pcm_hw_params_set_channels with channels %d returned %d", alsa_channels, err);
@@ -145,7 +143,7 @@ bool_t alsa_start ()
}
logger_debug(alsa_log, "alsa_rate is %d", alsa_rate);
- err = snd_pcm_hw_params_set_rate_near (handle, hwparams, &alsa_rate, NULL);
+ err = snd_pcm_hw_params_set_rate_near (handle, hwparams, (unsigned int*)&alsa_rate, NULL);
if (err < 0) {
logger_message(alsa_log, 0, "snd_pcm_hw_params_set_rate_near with rate %d and returned %d", alsa_rate, err);
alsa_end();
@@ -176,9 +174,10 @@ bool_t alsa_start ()
}
{
- int r, d;
+ unsigned int r;
+ int d;
snd_pcm_hw_params_get_rate_min(hwparams, &r, &d);
- logger_debug(alsa_log, "minimal rate is %d, direction is %d", r, d);
+ logger_debug(alsa_log, "minimal rate is %u, direction is %d", r, d);
}
logger_message(alsa_log, 0, "ALSA init successful");
diff --git a/plugins/output/disk_writer/Makefile.am b/plugins/output/disk_writer/Makefile.am
index 555c0d2..91a251a 100644
--- a/plugins/output/disk_writer/Makefile.am
+++ b/plugins/output/disk_writer/Makefile.am
@@ -1,7 +1,8 @@
lib_LTLIBRARIES = libdisk_writer.la
-libdir = $(prefix)/lib/mpfc/output
+libdir = $(PLUGINS_DIR)/output
libdisk_writer_la_SOURCES = writer.c
-libdisk_writer_la_LIBADD = @COMMON_LIBS@
+libdisk_writer_la_LIBADD = ../../../libmpfc/libmpfc.la ../../../libmpfcwnd/libmpfcwnd.la @COMMON_LIBS@
+libdisk_writer_la_LDFLAGS = -export-dynamic -avoid-version
INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/libmpfcwnd
diff --git a/plugins/output/disk_writer/writer.c b/plugins/output/disk_writer/writer.c
index a1b40dc..e673357 100644
--- a/plugins/output/disk_writer/writer.c
+++ b/plugins/output/disk_writer/writer.c
@@ -20,17 +20,21 @@
* MA 02111-1307, USA.
*/
+#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <unistd.h>
#include <sys/soundcard.h>
#include "types.h"
#include "file.h"
#include "outp.h"
#include "pmng.h"
+#include "util.h"
#include "wnd.h"
#include "wnd_dialog.h"
#include "wnd_checkbox.h"
#include "wnd_editbox.h"
+#include "wnd_filebox.h"
/* Header size */
#define DW_HEAD_SIZE 44
@@ -109,7 +113,6 @@ bool_t dw_start( void )
{
char name[MAX_FILE_NAME];
char *str;
- int i;
/* Get output file name (without extension and fragment index) */
str = cfg_get_var(dw_root_cfg, "cur-song-name");
diff --git a/plugins/output/oss/Makefile.am b/plugins/output/oss/Makefile.am
index ab0832f..b492a53 100644
--- a/plugins/output/oss/Makefile.am
+++ b/plugins/output/oss/Makefile.am
@@ -1,7 +1,8 @@
lib_LTLIBRARIES = liboss.la
-libdir = $(prefix)/lib/mpfc/output
+libdir = $(PLUGINS_DIR)/output
liboss_la_SOURCES = oss.c
-liboss_la_LIBADD = @COMMON_LIBS@
+liboss_la_LIBADD = ../../../libmpfc/libmpfc.la ../../../libmpfcwnd/libmpfcwnd.la @COMMON_LIBS@
+liboss_la_LDFLAGS = -export-dynamic -avoid-version
INCLUDES = -I$(top_builddir)/src -I$(top_builddir)/libmpfcwnd
diff --git a/plugins/output/oss/oss.c b/plugins/output/oss/oss.c
index 25eb43b..0a38a61 100644
--- a/plugins/output/oss/oss.c
+++ b/plugins/output/oss/oss.c
@@ -23,6 +23,7 @@
#include <errno.h>
#include <stdlib.h>
#include <fcntl.h>
+#include <unistd.h>
#include <sys/soundcard.h>
#include <sys/ioctl.h>
#include "types.h"
diff --git a/src/browser.c b/src/browser.c
index 8f584b6..967fc8a 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -24,6 +24,7 @@
#include <glob.h>
#include <string.h>
#include <sys/types.h>
+#include <fnmatch.h>
#include "types.h"
#include "browser.h"
#include "help_screen.h"
@@ -185,7 +186,6 @@ wnd_msg_retcode_t fb_on_keydown( wnd_t *wnd, wnd_key_t key )
{
int i;
browser_t *fb = (browser_t *)wnd;
- char str[MAX_FILE_NAME];
wnd_msg_retcode_t ret = WND_MSG_RETCODE_STOP;
assert(fb);
@@ -245,7 +245,7 @@ wnd_msg_retcode_t fb_on_keydown( wnd_t *wnd, wnd_key_t key )
} /* End of 'fb_handle_key' function */
/* 'action' message handler */
-wnd_msg_retcode_t fb_on_action( wnd_t *wnd, char *action )
+void fb_on_action( wnd_t *wnd, char *action )
{
browser_t *fb = (browser_t *)wnd;
@@ -452,10 +452,6 @@ void fb_move_cursor( browser_t *fb, int pos, bool_t rel )
/* Reload directory files list */
void fb_load_files( browser_t *fb )
{
- glob_t gl;
- int i;
- char pattern[MAX_FILE_NAME];
-
assert(fb);
/* Free current files list */
@@ -617,7 +613,6 @@ void fb_add2plist( browser_t *fb )
void fb_select_pattern_dialog( browser_t *fb, bool_t sel )
{
dialog_t *dlg;
- hbox_t *hbox;
dlg = dialog_new(WND_OBJ(fb), sel ? _("Select files matching pattern") :
_("Deselect files matching pattern"));
@@ -765,7 +760,7 @@ void fb_print_info_col( browser_t *fb, int id, struct browser_list_item *item )
{
int size, next_size = 0, i, right;
wnd_t *wnd = WND_OBJ(fb);
- song_info_t *info;
+ song_info_t *info = NULL;
if (id < 0 || id >= FB_COL_NUM)
return;
diff --git a/src/browser.h b/src/browser.h
index a5ce37a..c8d990d 100644
--- a/src/browser.h
+++ b/src/browser.h
@@ -93,7 +93,7 @@ wnd_msg_retcode_t fb_on_display( wnd_t *wnd );
wnd_msg_retcode_t fb_on_keydown( wnd_t *wnd, wnd_key_t key );
/* 'action' message handler */
-wnd_msg_retcode_t fb_on_action( wnd_t *wnd, char *action );
+void fb_on_action( wnd_t *wnd, char *action );
/* Handle mouse left button */
wnd_msg_retcode_t fb_on_mouse_ldown( wnd_t *wnd, int x, int y,
diff --git a/src/eqwnd.c b/src/eqwnd.c
index a245580..c0955d6 100644
--- a/src/eqwnd.c
+++ b/src/eqwnd.c
@@ -94,7 +94,7 @@ bool_t eqwnd_construct( eq_wnd_t *eq, wnd_t *parent )
wnd_msg_retcode_t eqwnd_on_display( wnd_t *wnd )
{
eq_wnd_t *eq = (eq_wnd_t *)wnd;
- int i, start_y = 0;
+ int i;
int x;
char *str[EQWND_NUM_BANDS] = {"PREAMP", "60HZ", "170HZ", "310HZ", "600HZ",
"1KHZ", "3KHZ", "6KHZ", "12KHZ", "14KHZ", "16KHZ"};
diff --git a/src/info_rw_thread.c b/src/info_rw_thread.c
index 16c6c66..a89a803 100644
--- a/src/info_rw_thread.c
+++ b/src/info_rw_thread.c
@@ -24,6 +24,7 @@
#include <pthread.h>
#include <stdlib.h>
#include "types.h"
+#include "util.h"
#include "info_rw_thread.h"
#include "player.h"
#include "song.h"
diff --git a/src/inp.h b/src/inp.h
index d575a82..bf91506 100644
--- a/src/inp.h
+++ b/src/inp.h
@@ -270,6 +270,9 @@ char *inp_redirect( in_plugin_t *p, char *filename, inp_redirect_params_t *rp );
/* Update plugin flags */
dword inp_get_plugin_flags( in_plugin_t *p );
+/* Get plugin flags */
+dword inp_get_flags( in_plugin_t *p );
+
#endif
/* End of 'inp.h' file */
diff --git a/src/outp.h b/src/outp.h
index 5366f70..f0ec4a1 100644
--- a/src/outp.h
+++ b/src/outp.h
@@ -155,6 +155,9 @@ void out_set_mixer_type( out_plugin_t *p, plugin_mixer_type_t type );
/* Get plugin flags */
dword outp_get_flags( out_plugin_t *p );
+/* Set mixer type */
+void outp_set_mixer_type( out_plugin_t *p, plugin_mixer_type_t type );
+
#endif
/* End of 'outp.h' file */
diff --git a/src/player.c b/src/player.c
index a640864..4585657 100644
--- a/src/player.c
+++ b/src/player.c
@@ -35,6 +35,8 @@
#include "command.h"
#include "eqwnd.h"
#include "file.h"
+#include "inp.h"
+#include "genp.h"
#include "help_screen.h"
#include "logger.h"
#include "logger_view.h"
@@ -59,6 +61,8 @@
#include "wnd_radio.h"
#include "wnd_root.h"
#include "xconvert.h"
+#include "info_rw_thread.h"
+#include "wnd_repval.h"
/*****
*
@@ -1324,7 +1328,6 @@ wnd_msg_retcode_t player_on_command( wnd_t *wnd, char *cmd,
/* Display player function */
wnd_msg_retcode_t player_on_display( wnd_t *wnd )
{
- int i;
song_t *s = NULL;
char aparams[256];
@@ -1660,7 +1663,7 @@ int player_skip_songs( int num, bool_t play )
int len, base, song;
if (player_plist == NULL || !player_plist->m_len)
- return;
+ return 0;
/* Change current song */
song = player_plist->m_cur_song;
@@ -1744,7 +1747,6 @@ void *player_timer_func( void *arg )
while (!player_end_timer)
{
time_t new_t = time(NULL);
- struct timespec tv;
int tm;
/* Update timer */
@@ -1808,16 +1810,15 @@ void *player_thread( void *arg )
song_t *s, *song_played;
int ch = 0, freq = 0, real_ch = 0, real_freq = 0;
dword fmt = 0, real_fmt = 0;
- song_info_t si;
in_plugin_t *inp;
int was_pfreq, was_pbr, was_pstereo;
int disp_count;
dword in_flags, out_flags;
file_t *fd = NULL;
struct x_convert_buffers *convert_buf;
- convert_func_t fmt_convert_func;
- convert_channel_func_t chan_convert_func;
- convert_freq_func_t freq_convert_func;
+ convert_func_t fmt_convert_func = NULL;
+ convert_channel_func_t chan_convert_func = NULL;
+ convert_freq_func_t freq_convert_func = NULL;
/* Skip to next iteration if there is nothing to play */
if (player_plist->m_cur_song < 0 ||
@@ -1907,7 +1908,6 @@ void *player_thread( void *arg )
{
byte buf[8192], *data = buf;
int size = 8192;
- struct timespec tv;
if (player_context->m_status == PLAYER_STATUS_PLAYING)
{
@@ -2142,17 +2142,6 @@ void player_sort_dialog( void )
void player_info_dialog( void )
{
dialog_t *dlg;
- editbox_t *name, *artist, *album, *year, *track, *comment;
- combo_t *genre;
- genre_list_t *glist;
- label_t *own_info;
- int i, sel_start, sel_end, start, end;
- song_t *s;
- song_info_t *info = NULL;
- bool_t name_diff = FALSE, artist_diff = FALSE, album_diff = FALSE,
- year_diff = FALSE, comment_diff = FALSE, genre_diff = FALSE,
- track_diff = FALSE;
- char *file_name;
wnd_t *vbox;
hbox_t *hbox;
button_t *reload;
@@ -2207,9 +2196,9 @@ bool_t player_info_dialog_fill( dialog_t *dlg, bool_t first_call )
combo_t *genre;
label_t *own_data;
song_t **songs_list;
- song_t *main_song;
- int num_songs, i, j;
- song_info_t *info;
+ song_t *main_song = NULL;
+ int num_songs, i;
+ song_info_t *info = NULL;
char *file_name;
bool_t name_diff = FALSE, artist_diff = FALSE, album_diff = FALSE,
year_diff = FALSE, track_diff = FALSE, comment_diff = FALSE,
@@ -2520,7 +2509,7 @@ void player_pmng_dialog( void )
pmng_iterator_t iter;
player_pmng_view_t *views;
checkbox_t *cb;
- button_t *reload_btn, *start_stop_btn;
+ button_t *start_stop_btn;
int i;
/* Initialize basic views data */
@@ -2675,7 +2664,7 @@ void player_pmng_dialog_sync( dialog_t *dlg )
v->m_enabled_cb->m_checked = pmng_is_effect_enabled(player_pmng, p);
else if (i == PLAYER_PMNG_GENERAL)
{
- bool_t started = genp_is_started(p);
+ bool_t started = genp_is_started((general_plugin_t*)p);
wnd_set_title(WND_OBJ(v->m_start_stop_btn), started ? _("S&top") :
_("S&tart"));
}
@@ -2914,7 +2903,6 @@ wnd_msg_retcode_t player_on_info_spec( wnd_t *wnd )
/* Handle 'clicked' for info dialog write-in-all checkbox */
wnd_msg_retcode_t player_on_info_cb_clicked( wnd_t *wnd )
{
- editbox_t *name, *artist, *album, *year, *track, *comments, *genre;
dialog_t *dlg = DIALOG_OBJ(DLGITEM_OBJ(wnd)->m_dialog);
bool_t not_check = !CHECKBOX_OBJ(wnd)->m_checked;
@@ -3191,10 +3179,10 @@ wnd_msg_retcode_t player_pmng_dialog_on_start_stop_general( wnd_t *wnd )
p = (plugin_t *)v->m_list->m_list[index].m_data;
/* Change state */
- if (!genp_is_started(p))
- genp_start(p);
+ if (!genp_is_started((general_plugin_t*)p))
+ genp_start((general_plugin_t*)p);
else
- genp_end(p);
+ genp_end((general_plugin_t*)p);
player_pmng_dialog_sync(DIALOG_OBJ(dlg));
return WND_MSG_RETCODE_OK;
} /* End of 'player_pmng_dialog_on_start_stop_general' function */
diff --git a/src/plist.c b/src/plist.c
index 405757d..dd52254 100644
--- a/src/plist.c
+++ b/src/plist.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <ctype.h>
#include "types.h"
#include "file.h"
#include "inp.h"
@@ -35,6 +36,7 @@
#include "util.h"
#include "undo.h"
#include "wnd.h"
+#include "info_rw_thread.h"
/* Number of files added by plist_add_set */
int plist_num = 0;
@@ -203,7 +205,7 @@ int plist_add_m3u( plist_t *pl, char *filename )
while (!file_eof(fd))
{
char len[10], *title;
- int i, j, song_len, str_len;
+ int i, j, song_len;
vfs_file_t desc;
/* Read file name if no extended info is supplied */
@@ -628,7 +630,7 @@ void plist_sort( plist_t *pl, bool_t global, int criteria )
/* Remove selected songs from play list */
void plist_rem( plist_t *pl )
{
- int start, end, i, cur;
+ int start, end, i;
assert(pl);
/* Get real selection bounds */
@@ -711,12 +713,12 @@ bool_t plist_search( plist_t *pl, char *pstr, int dir, int criteria )
assert(pl);
if (!pl->m_len)
- return;
+ return FALSE;
/* Search */
for ( i = pl->m_sel_end, count = 0; count < pl->m_len && !found; count ++ )
{
- char *str;
+ char *str = NULL;
song_t *s;
/* Go to next song */
@@ -843,8 +845,6 @@ void plist_display( plist_t *pl, wnd_t *wnd )
/* Display each song */
for ( i = 0, j = pl->m_scrolled; i < PLIST_HEIGHT; i ++, j ++ )
{
- int attrib;
-
/* Set respective print attributes */
if (j >= start && j <= end)
{
@@ -866,7 +866,6 @@ void plist_display( plist_t *pl, wnd_t *wnd )
{
song_t *s = pl->m_list[j];
char len[10];
- int x;
int queueList;
wnd_move(wnd, 0, 0, pl->m_start_pos + i);
@@ -918,7 +917,7 @@ void plist_unlock( plist_t *pl )
/* Move selection in play list */
void plist_move_sel( plist_t *pl, int y, bool_t relative )
{
- int start, end, i, j, num_songs;
+ int start, end, i, num_songs;
song_t *cur_song;
if (pl == NULL)
@@ -1066,7 +1065,6 @@ void plist_flush_scheduled( plist_t *pl )
/* Add a set of files to play list */
bool_t plist_add_set( plist_t *pl, plist_set_t *set )
{
- int i, num = 0;
struct tag_plist_set_t *node;
vfs_glob_flags_t flags = 0;
diff --git a/src/pmng.h b/src/pmng.h
index 4ed46f9..55c8d09 100644
--- a/src/pmng.h
+++ b/src/pmng.h
@@ -154,6 +154,9 @@ bool_t pmng_is_effect_enabled( pmng_t *pmng, plugin_t *ep );
/* Enable/disable effect */
void pmng_enable_effect( pmng_t *pmng, plugin_t *ep, bool_t enable );
+/* Call hook functions */
+void pmng_hook( pmng_t *pmng, char *hook );
+
#endif
/* End of 'pmng.h' file */
diff --git a/src/song.c b/src/song.c
index a02300a..e3c2de0 100644
--- a/src/song.c
+++ b/src/song.c
@@ -196,8 +196,6 @@ void song_update_title( song_t *song )
{
for ( ; *fmt && !finish; fmt ++ )
{
- char *g;
-
if (*fmt == '%')
{
fmt ++;
diff --git a/src/undo.c b/src/undo.c
index b1c20cb..82e57c4 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -108,7 +108,6 @@ void undo_bw( undo_list_t *ul )
/* Do action */
void undo_do( struct tag_undo_list_item_t *item )
{
- int i;
bool_t was_store = player_store_undo;
if (item == NULL)
@@ -120,7 +119,6 @@ void undo_do( struct tag_undo_list_item_t *item )
if (item->m_type == UNDO_ADD)
{
struct tag_undo_list_add_t *data = &item->m_data.m_add;
- char *was_val;
plist_add_set(player_plist, data->m_set);
plist_flush_scheduled(player_plist);
}
@@ -244,7 +242,7 @@ void undo_undo( struct tag_undo_list_item_t *item )
/* Sort action */
else if (item->m_type == UNDO_SORT)
{
- int i, j;
+ int i;
struct tag_undo_list_sort_t *data = &item->m_data.m_sort;
song_t **list = (song_t **)malloc(sizeof(song_t *) *
player_plist->m_len);
diff --git a/src/util.h b/src/util.h
index 8fb0126..69e57e3 100644
--- a/src/util.h
+++ b/src/util.h
@@ -24,6 +24,7 @@
#define __SG_MPFC_UTIL_H__
#include <stdio.h>
+#include <string.h>
#include "types.h"
/* Write message to log file */
@@ -45,7 +46,7 @@ void util_delay( long s, long ns );
void util_wait( void );
/* Convert file name to the one with escaped special symbols */
-char *util_escape_fname( char *out, char *in );
+void util_escape_fname( char *out, char *in );
/* Get short plugin name */
char *util_get_plugin_short_name( char *dest, char *src );
@@ -80,7 +81,7 @@ char *util_strncpy( char *dest, char *src, size_t n );
/* Concatenate multiple strings */
char *util_strcat( char *first, ... );
-int msblen( char *str );
+int mbslen( char *str );
#endif