~ubuntu-branches/ubuntu/trusty/ydpdict/trusty

« back to all changes in this revision

Viewing changes to src/ydpsound.c

  • Committer: Bazaar Package Importer
  • Author(s): Marcin Owsiany
  • Date: 2005-12-03 16:34:10 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051203163410-1wpo4yusify3g8cj
Tags: 0.65-1
* New upstream version
  - adds support for pl/de de/pl dictionary files
  - some fixes, including those for amd64 Closes: #341594, #338720, #338731
  - adds support for .ogg files
* debian/control:
  - adjusted description to de support
  - added upstream homepage URL to the description
* debian/rules: fixed (unused --libexecdir path to configure)
* debian/ydpdict.conf.example: removed
* debain/ydpdict.examples: use ydpdict.conf.example
* ydpdict.conf.example: changed mnt to media

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  ydpdict
3
 
 *  (c) 1998-2004 wojtek kaniewski <wojtekka@irc.pl>
 
3
 *  (c) Copyright 1998-2004 Wojtek Kaniewski <wojtekka@toxygen.net>
4
4
 *
5
5
 *  This program is free software; you can redistribute it and/or modify
6
6
 *  it under the terms of the GNU General Public License as published by
38
38
int playsample(int def)
39
39
{
40
40
        static u_char buf[256];
41
 
  
42
 
        snprintf(buf, sizeof(buf), "%s/S%.3d/%.6d.WAV", cdpath, def / 1000, def + 1);
 
41
        char *exts[] = { "WAV", "wav", "MP3", "mp3", "OGG", "ogg", NULL };
 
42
        int i;
 
43
 
 
44
        for (i = 0; exts[i]; i++) {
 
45
                snprintf(buf, sizeof(buf), "%s/S%.3d/%.6d.%s", cdpath, def / 1000, def + 1, exts[i]);
43
46
        
44
 
        if (access(buf, R_OK)) {
45
 
                snprintf(buf, sizeof(buf), "%s/s%.3d/%.6d.wav", cdpath, def / 1000, def + 1);
46
 
 
47
 
                if (access(buf, R_OK)) {
48
 
                        snprintf(buf, sizeof(buf), "%s/S%.3d/%.6d.MP3", cdpath, def / 1000, def + 1);
49
 
 
50
 
                        if (access(buf, R_OK)) {
51
 
                                snprintf(buf, sizeof(buf), "%s/s%.3d/%.6d.mp3", cdpath, def / 1000, def + 1);
52
 
 
53
 
                                if (access(buf, R_OK))
54
 
                                        return 0;
55
 
                        }
56
 
                }
 
47
                if (!access(buf, R_OK))
 
48
                        break;
57
49
        }
58
50
 
 
51
        if (!exts[i])
 
52
                return 0;
 
53
 
59
54
        if (player) {
60
55
                u_char buf2[512];
61
56