Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3891 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Apr 19, 2005, 2:33:02 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: sound can be registered with the resource-Manager:
user load(fileName, RESOURCE_SOUND_EFFECT/MUSIC) to load

Location:
orxonox/branches/sound_engine/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/sound_engine/src/util/resource_manager.cc

    r3884 r3891  
    1919
    2020// different resource Types
     21#include "sound_engine.h"
    2122#include "objModel.h"
    2223#include "primitive_model.h"
     
    150151    tmpType = OBJ;
    151152  else if (!strncmp(fileName+(strlen(fileName)-4), ".wav", 4))
    152     tmpType = WAV;
     153    {
     154      tmpType = WAV;
     155      PRINTF(2)("not determined of what type the resource is %s EFFECT OR MUSIC\n");
     156    }
    153157  else if (!strncmp(fileName+(strlen(fileName)-4), ".mp3", 4))
    154     tmpType = MP3;
     158    {
     159      tmpType = MP3;
     160      PRINTF(2)("not determined of what type the resource is %s EFFECT OR MUSIC\n");
     161    }
    155162  else if (!strncmp(fileName+(strlen(fileName)-4), ".ogg", 4))
    156     tmpType = OGG;
     163    {
     164      tmpType = OGG;
     165      PRINTF(2)("not determined of what type the resource is %s EFFECT OR MUSIC\n");
     166    }
    157167  else if (!strcmp(fileName, "cube") ||
    158168           !strcmp(fileName, "sphere") ||
     
    205215      switch(type)
    206216        {
     217        case RESOURCE_SOUND_EFFECT:
     218          if(isFile(fullName))
     219            tmpResource->pointer = new SoundEffect(fullName);
     220          break;
     221        case RESOURCE_SOUND_MUSIC:
     222          if(isFile(fullName))
     223            tmpResource->pointer = new Music(fullName);
     224          break;
    207225        case OBJ:
    208226          if (param1)
     
    342360          switch(resource->type)
    343361            {
     362            case RESOURCE_SOUND_EFFECT:
     363            case RESOURCE_SOUND_MUSIC:
     364              delete (Sound*)resource->pointer;
     365              break;
    344366            case OBJ:
    345367            case PRIM:
  • orxonox/branches/sound_engine/src/util/resource_manager.h

    r3884 r3891  
    1919
    2020//! An eumerator for different fileTypes the resourceManager supports \todo WAV, MP3, OGG support
    21 enum ResourceType {OBJ, PRIM, WAV, MP3, OGG, TTF, IMAGE};
     21enum ResourceType {OBJ,
     22                   PRIM,
     23                   WAV,
     24                   MP3,
     25                   OGG,
     26                   TTF,
     27                   IMAGE,
     28                   RESOURCE_SOUND_EFFECT,
     29                   RESOURCE_SOUND_MUSIC};
    2230//! An enumerator for different UNLOAD-types.
    2331/**
Note: See TracChangeset for help on using the changeset viewer.