Changeset aef1799 in mainline for uspace/app/wavplay/dplay.c
- Timestamp:
- 2012-07-17T10:57:41Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1f7da3b
- Parents:
- cd8f19d
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/dplay.c
rcd8f19d raef1799 49 49 50 50 #include "wave.h" 51 #include "dplay.h" 51 52 52 53 #define DEFAULT_DEVICE "/hw/pci0/00:01.0/sb16/pcm" … … 153 154 } 154 155 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 156 int dplay(const char *device, const char *file) 157 { 158 if (str_cmp(device, "default") == 0) 159 device = DEFAULT_DEVICE; 172 160 audio_pcm_sess_t *session = audio_pcm_open(device); 173 161 if (!session) { 174 printf("Failed to connect to device .\n");162 printf("Failed to connect to device %s.\n", device); 175 163 return 1; 176 164 } 165 printf("Playing on device: %s.\n", device); 177 166 178 167 const char* info = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.