Changeset 2496


Ignore:
Timestamp:
Feb 25, 2013, 4:45:31 PM (6 years ago)
Author:
sam
Message:

audio: add Sampler::LoopSample().

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/sample.cpp

    r2492 r2496  
    110110}
    111111
     112void Sample::Loop()
     113{
     114#if defined USE_SDL_MIXER
     115    data->m_channel = Mix_PlayChannel(-1, data->m_chunk, -1);
     116#endif
     117}
     118
    112119void Sample::Stop()
    113120{
  • trunk/src/sample.h

    r2492 r2496  
    4141    /* New methods */
    4242    void Play();
     43    void Loop();
    4344    void Stop();
    4445
  • trunk/src/sampler.cpp

    r2493 r2496  
    6161}
    6262
     63void Sampler::LoopSample(int id)
     64{
     65    Sample *sample = (Sample *)data->samples.GetEntity(id - 1);
     66    sample->Loop();
     67}
     68
    6369void Sampler::StopSample(int id)
    6470{
  • trunk/src/sampler.h

    r2493 r2496  
    3030
    3131    static void PlaySample(int id);
     32    static void LoopSample(int id);
    3233    static void StopSample(int id);
    3334
Note: See TracChangeset for help on using the changeset viewer.