~ubuntu-branches/debian/jessie/scummvm/jessie

« back to all changes in this revision

Viewing changes to engines/gob/sound/sound.cpp

  • Committer: Package Import Robot
  • Author(s): Moritz Muehlenhoff
  • Date: 2011-11-05 10:29:43 UTC
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: package-import@ubuntu.com-20111105102943-zfm3dhlvy5b01u7v
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * along with this program; if not, write to the Free Software
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
20
 *
21
 
 * $URL$
22
 
 * $Id$
23
 
 *
24
21
 */
25
22
 
26
23
#include "gob/gob.h"
333
330
        if (!_adlPlayer)
334
331
                _adlPlayer = new ADLPlayer(*_vm->_mixer);
335
332
 
336
 
        static const char *tracksMac[] = {
 
333
        static const char *const tracksMac[] = {
337
334
//              "musmac1.adl", // TODO: This track isn't played correctly at all yet
338
335
                "musmac2.adl",
339
336
                "musmac3.adl",
342
339
                "musmac6.adl"
343
340
        };
344
341
 
345
 
        static const char *tracksWin[] = {
 
342
        static const char *const tracksWin[] = {
346
343
                "musmac1.mid",
347
344
                "musmac2.mid",
348
345
                "musmac3.mid",
437
434
        debugC(1, kDebugSound, "SoundBlaster: Playing sample (%d, %d, %d)",
438
435
                        repCount, frequency, fadeLength);
439
436
 
 
437
        blasterStopComposition();
 
438
 
440
439
        _blaster->playSample(*sndDesc, repCount, frequency, fadeLength);
441
440
}
442
441
 
537
536
        if (!_cdrom)
538
537
                return;
539
538
 
540
 
        static const char *tracks[][2] = {
 
539
        static const char *const tracks[][2] = {
541
540
                {"avt00.tot",  "mine"},
542
541
                {"avt001.tot", "nuit"},
543
542
                {"avt002.tot", "campagne"},
574
573
        if (!_cdrom)
575
574
                return;
576
575
 
577
 
        static const char *tracks[][6] = {
 
576
        static const char *const tracks[][6] = {
578
577
                {"avt005.tot", "fra1", "all1", "ang1", "esp1", "ita1"},
579
578
                {"avt006.tot", "fra2", "all2", "ang2", "esp2", "ita2"},
580
579
                {"avt012.tot", "fra3", "all3", "ang3", "esp3", "ita3"},
670
669
        _bgatmos->stopBA();
671
670
        _bgatmos->queueClear();
672
671
 
673
 
        int length = strlen(base) + 7;
674
 
        char *fileName = new char[length];
675
672
        SoundDesc *sndDesc;
676
673
 
677
674
        for (int i = 1; i <= count; i++) {
678
 
                snprintf(fileName, length, "%s%02d.%s", base, i, ext);
 
675
                Common::String fileName = Common::String::format("%s%02d.%s", base, i, ext);
679
676
 
680
677
                sndDesc = new SoundDesc;
681
 
                if (sampleLoad(sndDesc, type, fileName))
 
678
                if (sampleLoad(sndDesc, type, fileName.c_str()))
682
679
                        _bgatmos->queueSample(*sndDesc);
683
680
                else
684
681
                        delete sndDesc;