1 2 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 3 4 /* 5 Rosegarden 6 A MIDI and audio sequencer and musical notation editor. 7 Copyright 2000-2021 the Rosegarden development team. 8 9 Other copyrights also apply to some parts of this work. Please 10 see the AUTHORS file and individual file headers for details. 11 12 This program is free software; you can redistribute it and/or 13 modify it under the terms of the GNU General Public License as 14 published by the Free Software Foundation; either version 2 of the 15 License, or (at your option) any later version. See the file 16 COPYING included with this distribution for more information. 17 */ 18 19 #ifndef RG_NOTESTYLEFACTORY_H 20 #define RG_NOTESTYLEFACTORY_H 21 22 23 #include "NoteStyle.h" 24 #include "base/Exception.h" 25 26 #include <QSharedPointer> 27 28 #include <map> 29 #include <vector> 30 31 namespace Rosegarden 32 { 33 34 class NoteStyle; 35 class Event; 36 37 class NoteStyleFactory 38 { 39 public: 40 static std::vector<NoteStyleName> getAvailableStyleNames(); 41 static const NoteStyleName DefaultStyle; 42 43 static QSharedPointer<NoteStyle> getStyle(NoteStyleName name); 44 static QSharedPointer<NoteStyle> getStyleForEvent(Event *event); 45 46 typedef Exception StyleUnavailable; 47 48 private: 49 typedef std::map<QString, QSharedPointer<NoteStyle> > StyleMap; 50 static StyleMap m_styles; 51 }; 52 53 54 55 } 56 57 #endif 58