00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef PROJECT_H
00023 #define PROJECT_H
00024
00025 #include <QString>
00026 #include <QList>
00027 #include <QDomNode>
00028 #include "ContextItem.h"
00029
00030
00031 class Sheet;
00032 class ResourcesManager;
00033 struct ExportSpecification;
00034 class ExportThread;
00035
00036 class Project : public ContextItem
00037 {
00038 Q_OBJECT
00039
00040 public :
00041 ~Project();
00042
00043
00044
00045 int get_current_sheet_id() const;
00046 int get_num_sheets() const;
00047 int get_rate() const;
00048 int get_bitdepth() const;
00049
00050 ResourcesManager* get_audiosource_manager() const;
00051 QString get_title() const;
00052 QString get_engineer() const;
00053 QString get_description() const;
00054 QString get_discid() const;
00055 QString get_performer() const;
00056 QString get_arranger() const;
00057 QString get_songwriter() const;
00058 QString get_message() const;
00059 QString get_upc_ean() const;
00060 int get_genre();
00061 QString get_root_dir() const;
00062 QString get_audiosources_dir() const;
00063 QString get_import_dir() const;
00064 QString get_error_string() const {return m_errorString;}
00065 QList<Sheet* > get_sheets() const;
00066 Sheet* get_current_sheet() const ;
00067 Sheet* get_sheet(qint64 id) const;
00068 int get_sheet_index(qint64 id) const;
00069 QDomNode get_state(QDomDocument doc, bool istemplate=false);
00070
00071
00072
00073 void set_title(const QString& title);
00074 void set_engineer(const QString& pEngineer);
00075 void set_description(const QString& des);
00076 void set_discid(const QString& pId);
00077 void set_performer(const QString& pPerformer);
00078 void set_arranger(const QString& pArranger);
00079 void set_songwriter(const QString& sw);
00080 void set_message(const QString& pMessage);
00081 void set_upc_ean(const QString& pUPC);
00082 void set_genre(int pGenre);
00083 void set_sheet_export_progress(int pogress);
00084 void set_current_sheet(qint64 id);
00085 void set_import_dir(const QString& dir);
00086
00087
00088 Command* add_sheet(Sheet* sheet, bool historable=true);
00089 Command* remove_sheet(Sheet* sheet, bool historable=true);
00090
00091 bool has_changed();
00092 bool is_save_to_close() const;
00093 bool is_recording() const;
00094
00095 int save(bool autosave=false);
00096 int load(QString projectfile = "");
00097 int export_project(ExportSpecification* spec);
00098 int start_export(ExportSpecification* spec);
00099 int create_cdrdao_toc(ExportSpecification* spec);
00100
00101 enum {
00102 SETTING_XML_CONTENT_FAILED = -1,
00103 PROJECT_FILE_COULD_NOT_BE_OPENED = -2,
00104 PROJECT_FILE_VERSION_MISMATCH = -3
00105 };
00106
00107
00108 public slots:
00109 Command* select();
00110
00111 private:
00112 Project(const QString& title);
00113
00114 QList<Sheet* > m_sheets;
00115 ResourcesManager* m_resourcesManager;
00116 ExportThread* m_exportThread;
00117
00118 QString m_title;
00119 QString m_rootDir;
00120 QString m_sourcesDir;
00121 QString engineer;
00122 QString m_description;
00123 QString m_importDir;
00124 QString m_discid;
00125 int m_genre;
00126 QString m_upcEan;
00127 QString m_performer;
00128 QString m_arranger;
00129 QString m_songwriter;
00130 QString m_message;
00131 QString m_errorString;
00132
00133 int m_rate;
00134 int m_bitDepth;
00135 bool m_useResampling;
00136
00137 int overallExportProgress;
00138 int renderedSheets;
00139 QList<Sheet* > sheetsToRender;
00140
00141 qint64 m_currentSheetId;
00142
00143 int create(int sheetcount, int numtracks);
00144 int create_audiosources_dir();
00145 int create_peakfiles_dir();
00146
00147 friend class ProjectManager;
00148
00149 private slots:
00150 void private_add_sheet(Sheet* sheet);
00151 void private_remove_sheet(Sheet* sheet);
00152
00153 signals:
00154 void currentSheetChanged(Sheet* );
00155 void sheetAdded(Sheet*);
00156 void sheetRemoved(Sheet*);
00157 void sheetExportProgressChanged(int );
00158 void overallExportProgressChanged(int );
00159 void exportFinished();
00160 void exportStartedForSheet(Sheet* );
00161 void projectLoadFinished();
00162 };
00163
00164 #endif