#include #include #include #include #include #include #include class Database { public: Database(wxInfoBar& infoBar); ~Database(); private: // ------------------------------------------------------------------- sqlite3* m_Database; int rc; char* m_ErrMsg; sqlite3_stmt* m_Stmt; private: // ------------------------------------------------------------------- wxInfoBar& m_InfoBar; public: // ------------------------------------------------------------------- // Insert into database void InsertSample(int favorite, std::string filename, std::string fileExtension, std::string samplePack, std::string type, int channels, int length, int sampleRate, int bitrate, std::string path, int trashed); // ------------------------------------------------------------------- // Update database void UpdateFavoriteColumn(std::string filename, int value); void UpdateFolder(std::string folderName); void UpdateFavoriteFolderDatabase(std::string filename, std::string folderName); void UpdateTrashColumn(std::string filename, int value); void UpdateSampleType(std::string filename, std::string type); // ------------------------------------------------------------------- // Get from database std::string GetSampleType(std::string filename); int GetFavoriteColumnValueByFilename(std::string filename); std::string GetSamplePathByFilename(std::string filename); std::string GetSampleFileExtension(std::string filename); // ------------------------------------------------------------------- // Check database bool HasSample(std::string filename); bool IsTrashed(std::string filename); // ------------------------------------------------------------------- // Remove from database void RemoveSampleFromDatabase(std::string filename); // ------------------------------------------------------------------- wxVector> LoadDatabase(wxVector> &vecSet, wxTreeCtrl& favorite_tree, wxTreeItemId& favorite_item, wxTreeCtrl& trash_tree, wxTreeItemId& trash_item, bool show_extension); wxVector> FilterDatabaseBySampleName(wxVector> &sampleVec, std::string sampleName); };