diff options
Diffstat (limited to 'src/project.h')
-rw-r--r-- | src/project.h | 74 |
1 files changed, 67 insertions, 7 deletions
diff --git a/src/project.h b/src/project.h index 98be92a..b0f9060 100644 --- a/src/project.h +++ b/src/project.h @@ -35,6 +35,35 @@ #include "selection.h" class Project; +class Instrument; + +class AudioFile +{ +public: + AudioFile(Instrument& instrument, int id); + + int getId() const; + + QString getFile() const; + void setFile(const QString& file); + QString getAbsoluteFile() const; + + QString getName() const; + void setName(const QString& name); + + int getChannelMapId() const; + void setChannelMapId(int id); + +private: + friend class ProjectSerialiser; + + QString file; + QString name; + int channel_map_id; + + int id; + Instrument& instrument; +}; class Instrument { @@ -49,8 +78,10 @@ public: QString getMasterFile() const; void setMasterFile(const QString& master_file); - AudioFileList getFileList() const; - void setFileList(const AudioFileList& file_list); + AudioFile& getAudioFile(int id); + int createAudioFile(); + void deleteAudioFile(int id); + QList<int> getAudioFileList() const; std::size_t getAttackLength() const; void setAttackLength(std::size_t attack_length); @@ -76,9 +107,6 @@ public: QString getPrefix() const; void setPrefix(const QString& prefix); - QString getExportPath() const; - void setExportPath(const QString& prefix); - Project& getProject(); private: @@ -89,7 +117,7 @@ private: // Files tab QString master_file; - AudioFileList file_list; + std::list<AudioFile> audio_files; // Generate tab std::size_t attack_length{300}; @@ -106,7 +134,28 @@ private: // Export tab QString prefix; - QString export_path; + + Project& project; +}; + +class Channel +{ +public: + Channel(Project& project, int id); + + int getId() const; + + QString getChannelName() const; + void setChannelName(const QString& channel_name); + + Project& getProject(); + +private: + friend class ProjectSerialiser; + + int id; + + QString channel_name; Project& project; }; @@ -145,11 +194,19 @@ public: QString getRawFileRoot() const; void setRawFileRoot(const QString& raw_file_root); + QString getExportPath() const; + void setExportPath(const QString& prefix); + Instrument& getInstrument(int id); int createInstrument(); void deleteInstrument(int id); QList<int> getInstrumentList() const; + Channel& getChannel(int id); + int createChannel(); + void deleteChannel(int id); + QList<int> getChannelList() const; + void reset(); signals: @@ -157,12 +214,15 @@ signals: private: friend class ProjectSerialiser; + friend class Instrument; QString project_file; QString project_name; QString raw_file_root; + QString export_path; std::list<Instrument> instruments; + std::list<Channel> channels; int next_id{0}; int update_count{0}; |