3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 Christian Schoenebeck * |
* Copyright (C) 2005, 2006 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
26 |
|
|
27 |
#include "../../common/global.h" |
#include "../../common/global.h" |
28 |
|
|
29 |
#if DEBUG_HEADERS |
#include <gig.h> |
|
# warning InstrumentResourceManager.h included |
|
|
#endif // DEBUG_HEADERS |
|
30 |
|
|
31 |
#include "../../common/global.h" |
#include "../../common/global.h" |
32 |
#include "../../common/LinuxSamplerException.h" |
#include "../../common/Exception.h" |
33 |
#include "../../common/ResourceManager.h" |
#include "../../common/ResourceManager.h" |
34 |
#include "../../drivers/audio/AudioOutputDevice.h" |
#include "../../drivers/audio/AudioOutputDevice.h" |
|
#include "../../lib/fileloader/libgig/gig.h" |
|
|
|
|
|
// preload 64k samples = 128kB of data in RAM for 16 bit mono samples |
|
|
#define NUM_RAM_PRELOAD_SAMPLES 32768 |
|
35 |
|
|
36 |
//namespace libgig = gig; |
//namespace libgig = gig; |
37 |
|
|
76 |
class InstrumentResourceManager : public ResourceManager<instrument_id_t, ::gig::Instrument> { |
class InstrumentResourceManager : public ResourceManager<instrument_id_t, ::gig::Instrument> { |
77 |
public: |
public: |
78 |
virtual ~InstrumentResourceManager() {} |
virtual ~InstrumentResourceManager() {} |
79 |
|
static void OnInstrumentLoadingProgress(::gig::progress_t* pProgress); |
80 |
protected: |
protected: |
81 |
virtual ::gig::Instrument* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg); |
virtual ::gig::Instrument* Create(instrument_id_t Key, InstrumentConsumer* pConsumer, void*& pArg); |
82 |
virtual void Destroy(::gig::Instrument* pResource, void* pArg); |
virtual void Destroy(::gig::Instrument* pResource, void* pArg); |
105 |
/** |
/** |
106 |
* Will be thrown by the InstrumentResourceManager on errors. |
* Will be thrown by the InstrumentResourceManager on errors. |
107 |
*/ |
*/ |
108 |
class InstrumentResourceManagerException : public LinuxSamplerException { |
class InstrumentResourceManagerException : public Exception { |
109 |
public: |
public: |
110 |
InstrumentResourceManagerException(String msg) : LinuxSamplerException(msg) {} |
InstrumentResourceManagerException(String msg) : Exception(msg) {} |
111 |
}; |
}; |
112 |
|
|
113 |
}} // namespace LinuxSampler::gig |
}} // namespace LinuxSampler::gig |