![]() |
Mixxx
|
00001 // recordingfeature.cpp 00002 // Created 03/26/2010 by Tobias Rafreider 00003 00004 #include <QStringList> 00005 #include <QTreeView> 00006 #include <QDirModel> 00007 #include <QStringList> 00008 #include <QFileInfo> 00009 #include <QDesktopServices> 00010 00011 #include "trackinfoobject.h" 00012 #include "library/treeitem.h" 00013 #include "library/recording/recordingfeature.h" 00014 #include "library/trackcollection.h" 00015 #include "library/dao/trackdao.h" 00016 #include "widget/wlibrary.h" 00017 #include "widget/wlibrarysidebar.h" 00018 #include "mixxxkeyboard.h" 00019 00020 const QString RecordingFeature::m_sRecordingViewName = QString("Recording"); 00021 00022 RecordingFeature::RecordingFeature(QObject* parent, ConfigObject<ConfigValue>* pConfig, 00023 TrackCollection* pTrackCollection, 00024 RecordingManager* pRecordingManager) 00025 : LibraryFeature(parent), 00026 m_pConfig(pConfig), m_pRecordingView(0), 00027 m_pTrackCollection(pTrackCollection), 00028 m_pRecordingManager(pRecordingManager){ 00029 00030 } 00031 00032 RecordingFeature::~RecordingFeature() { 00033 00034 } 00035 00036 QVariant RecordingFeature::title() { 00037 return QVariant(tr("Recordings")); 00038 } 00039 00040 QIcon RecordingFeature::getIcon() { 00041 return QIcon(":/images/library/ic_library_recordings.png"); 00042 } 00043 00044 TreeItemModel* RecordingFeature::getChildModel() { 00045 return &m_childModel; 00046 } 00047 void RecordingFeature::bindWidget(WLibrarySidebar *sidebarWidget, 00048 WLibrary *libraryWidget, 00049 MixxxKeyboard *keyboard) 00050 { 00051 //The view will be deleted by LibraryWidget 00052 m_pRecordingView = new DlgRecording(libraryWidget, 00053 m_pConfig, 00054 m_pTrackCollection, 00055 m_pRecordingManager, 00056 keyboard); 00057 00058 m_pRecordingView->installEventFilter(keyboard); 00059 libraryWidget->registerView(m_sRecordingViewName, m_pRecordingView); 00060 connect(m_pRecordingView, SIGNAL(loadTrack(TrackPointer)), 00061 this, SIGNAL(loadTrack(TrackPointer))); 00062 connect(m_pRecordingView, SIGNAL(loadTrackToPlayer(TrackPointer, QString)), 00063 this, SIGNAL(loadTrackToPlayer(TrackPointer, QString))); 00064 } 00065 00066 bool RecordingFeature::dropAccept(QUrl url) { 00067 return false; 00068 } 00069 00070 bool RecordingFeature::dropAcceptChild(const QModelIndex& index, QUrl url) { 00071 return false; 00072 } 00073 00074 bool RecordingFeature::dragMoveAccept(QUrl url) { 00075 return false; 00076 } 00077 00078 bool RecordingFeature::dragMoveAcceptChild(const QModelIndex& index, QUrl url) { 00079 return false; 00080 } 00081 00082 void RecordingFeature::activate() { 00083 m_pRecordingView->refreshBrowseModel(); 00084 emit(switchToView("Recording")); 00085 } 00086 00087 void RecordingFeature::activateChild(const QModelIndex& index) { 00088 00089 } 00090 00091 void RecordingFeature::onRightClick(const QPoint& globalPos) { 00092 } 00093 00094 void RecordingFeature::onRightClickChild(const QPoint& globalPos, QModelIndex index) { 00095 } 00096 void RecordingFeature::onLazyChildExpandation(const QModelIndex &index){ 00097 //Nothing to do here since we have no child models 00098 }