]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Remove com_sb and com_sc.
authorAndre Noll <maan@systemlinux.org>
Tue, 23 Oct 2007 17:38:47 +0000 (19:38 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 23 Oct 2007 17:38:47 +0000 (19:38 +0200)
Nobody used com_sb and com_sc was only used by para_krell.

command.c
server.cmd

index 441f4d7ea667d4fed60c0f7ecb4a87b5a18ae1c5..92fe18f07591f134270035c2845040efc3b070b8 100644 (file)
--- a/command.c
+++ b/command.c
@@ -95,38 +95,6 @@ static char *vss_get_status_flags(unsigned int flags)
        return msg;
 }
 
-/*
- * compute status bar string. Never returns NULL
- */
-static char *get_sb_string(struct misc_meta_data *nmmd)
-{
-       char *base, *ret;
-       long long unsigned secs = 0, rsecs = 0, percent = 0;
-
-       base = para_basename(nmmd->filename);
-       if (!base)
-               return para_strdup("");
-       if (!base[0])
-               return base;
-       if (nmmd->afi.chunks_total) {
-               secs = (long long) nmmd->afi.seconds_total * nmmd->chunks_sent
-                       / nmmd->afi.chunks_total;
-               rsecs = (long long) nmmd->afi.seconds_total *
-                       (nmmd->afi.chunks_total - nmmd->chunks_sent)
-                       / nmmd->afi.chunks_total;
-               percent = 100 * ((nmmd->chunks_sent + 5) / 10)
-                       / ((nmmd->afi.chunks_total + 5) / 10);
-       }
-       ret = make_message("%llu:%02llu [%llu:%02llu] (%llu%%) %s",
-               secs / 60, secs % 60,
-               rsecs / 60, rsecs % 60,
-               percent,
-               base
-       );
-       free(base);
-       return ret;
-}
-
 static char *get_status(struct misc_meta_data *nmmd)
 {
        char *bar, *ret, mtime[30] = "";
@@ -341,61 +309,6 @@ int com_version(int fd, int argc, __a_unused char * const * argv)
        );
 }
 
-/* sc */
-int com_sc(int fd, int argc, char * const * argv)
-{
-       char *name = NULL;
-       int ret, old = 0, count = -1; /* print af change forever */
-
-       if (argc > 1)
-               count = atoi(argv[1]);
-repeat:
-       mmd_lock();
-       if (old != mmd->num_played) {
-               old = mmd->num_played;
-               name = para_strdup(mmd->filename);
-       }
-       mmd_unlock();
-       if (name) {
-               ret = send_va_buffer(fd, "%s\n", name);
-               free(name);
-               name = NULL;
-               if (ret < 0)
-                       return ret;
-               if (argc > 1 && !--count)
-                       return 1;
-       }
-       usleep(500000);
-       goto repeat;
-}
-
-/* sb */
-int com_sb(int fd, int argc, char * const * argv)
-{
-       char *sb;
-       int ret, nr = -1;       /* status bar will be printed that many
-                                * times. Negative value means: print
-                                * forever
-                                */
-       if (argc > 1)
-               nr = atoi(argv[1]);
-       while (nr) {
-               mmd_lock();
-               sb = get_sb_string(mmd);
-               mmd_unlock();
-               ret = send_va_buffer(fd, "%s\n", sb);
-               free(sb);
-               if (ret < 0)
-                       return ret;
-               if (nr == 1)
-                       return 1;
-               usleep(500000);
-               if (nr > 0)
-                       nr--;
-       }
-       return 1;
-}
-
 /* stat */
 int com_stat(int fd, int argc, char * const * argv)
 {
index 41dc2805b4515b20a101b34e54682f764ff73815..18e1ab6cfdc5476eb7b08708d7ea738b308d925c 100644 (file)
@@ -74,27 +74,6 @@ U: play
 H: Set the 'P' (playing) bit of the vss status flags. This
 H: results in starting/continuing to stream.
 ---
-N: sb
-P: VSS_READ
-D: print status bar for current audio file
-U: sb [n]
-H: Without any arguments, sb continuously prints a status bar of the
-H: form
-H:
-H:     12:34 [56:12] (56%) filename
-H:
-H: indicating playing time, remaining time, percentage and the name of
-H: the file being streamed. Use the optional number n to let stat exit
-H: after having displayed the status bar n times.
----
-N: sc
-P: VSS_READ
-D: print name of audio file whenever it changes
-U: sc [n]
-H: sc prints exactly one line (the filename of the audio file
-H: being played) whenever the audio file changes. Stops after
-H: n iterations, or never if n is not specified.
----
 N: sender
 P: VSS_READ | VSS_WRITE
 D: control paraslash internal senders