linuxsampler 1.0.0

Device.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *                                                                         *
00003  *   LinuxSampler - modular, streaming capable sampler                     *
00004  *                                                                         *
00005  *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
00006  *   Copyright (C) 2005 - 2009 Christian Schoenebeck                       *
00007  *                                                                         *
00008  *   This program is free software; you can redistribute it and/or modify  *
00009  *   it under the terms of the GNU General Public License as published by  *
00010  *   the Free Software Foundation; either version 2 of the License, or     *
00011  *   (at your option) any later version.                                   *
00012  *                                                                         *
00013  *   This program is distributed in the hope that it will be useful,       *
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00016  *   GNU General Public License for more details.                          *
00017  *                                                                         *
00018  *   You should have received a copy of the GNU General Public License     *
00019  *   along with this program; if not, write to the Free Software           *
00020  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00021  *   MA  02111-1307  USA                                                   *
00022  ***************************************************************************/
00023 
00024 #ifndef __LS_DEVICE_H__
00025 #define __LS_DEVICE_H__
00026 
00027 namespace LinuxSampler {
00028 
00029     class AudioOutputDeviceFactory;
00030     class MidiInputDeviceFactory;
00031 
00035     class Device {
00036     public:
00049         virtual bool isAutonomousDevice();
00050 
00059         int deviceId() const;
00060 
00066         static bool isAutonomousDriver();
00067 
00068     protected:
00069         void setDeviceId(int id);
00070 
00071         //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
00072         friend class AudioOutputDeviceFactory;
00073         friend class MidiInputDeviceFactory;
00074     private:
00075         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
00076     };
00077 
00078 } // namespace LinuxSampler
00079 
00080 #endif // __LS_DEVICE_H__