Updated SWH plugins and added missing hermes_filter plugin
[lmms/mlankhorst.git] / include / mmp.h
blob55f289427e8df6b0b76f7601f4fa34e412bda501
1 /*
2 * mmp.h - class for reading and writing multimedia-project-files
4 * Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5 *
6 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
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 GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
26 #ifndef _MMP_H
27 #define _MMP_H
29 #include <QtXml/QDomDocument>
31 #include "export.h"
32 #include "lmms_basics.h"
35 class EXPORT multimediaProject : public QDomDocument
37 public:
38 enum ProjectTypes
40 UnknownType,
41 SongProject,
42 SongProjectTemplate,
43 InstrumentTrackSettings,
44 DragNDropData,
45 ClipboardData,
46 JournalData,
47 EffectSettings,
48 VideoProject, // might come later...
49 BurnProject, // might come later...
50 Playlist, // might come later...
51 NumProjectTypes
52 } ;
55 multimediaProject( const QString & _fileName );
56 multimediaProject( const QByteArray & _data );
57 multimediaProject( ProjectTypes _project_type );
58 virtual ~multimediaProject();
60 QString nameWithExtension( const QString & _fn ) const;
62 bool writeFile( const QString & _fn );
64 inline QDomElement & content()
66 return( m_content );
68 inline QDomElement & head()
70 return( m_head );
73 inline ProjectTypes type() const
75 return( m_type );
79 private:
80 static ProjectTypes type( const QString & _type_name );
81 static QString typeName( ProjectTypes _project_type );
83 void cleanMetaNodes( QDomElement _de );
85 void upgrade();
87 void loadData( const QByteArray & _data, const QString & _sourceFile );
90 struct EXPORT typeDescStruct
92 ProjectTypes m_type;
93 QString m_name;
94 } ;
95 static typeDescStruct s_types[NumProjectTypes];
97 QDomElement m_content;
98 QDomElement m_head;
99 ProjectTypes m_type;
104 const Uint8 MMP_MAJOR_VERSION = 1;
105 const Uint8 MMP_MINOR_VERSION = 0;
106 const QString MMP_VERSION_STRING = QString::number( MMP_MAJOR_VERSION ) + "." +
107 QString::number( MMP_MINOR_VERSION );
110 #endif