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 * |
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 * |
30 |
#include "../../common/LinuxSamplerException.h" |
#include "../../common/LinuxSamplerException.h" |
31 |
#include "../DeviceParameterFactory.h" |
#include "../DeviceParameterFactory.h" |
32 |
#include "MidiInputDevice.h" |
#include "MidiInputDevice.h" |
33 |
|
#include "../../Sampler.h" |
34 |
|
|
35 |
#define REGISTER_MIDI_INPUT_DRIVER(DriverClass) static LinuxSampler::MidiInputDeviceFactory::InnerFactoryRegistrator<DriverClass> __auto_register_midi_input_driver__##DriverClass |
#define REGISTER_MIDI_INPUT_DRIVER(DriverClass) static LinuxSampler::MidiInputDeviceFactory::InnerFactoryRegistrator<DriverClass> __auto_register_midi_input_driver__##DriverClass |
36 |
#define REGISTER_MIDI_INPUT_DRIVER_PARAMETER(DriverClass, ParameterClass) static LinuxSampler::MidiInputDeviceFactory::ParameterRegistrator<DriverClass, DriverClass::ParameterClass> __auto_register_midi_input_driver_parameter__##DriverClass##ParameterClass |
#define REGISTER_MIDI_INPUT_DRIVER_PARAMETER(DriverClass, ParameterClass) static LinuxSampler::MidiInputDeviceFactory::ParameterRegistrator<DriverClass, DriverClass::ParameterClass> __auto_register_midi_input_driver_parameter__##DriverClass##ParameterClass |
41 |
public: |
public: |
42 |
class InnerFactory { |
class InnerFactory { |
43 |
public: |
public: |
44 |
virtual MidiInputDevice* Create(std::map<String,DeviceCreationParameter*>& Parameters) = 0; |
virtual MidiInputDevice* Create(std::map<String,DeviceCreationParameter*>& Parameters, Sampler* pSampler) = 0; |
45 |
virtual String Description() = 0; |
virtual String Description() = 0; |
46 |
virtual String Version() = 0; |
virtual String Version() = 0; |
47 |
}; |
}; |
49 |
template <class Driver_T> |
template <class Driver_T> |
50 |
class InnerFactoryTemplate : public InnerFactory { |
class InnerFactoryTemplate : public InnerFactory { |
51 |
public: |
public: |
52 |
virtual MidiInputDevice* Create(std::map<String,DeviceCreationParameter*>& Parameters) { return new Driver_T(Parameters); } |
virtual MidiInputDevice* Create(std::map<String,DeviceCreationParameter*>& Parameters, Sampler* pSampler) { return new Driver_T(Parameters, pSampler); } |
53 |
virtual String Description() { return Driver_T::Description(); } |
virtual String Description() { return Driver_T::Description(); } |
54 |
virtual String Version() { return Driver_T::Version(); } |
virtual String Version() { return Driver_T::Version(); } |
55 |
}; |
}; |
72 |
}; |
}; |
73 |
|
|
74 |
|
|
75 |
static MidiInputDevice* Create(String DriverName, std::map<String,String> Parameters) throw (LinuxSamplerException); |
static MidiInputDevice* Create(String DriverName, std::map<String,String> Parameters, Sampler* pSampler) throw (LinuxSamplerException); |
76 |
static std::vector<String> AvailableDrivers(); |
static std::vector<String> AvailableDrivers(); |
77 |
static String AvailableDriversAsString(); |
static String AvailableDriversAsString(); |
78 |
static std::map<String,DeviceCreationParameter*> GetAvailableDriverParameters(String DriverName) throw (LinuxSamplerException); |
static std::map<String,DeviceCreationParameter*> GetAvailableDriverParameters(String DriverName) throw (LinuxSamplerException); |