linuxsampler 2.3.1
Device.h
Go to the documentation of this file.
1/***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 * Copyright (C) 2005 - 2009 Christian Schoenebeck *
7 * *
8 * 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 *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21 * MA 02111-1307 USA *
22 ***************************************************************************/
23
24#ifndef __LS_DEVICE_H__
25#define __LS_DEVICE_H__
26
27namespace LinuxSampler {
28
29 class AudioOutputDeviceFactory;
30 class MidiInputDeviceFactory;
31
35 class Device {
36 public:
49 virtual bool isAutonomousDevice();
50
59 int deviceId() const;
60
66 static bool isAutonomousDriver();
67
68 protected:
69 void setDeviceId(int id);
70
71 //TODO: maybe it would be cleaner to pass the device id through the drivers' constructors instead of having a setDeviceId() method being available only for the factory classes
74 private:
75 int iDeviceId; //TODO: there is not default initialization (e.g. with -1) yet, since there is no constructor yet, it would require all driver implementations to be updated with a constructor call
76 };
77
78} // namespace LinuxSampler
79
80#endif // __LS_DEVICE_H__
Abstract base class for all kind of drivers in LinuxSampler.
Definition Device.h:35
virtual bool isAutonomousDevice()
Determines whether the device is an autonomous instance of some driver or not autonomous (that is bou...
int deviceId() const
Returns the numerical ID of this device instance.
void setDeviceId(int id)
static bool isAutonomousDriver()
Whether this is an autonomous device driver.
friend class MidiInputDeviceFactory
Definition Device.h:73
friend class AudioOutputDeviceFactory
Definition Device.h:72