Skip to content

Commit 3dcd8b9

Browse files
Add MIDIContentViewer
1 parent d023a04 commit 3dcd8b9

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include "MIDIContentViewer.h"
2+
3+
MIDIContentViewer::MIDIContentViewer() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#pragma once
2+
3+
#include <JuceHeader.h>
4+
5+
class MIDIContentViewer final : public juce::Component {
6+
public:
7+
MIDIContentViewer();
8+
9+
private:
10+
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MIDIContentViewer)
11+
};

src/ui/component/editor/MIDISourceEditor.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ MIDISourceEditor::MIDISourceEditor() {
9595
);
9696
this->addAndMakeVisible(this->piano.get());
9797

98+
/** Content */
99+
this->content = std::make_unique<MIDIContentViewer>();
100+
this->addAndMakeVisible(this->content.get());
101+
98102
/** Set Default V Pos */
99103
juce::MessageManager::callAsync([scroller = Scroller::SafePointer{ this->vScroller.get() }] {
100104
if (scroller) {
@@ -144,11 +148,11 @@ void MIDISourceEditor::resized() {
144148
pianoWidth, hScrollerRect.getY() - rulerRect.getBottom());
145149
this->piano->setBounds(pianoRect);
146150

147-
/** Track List */
148-
/*juce::Rectangle<int> listRect(
149-
0, vScrollerRect.getY(),
150-
vScrollerRect.getX(), vScrollerRect.getHeight());
151-
this->trackList->setBounds(listRect);*/
151+
/** Content */
152+
juce::Rectangle<int> contentRect(
153+
hScrollerRect.getX(), vScrollerRect.getY(),
154+
hScrollerRect.getWidth(), vScrollerRect.getHeight());
155+
this->content->setBounds(contentRect);
152156

153157
/** Update View Pos */
154158
this->hScroller->update();

src/ui/component/editor/MIDISourceEditor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <JuceHeader.h>
44
#include "PianoComponent.h"
55
#include "SourceTimeRuler.h"
6+
#include "MIDIContentViewer.h"
67
#include "../base/Scroller.h"
78

89
class MIDISourceEditor final : public juce::Component {
@@ -25,6 +26,7 @@ class MIDISourceEditor final : public juce::Component {
2526

2627
std::unique_ptr<SourceTimeRuler> ruler = nullptr;
2728
std::unique_ptr<PianoComponent> piano = nullptr;
29+
std::unique_ptr<MIDIContentViewer> content = nullptr;
2830

2931
bool viewMoving = false;
3032
double moveStartPosX = 0, moveStartPosY = 0;

0 commit comments

Comments
 (0)