1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
// recordingfeature.cpp
// Created 03/26/2010 by Tobias Rafreider
#include "library/recording/dlgrecording.h"
#include "track/track.h"
#include "library/treeitem.h"
#include "library/recording/recordingfeature.h"
#include "library/library.h"
#include "widget/wlibrary.h"
#include "controllers/keyboard/keyboardeventfilter.h"
#include "recording/recordingmanager.h"
namespace {
const QString kViewName = QStringLiteral("Recording");
} // anonymous namespace
RecordingFeature::RecordingFeature(Library* pLibrary,
UserSettingsPointer pConfig,
RecordingManager* pRecordingManager)
: LibraryFeature(pLibrary, pConfig),
m_pRecordingManager(pRecordingManager),
m_icon(":/images/library/ic_library_recordings.svg") {
}
QVariant RecordingFeature::title() {
return QVariant(tr("Recordings"));
}
QIcon RecordingFeature::getIcon() {
return m_icon;
}
TreeItemModel* RecordingFeature::getChildModel() {
return &m_childModel;
}
void RecordingFeature::bindLibraryWidget(WLibrary* pLibraryWidget,
KeyboardEventFilter *keyboard) {
//The view will be deleted by LibraryWidget
DlgRecording* pRecordingView = new DlgRecording(pLibraryWidget,
m_pConfig,
m_pLibrary,
m_pRecordingManager,
keyboard);
pRecordingView->installEventFilter(keyboard);
pLibraryWidget->registerView(kViewName, pRecordingView);
connect(pRecordingView,
&DlgRecording::loadTrack,
this,
&RecordingFeature::loadTrack);
connect(pRecordingView,
&DlgRecording::loadTrackToPlayer,
this,
&RecordingFeature::loadTrackToPlayer);
connect(this,
&RecordingFeature::refreshBrowseModel,
pRecordingView,
&DlgRecording::refreshBrowseModel);
connect(this,
&RecordingFeature::requestRestoreSearch,
pRecordingView,
&DlgRecording::slotRestoreSearch);
connect(pRecordingView,
&DlgRecording::restoreSearch,
this,
&RecordingFeature::restoreSearch);
}
void RecordingFeature::activate() {
emit refreshBrowseModel();
emit switchToView(kViewName);
// Ask the view to emit a restoreSearch signal.
emit requestRestoreSearch();
emit enableCoverArtDisplay(false);
}
|