summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b64e284)
raw | patch | inline | side by side (parent: b64e284)
author | Kalle Wallin <kaw@linux.se> | |
Sun, 20 Jun 2004 20:02:33 +0000 (20:02 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Sun, 20 Jun 2004 20:02:33 +0000 (20:02 +0000) |
src/mpdclient.c | patch | blob | history | |
src/mpdclient.h | patch | blob | history | |
src/screen.c | patch | blob | history | |
src/screen_file.c | patch | blob | history | |
src/screen_play.c | patch | blob | history |
diff --git a/src/mpdclient.c b/src/mpdclient.c
index 1069f8ef539c914cc8605aeeee6f124756389be1..3f1fb4416501ddc3d2972daba35548dd6d59a1c5 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
}
gint
-mpdclient_cmd_db_update(mpdclient_t *c, gchar *path)
+mpdclient_cmd_db_update_utf8(mpdclient_t *c, gchar *path)
{
mpd_sendUpdateCommand(c->connection, path ? path : "");
return mpdclient_finish_command(c);
return mpdclient_finish_command(c);
}
+gint
+mpdclient_cmd_add_path_utf8(mpdclient_t *c, gchar *path_utf8)
+{
+ mpd_sendAddCommand(c->connection, path_utf8);
+ return mpdclient_finish_command(c);
+}
+
gint
mpdclient_cmd_add_path(mpdclient_t *c, gchar *path)
{
gint retval;
gchar *path_utf8 = locale_to_utf8(path);
- mpd_sendAddCommand(c->connection, path_utf8);
- retval=mpdclient_finish_command(c);
+ retval=mpdclient_cmd_add_path_utf8(c, path_utf8);
g_free(path_utf8);
return retval;
}
}
gint
-mpdclient_cmd_save_playlist(mpdclient_t *c, gchar *filename)
+mpdclient_cmd_save_playlist_utf8(mpdclient_t *c, gchar *filename_utf8)
{
gint retval = 0;
- gchar *filename_utf8 = locale_to_utf8(filename);
mpd_sendSaveCommand(c->connection, filename_utf8);
if( (retval=mpdclient_finish_command(c)) == 0 )
mpdclient_browse_callback(c, BROWSE_PLAYLIST_SAVED, NULL);
+ return retval;
+}
+
+gint
+mpdclient_cmd_save_playlist(mpdclient_t *c, gchar *filename)
+{
+ gint retval = 0;
+ gchar *filename_utf8 = locale_to_utf8(filename);
+
+ retval = mpdclient_cmd_save_playlist_utf8(c, filename);
g_free(filename_utf8);
return retval;
}
gint
-mpdclient_cmd_load_playlist(mpdclient_t *c, gchar *filename_utf8)
+mpdclient_cmd_load_playlist_utf8(mpdclient_t *c, gchar *filename_utf8)
{
mpd_sendLoadCommand(c->connection, filename_utf8);
c->need_update = TRUE;
}
gint
-mpdclient_cmd_delete_playlist(mpdclient_t *c, gchar *filename_utf8)
+mpdclient_cmd_delete_playlist_utf8(mpdclient_t *c, gchar *filename_utf8)
{
gint retval = 0;
return retval;
}
+gint
+mpdclient_cmd_delete_playlist(mpdclient_t *c, gchar *filename)
+{
+ gint retval = 0;
+ gchar *filename_utf8 = locale_to_utf8(filename);
+
+ retval = mpdclient_cmd_delete_playlist_utf8(c, filename_utf8);
+ g_free(filename_utf8);
+ return retval;
+}
+
/****************************************************************************/
/*** Callback managment functions *******************************************/
diff --git a/src/mpdclient.h b/src/mpdclient.h
index c5df09ed800625a5f4a952167dc0fd96e1661a7c..c0d897d800f01fbb3888c03c089596132bd22acd 100644 (file)
--- a/src/mpdclient.h
+++ b/src/mpdclient.h
gint mpdclient_cmd_repeat(mpdclient_t *c, gint value);
gint mpdclient_cmd_random(mpdclient_t *c, gint value);
gint mpdclient_cmd_crossfade(mpdclient_t *c, gint value);
-gint mpdclient_cmd_db_update(mpdclient_t *c, gchar *path);
+gint mpdclient_cmd_db_update_utf8(mpdclient_t *c, gchar *path);
gint mpdclient_cmd_volume(mpdclient_t *c, gint value);
gint mpdclient_cmd_add_path(mpdclient_t *c, gchar *path);
+gint mpdclient_cmd_add_path_utf8(mpdclient_t *c, gchar *path);
gint mpdclient_cmd_add(mpdclient_t *c, mpd_Song *song);
gint mpdclient_cmd_delete(mpdclient_t *c, gint index);
gint mpdclient_cmd_move(mpdclient_t *c, gint old_index, gint new_index);
gint mpdclient_cmd_save_playlist(mpdclient_t *c, gchar *filename);
-gint mpdclient_cmd_load_playlist(mpdclient_t *c, gchar *filename_utf8);
-gint mpdclient_cmd_delete_playlist(mpdclient_t *c, gchar *filename_utf8);
+gint mpdclient_cmd_save_playlist_utf8(mpdclient_t *c, gchar *filename);
+gint mpdclient_cmd_load_playlist_utf8(mpdclient_t *c, gchar *filename_utf8);
+gint mpdclient_cmd_delete_playlist_utf8(mpdclient_t *c, gchar *filename_utf8);
/*** error callbacks *****************************************************/
diff --git a/src/screen.c b/src/screen.c
index 43383d93c4e8b1460a651e938feeb75823190068..8d517c950518d11e6839aab315e0df1bb6e10833 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
case CMD_DB_UPDATE:
if( !c->status->updatingDb )
{
- if( mpdclient_cmd_db_update(c,NULL)==0 )
+ if( mpdclient_cmd_db_update_utf8(c,NULL)==0 )
screen_status_printf(_("Database update started!"));
}
else
diff --git a/src/screen_file.c b/src/screen_file.c
index ebde970966af4d21528794a63cd549617462ca04..9f1d0b209403ef7c3460386f8a854b14de02ff5f 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
mpd_PlaylistFile *plf = entity->info.playlistFile;
char *filename = utf8_to_locale(plf->path);
- if( mpdclient_cmd_load_playlist(c, plf->path) == 0 )
+ if( mpdclient_cmd_load_playlist_utf8(c, plf->path) == 0 )
screen_status_printf(_("Loading playlist %s..."), basename(filename));
g_free(filename);
return 0;
return 0;
}
- if( mpdclient_cmd_delete_playlist(c, plf->path) )
+ if( mpdclient_cmd_delete_playlist_utf8(c, plf->path) )
{
return -1;
}
{
mpd_Directory *dir = entry->entity->info.directory;
#ifdef USE_OLD_ADD
- add_directory(c, dir->path);
+ add_directory(c, tmp);
#else
- if( mpdclient_cmd_add_path(c, dir->path) == 0 )
+ if( mpdclient_cmd_add_path_utf8(c, dir->path) == 0 )
{
char *tmp = utf8_to_locale(dir->path);
case CMD_DB_UPDATE:
if( !c->status->updatingDb )
{
- if( mpdclient_cmd_db_update(c,filelist->path)==0 )
+ if( mpdclient_cmd_db_update_utf8(c,filelist->path)==0 )
{
screen_status_printf(_("Database update of %s started!"),
filelist->path);
diff --git a/src/screen_play.c b/src/screen_play.c
index 60d0e2586c838c00c09bda736710d584b0ecaab6..b11229841b2511b5c5de3f64ce947d738cfa2aa1 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
key = tolower(screen_getch(screen->status_window.w, buf));
if( key == YES[0] )
{
- char *filename_utf8 = locale_to_utf8(filename);
-
- if( mpdclient_cmd_delete_playlist(c, filename_utf8) )
+ if( mpdclient_cmd_delete_playlist(c, filename) )
{
g_free(filename);
- g_free(filename_utf8);
return -1;
}
- g_free(filename_utf8);
error = handle_save_playlist(screen, c, filename);
g_free(filename);
return error;