13
0
livetrax/gtk2_ardour/midi_patch_manager.h
Hans Baier a9bb336fc4 * first primitive implementation of MidiPatchManager
* some cosmetic changes
* added midi_patch_path() to libs/ardour/ardour/session_directory.h


git-svn-id: svn://localhost/ardour2/branches/3.0@4299 d708f5d6-7413-0410-9779-e7cbd77b26cf
2008-12-08 09:50:19 +00:00

72 lines
1.6 KiB
C++

/*
Copyright (C) 2008 Hans Baier
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id$
*/
#ifndef MIDI_PATCH_MANAGER_H_
#define MIDI_PATCH_MANAGER_H_
#include "midi++/midnam_patch.h"
namespace ARDOUR {
class Session;
}
namespace MIDI
{
namespace Name
{
class MidiPatchManager
{
/// Singleton
private:
MidiPatchManager() {};
MidiPatchManager( const MidiPatchManager& );
MidiPatchManager& operator= (const MidiPatchManager&);
static MidiPatchManager* _manager;
public:
typedef std::list<boost::shared_ptr<MIDINameDocument> > MidiNameDocuments;
virtual ~MidiPatchManager() { _manager = 0; }
static MidiPatchManager& instance() {
if (_manager == 0) {
_manager = new MidiPatchManager();
}
return *_manager;
}
void set_session (ARDOUR::Session&);
private:
void drop_session();
void refresh();
ARDOUR::Session* _session;
MidiNameDocuments _documents;
};
} // namespace Name
} // namespace MIDI
#endif /* MIDI_PATCH_MANAGER_H_ */