--- linuxsampler/trunk/src/engines/InstrumentManager.h 2007/09/04 01:12:49 1321 +++ linuxsampler/trunk/src/engines/InstrumentManager.h 2009/03/01 16:33:22 1850 @@ -3,7 +3,7 @@ * LinuxSampler - modular, streaming capable sampler * * * * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * - * Copyright (C) 2005 - 2007 Christian Schoenebeck * + * Copyright (C) 2005 - 2009 Christian Schoenebeck * * * * This library is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -70,6 +70,22 @@ bool operator<(const instrument_id_t& o) const { return (Index < o.Index || (Index == o.Index && FileName < o.FileName)); } + + bool operator==(const instrument_id_t& o) const { + return (Index == o.Index && FileName == o.FileName); + } + }; + + /** + * Rather abstract informations about an instrument. + */ + struct instrument_info_t { + String InstrumentName; + String FormatVersion; + String Product; + String Artists; + uint8_t KeyBindings[128]; + uint8_t KeySwitchBindings[128]; }; /** @@ -113,6 +129,12 @@ static void LoadInstrumentInBackground(instrument_id_t ID, EngineChannel* pEngineChannel); /** + * Stops the background thread that has been started by + * LoadInstrumentInBackground. + */ + static void StopBackgroundThread(); + + /** * Returns the name of the given instrument as reflected by its * file. * @@ -157,6 +179,23 @@ * instrument editor is registered to the sampler */ virtual void LaunchInstrumentEditor(instrument_id_t ID) throw (InstrumentManagerException) = 0; + + /** + * Returns a list of instrument IDs of the provided instrument + * file in case the provided file's format is supported. + * + * @throws InstrumentManagerException if the format of the + * provided instrument file is not supported + */ + virtual std::vector GetInstrumentFileContent(String File) throw (InstrumentManagerException) = 0; + + /** + * Get detailed informations about the provided instrument file. + * + * @throws InstrumentManagerException if the format of the + * provided instrument file is not supported + */ + virtual instrument_info_t GetInstrumentInfo(instrument_id_t ID) throw (InstrumentManagerException) = 0; }; }