Changeset 19f6ea5b in mainline


Ignore:
Timestamp:
2013-04-05T20:24:52Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
afd4fc7
Parents:
fb14905
Message:

wavplay: play multiple files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/wavplay/main.c

    rfb14905 r19f6ea5b  
    112112static void print_help(const char* name)
    113113{
    114         printf("Usage: %s [options] file\n", name);
     114        printf("Usage: %s [options] file [files...]\n", name);
    115115        printf("supported options:\n");
    116116        printf("\t -h, --help\t Print this help.\n");
     
    149149                return 1;
    150150        }
    151         const char *file = argv[optind];
    152151
    153         printf("%s %s\n", record ? "Recording" : "Playing", file);
    154         if (record) {
    155                 printf("Recording is not supported yet.\n");
    156                 return 1;
     152        for (int i = optind; i < argc; ++i) {
     153                const char *file = argv[i];
     154
     155                printf("%s (%d/%d) %s\n", record ? "Recording" : "Playing",
     156                    i - optind + 1, argc - optind, file);
     157                if (record) {
     158                        printf("Recording is not supported yet.\n");
     159                        return 1;
     160                }
     161                if (direct) {
     162                        dplay(device, file);
     163                } else {
     164                        hplay(file);
     165                }
    157166        }
    158         if (direct) {
    159                 return dplay(device, file);
    160         } else {
    161                 return hplay(file);
    162         }
     167        return 0;
    163168}
    164169/**
Note: See TracChangeset for help on using the changeset viewer.