00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef RESOURCESWIDGET_H
00023 #define RESOURCESWIDGET_H
00024
00025 #include <QWidget>
00026 #include <QTreeWidgetItem>
00027 #include "ui_ResourcesWidget.h"
00028
00029 class Project;
00030 class Sheet;
00031 class AudioClip;
00032 class ReadSource;
00033 class SourceTreeItem;
00034 class QShowEvent;
00035 class QListView;
00036 class QDirModel;
00037 class QComboBox;
00038
00039 class FileWidget : public QWidget
00040 {
00041 Q_OBJECT
00042 public:
00043
00044 FileWidget(QWidget* parent=0) : QWidget(parent) {
00045 m_dirModel = 0;
00046 }
00047
00048 void showEvent ( QShowEvent * event );
00049 void set_current_path(const QString& path) const;
00050
00051 private slots:
00052 void dirview_item_clicked(const QModelIndex & index);
00053 void dir_up_button_clicked();
00054 void refresh_button_clicked();
00055 void box_actived(int i);
00056
00057 private:
00058 QListView* m_dirView;
00059 QDirModel* m_dirModel;
00060 QComboBox* m_box;
00061 };
00062
00063
00064 class ClipTreeItem : public QObject, public QTreeWidgetItem
00065 {
00066 Q_OBJECT
00067
00068 public:
00069 ClipTreeItem(SourceTreeItem* parent, AudioClip* clip);
00070
00071 void apply_filter(Sheet* sheet);
00072
00073
00074 public slots:
00075 void clip_state_changed();
00076
00077 private:
00078 AudioClip* m_clip;
00079 };
00080
00081 class SourceTreeItem : public QObject, public QTreeWidgetItem
00082 {
00083 Q_OBJECT
00084
00085 public:
00086 SourceTreeItem(QTreeWidget* parent, ReadSource* source);
00087
00088 void apply_filter(Sheet* sheet);
00089
00090 private:
00091 ReadSource* m_source;
00092
00093 public slots:
00094 void source_state_changed();
00095 };
00096
00097 class ResourcesWidget : public QWidget, protected Ui::ResourcesWidget
00098 {
00099 Q_OBJECT
00100
00101 public:
00102 ResourcesWidget(QWidget* parent=0);
00103 ~ResourcesWidget();
00104
00105 protected:
00106 void showEvent( QShowEvent * event );
00107 void resizeEvent( QResizeEvent * e );
00108
00109 private:
00110 Project* m_project;
00111 Sheet* m_currentSheet;
00112 FileWidget* m_filewidget;
00113 QHash<qint64, ClipTreeItem*> m_clipindices;
00114 QHash<qint64, SourceTreeItem*> m_sourceindices;
00115
00116 void update_clip_state(AudioClip* clip);
00117 void update_source_state(qint64 id);
00118
00119 void filter_on_current_sheet();
00120
00121 private slots:
00122 void set_project(Project* project);
00123 void project_load_finished();
00124
00125 void view_combo_box_index_changed(int index);
00126 void sheet_combo_box_index_changed(int index);
00127
00128 void sheet_added(Sheet* sheet);
00129 void sheet_removed(Sheet* sheet);
00130 void set_current_sheet(Sheet* sheet);
00131
00132 void add_clip(AudioClip* clip);
00133 void remove_clip(AudioClip* clip);
00134 void add_source(ReadSource* source);
00135 void remove_source(ReadSource* source);
00136 };
00137
00138
00139 #endif