OSDN Git Service

If no item matches the current filter, hide all items and show an overlay message...
[lamexp/LameXP.git] / src / Model_FileList.h
index a3456b9..1f885eb 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2010 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -46,12 +46,44 @@ public:
        bool moveFile(const QModelIndex &index, int delta);
        AudioFileModel getFile(const QModelIndex &index);
        bool setFile(const QModelIndex &index, const AudioFileModel &audioFile);
+       AudioFileModel &operator[] (const QModelIndex &index);
+
+       //CSV export/import
+       int exportToCsv(const QString &outFile);
+       int importFromCsv(QWidget *parent, const QString &inFile);
+
+       //Public types
+       enum
+       {
+               CsvError_OK = 0,
+               CsvError_NoTags = 1,
+               CsvError_FileOpen = 2,
+               CsvError_FileRead = 3,
+               CsvError_FileWrite = 4,
+               CsvError_Incomplete = 5,
+               CsvError_Aborted = 6
+       }
+       CsvError;
+
+       //Speed hacks
+       void setBlockUpdates(bool flag)
+       {
+               m_blockUpdates = flag;
+               if(!flag) reset();
+       }
 
 public slots:
        void addFile(const QString &filePath);
        void addFile(const AudioFileModel &file);
 
+signals:
+       void rowAppended(void);
+
 private:
-       QList<AudioFileModel> m_fileList;
+       bool m_blockUpdates;
+       QList<QString> m_fileList;
+       QHash<QString, AudioFileModel> m_fileStore;
        const QIcon m_fileIcon;
+
+       static bool checkArray(const bool *a, const bool val, size_t len);
 };