~ubuntu-branches/ubuntu/lucid/mpg123/lucid

« back to all changes in this revision

Viewing changes to src/control_generic.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2009-12-21 00:11:29 UTC
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20091221001129-gsbnzbenceqv4pjt
Tags: upstream-1.10.0
ImportĀ upstreamĀ versionĀ 1.10.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
#include "mpg123app.h"
11
11
#include <stdarg.h>
12
 
#ifndef WIN32
 
12
#if !defined (WIN32) || defined (__CYGWIN__)
13
13
#include <sys/wait.h>
14
14
#include <sys/socket.h>
15
 
#else
16
 
#include <winsock.h>
17
15
#endif
18
16
#include <fcntl.h>
19
17
#include <errno.h>
27
25
#define MODE_PAUSED 2
28
26
 
29
27
extern int buffer_pid;
 
28
extern audio_output_t *ao;
 
29
 
30
30
#ifdef FIFO
31
31
#include <sys/stat.h>
32
32
int control_file = STDIN_FILENO;
262
262
#endif
263
263
        /* the command behaviour is different, so is the ID */
264
264
        /* now also with version for command availability */
265
 
        fprintf(outstream, "@R MPG123 (ThOr) v5\n");
 
265
        fprintf(outstream, "@R MPG123 (ThOr) v6\n");
266
266
#ifdef FIFO
267
267
        if(param.fifo)
268
268
        {
507
507
                                        generic_sendmsg("H SCAN: scan through the file, building seek index");
508
508
                                        generic_sendmsg("H SAMPLE: print out the sample position and total number of samples");
509
509
                                        generic_sendmsg("H SEQ <bass> <mid> <treble>: simple eq setting...");
 
510
                                        generic_sendmsg("H PITCH <[+|-]value>: adjust playback speed (+0.01 is 1 %% faster)");
510
511
                                        generic_sendmsg("H SILENCE: be silent during playback (meaning silence in text form)");
511
512
                                        generic_sendmsg("H STATE: Print auxilliary state info in several lines (just try it to see what info is there).");
512
513
                                        generic_sendmsg("H TAG/T: Print all available (ID3) tag info, for ID3v2 that gives output of all collected text fields, using the ID3v2.3/4 4-character names.");
650
651
                                                continue;
651
652
                                        }
652
653
 
 
654
                                        /* PITCH (playback speed) in percent */
 
655
                                        if(!strcasecmp(cmd, "PITCH"))
 
656
                                        {
 
657
                                                double p;
 
658
                                                if(sscanf(arg, "%lf", &p) == 1)
 
659
                                                {
 
660
                                                        set_pitch(fr, ao, p);
 
661
                                                        generic_sendmsg("PITCH %f", param.pitch);
 
662
                                                }
 
663
                                                else generic_sendmsg("E invalid arguments for PITCH: %s", arg);
 
664
                                                continue;
 
665
                                        }
 
666
 
653
667
                                        /* RVA mode */
654
668
                                        if(!strcasecmp(cmd, "RVA"))
655
669
                                        {