Changeset aef1799 in mainline for uspace/app/wavplay/dplay.c


Ignore:
Timestamp:
2012-07-17T10:57:41Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1f7da3b
Parents:
cd8f19d
Message:

Integrate dplay into wavplay.

File:
1 moved

Legend:

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

    rcd8f19d raef1799  
    4949
    5050#include "wave.h"
     51#include "dplay.h"
    5152
    5253#define DEFAULT_DEVICE "/hw/pci0/00:01.0/sb16/pcm"
     
    153154}
    154155
    155 int main(int argc, char *argv[])
    156 {
    157         const char *device = DEFAULT_DEVICE;
    158         const char *file;
    159         switch (argc) {
    160         case 2:
    161                 file = argv[1];
    162                 break;
    163         case 3:
    164                 device = argv[1];
    165                 file = argv[2];
    166                 break;
    167         default:
    168                 printf("Usage: %s [device] file.\n", argv[0]);
    169                 return 1;
    170         }
    171 
     156int dplay(const char *device, const char *file)
     157{
     158        if (str_cmp(device, "default") == 0)
     159                device = DEFAULT_DEVICE;
    172160        audio_pcm_sess_t *session = audio_pcm_open(device);
    173161        if (!session) {
    174                 printf("Failed to connect to device.\n");
     162                printf("Failed to connect to device %s.\n", device);
    175163                return 1;
    176164        }
     165        printf("Playing on device: %s.\n", device);
    177166
    178167        const char* info = NULL;
Note: See TracChangeset for help on using the changeset viewer.