diff --git a/plugins/SlicerT/SlicerT.cpp b/plugins/SlicerT/SlicerT.cpp index 5d82a6b7a2d..fc43af4ca21 100644 --- a/plugins/SlicerT/SlicerT.cpp +++ b/plugins/SlicerT/SlicerT.cpp @@ -588,7 +588,7 @@ void SlicerT::loadSettings(const QDomElement& element) m_noteThreshold.loadSettings(element, "threshold"); m_originalBPM.loadSettings(element, "origBPM"); - // create dinamic buffer + // create dynamic buffer float speedRatio = (float)m_originalBPM.value() / Engine::getSong()->getTempo(); m_phaseVocoder.loadSample( m_originalSample.data(), m_originalSample.frames(), m_originalSample.sampleRate(), speedRatio); diff --git a/plugins/SlicerT/SlicerT.h b/plugins/SlicerT/SlicerT.h index 46d9093a129..7543821bc60 100644 --- a/plugins/SlicerT/SlicerT.h +++ b/plugins/SlicerT/SlicerT.h @@ -99,14 +99,14 @@ class PhaseVocoder }; // simple helper class that handles the different audio channels -class dinamicPlaybackBuffer +class DynamicPlaybackBuffer { public: - dinamicPlaybackBuffer() + DynamicPlaybackBuffer() : m_leftChannel() , m_rightChannel() - { - } + {} + void loadSample(const sampleFrame* outData, int frames, int sampleRate, float newRatio) { std::vector leftData(frames, 0); @@ -119,6 +119,7 @@ class dinamicPlaybackBuffer m_leftChannel.loadData(leftData, sampleRate, newRatio); m_rightChannel.loadData(rightData, sampleRate, newRatio); } + void getFrames(sampleFrame* outData, int startFrame, int frames) { std::vector leftOut(frames, 0); // not a huge performance issue @@ -133,8 +134,10 @@ class dinamicPlaybackBuffer outData[i][1] = rightOut[i]; } } + int frames() { return m_leftChannel.frames(); } float scaleRatio() { return m_leftChannel.scaleRatio(); } + void setScaleRatio(float newRatio) { m_leftChannel.setScaleRatio(newRatio); @@ -180,7 +183,7 @@ public slots: // sample buffers SampleBuffer m_originalSample; - dinamicPlaybackBuffer m_phaseVocoder; + DynamicPlaybackBuffer m_phaseVocoder; std::vector m_slicePoints; diff --git a/plugins/SlicerT/SlicerTUI.cpp b/plugins/SlicerT/SlicerTUI.cpp index 0f5fe93a7ba..2f4a1dc0b9d 100644 --- a/plugins/SlicerT/SlicerTUI.cpp +++ b/plugins/SlicerT/SlicerTUI.cpp @@ -58,44 +58,44 @@ SlicerTUI::SlicerTUI(SlicerT* instrument, QWidget* parent) // render background QPalette pal; - pal.setBrush(backgroundRole(), PLUGIN_NAME::getIconPixmap("bg")); + pal.setBrush(backgroundRole(), PLUGIN_NAME::getIconPixmap("artwork")); setPalette(pal); // move editor and seeker m_wf.move(2, 6); // snap combo box - m_snapSetting.setGeometry(190, 200, 55, ComboBox::DEFAULT_HEIGHT); + m_snapSetting.setGeometry(185, 200, 55, ComboBox::DEFAULT_HEIGHT); m_snapSetting.setToolTip(tr("Set slice snapping for detection")); m_snapSetting.setModel(&m_slicerTParent->m_sliceSnap); // bpm spin box - m_bpmBox.move(135, 203); + m_bpmBox.move(130, 203); m_bpmBox.setToolTip(tr("Original sample BPM")); m_bpmBox.setLabel(tr("BPM")); m_bpmBox.setModel(&m_slicerTParent->m_originalBPM); // threshold knob - m_noteThresholdKnob.move(14, 195); + m_noteThresholdKnob.move(9, 195); m_noteThresholdKnob.setToolTip(tr("Threshold used for slicing")); m_noteThresholdKnob.setLabel(tr("Threshold")); m_noteThresholdKnob.setModel(&m_slicerTParent->m_noteThreshold); // fadeout knob - m_fadeOutKnob.move(80, 195); - m_fadeOutKnob.setToolTip(tr("FadeOut for notes")); - m_fadeOutKnob.setLabel(tr("FadeOut")); + m_fadeOutKnob.move(75, 195); + m_fadeOutKnob.setToolTip(tr("Fade Out for notes")); + m_fadeOutKnob.setLabel(tr("Fade Out")); m_fadeOutKnob.setModel(&m_slicerTParent->m_fadeOutFrames); // midi copy button - m_midiExportButton.move(205, 155); + m_midiExportButton.move(215, 150); m_midiExportButton.setActiveGraphic(PLUGIN_NAME::getIconPixmap("copyMidi")); m_midiExportButton.setInactiveGraphic(PLUGIN_NAME::getIconPixmap("copyMidi")); m_midiExportButton.setToolTip(tr("Copy midi pattern to clipboard")); connect(&m_midiExportButton, SIGNAL(clicked()), this, SLOT(exportMidi())); - // slcie reset button - m_resetButton.move(25, 155); + // slice reset button + m_resetButton.move(19, 150); m_resetButton.setActiveGraphic(PLUGIN_NAME::getIconPixmap("resetSlices")); m_resetButton.setInactiveGraphic(PLUGIN_NAME::getIconPixmap("resetSlices")); m_resetButton.setToolTip(tr("Reset Slices")); @@ -139,8 +139,14 @@ void SlicerTUI::dragEnterEvent(QDragEnterEvent* dee) { dee->acceptProposedAction(); } - else if (txt.section(':', 0, 0) == "samplefile") { dee->acceptProposedAction(); } - else { dee->ignore(); } + else if (txt.section(':', 0, 0) == "samplefile") + { + dee->acceptProposedAction(); + } + else + { + dee->ignore(); + } } else { dee->ignore(); } } @@ -151,10 +157,8 @@ void SlicerTUI::dropEvent(QDropEvent* de) QString value = StringPairDrag::decodeValue(de); if (type == "samplefile") { - m_slicerTParent->updateFile(value); - // castModel()->setAudioFile( value ); - // de->accept(); // set m_wf wave file + m_slicerTParent->updateFile(value); return; } else if (type == QString("clip_%1").arg(static_cast(Track::Type::Sample))) @@ -174,10 +178,10 @@ void SlicerTUI::paintEvent(QPaintEvent* pe) QPainter brush(this); brush.setPen(QColor(255, 255, 255)); brush.setFont(QFont(brush.font().family(), 7.5f, -1, false)); - brush.drawText(205, 170, 20, 20, Qt::AlignCenter, tr("Midi")); - brush.drawText(22, 170, 25, 20, Qt::AlignCenter, tr("Reset")); - brush.drawText(190, 217, 55, 20, Qt::AlignCenter, tr("Snap")); + brush.drawText(212, 165, 25, 20, Qt::AlignCenter, tr("Midi")); + brush.drawText(14, 165, 30, 20, Qt::AlignCenter, tr("Reset")); + brush.drawText(185, 217, 55, 20, Qt::AlignCenter, tr("Snap")); } } // namespace gui -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/plugins/SlicerT/SlicerTUI.h b/plugins/SlicerT/SlicerTUI.h index adcc1d0ef2b..4b914507049 100644 --- a/plugins/SlicerT/SlicerTUI.h +++ b/plugins/SlicerT/SlicerTUI.h @@ -48,8 +48,8 @@ class SlicerTKnob : public Knob SlicerTKnob(QWidget* _parent) : Knob(KnobType::Styled, _parent) { - setFixedSize(46, 40); - setCenterPointX(23.0); + setFixedSize(50, 40); + setCenterPointX(24.0); setCenterPointY(15.0); } }; @@ -87,4 +87,4 @@ protected slots: }; } // namespace gui } // namespace lmms -#endif // SLICERT_UI_H \ No newline at end of file +#endif // SLICERT_UI_H diff --git a/plugins/SlicerT/WaveForm.cpp b/plugins/SlicerT/WaveForm.cpp index 7073ab51839..c6f8ad72177 100644 --- a/plugins/SlicerT/WaveForm.cpp +++ b/plugins/SlicerT/WaveForm.cpp @@ -30,6 +30,7 @@ namespace lmms { namespace gui { + WaveForm::WaveForm(int w, int h, SlicerT* instrument, QWidget* parent) : QWidget(parent) , @@ -327,4 +328,4 @@ void WaveForm::paintEvent(QPaintEvent* pe) p.drawPixmap(0, m_seekerHeight + m_middleMargin, m_sliceEditor); } } // namespace gui -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/plugins/SlicerT/artwork.png b/plugins/SlicerT/artwork.png new file mode 100644 index 00000000000..76dfbc5c5cd Binary files /dev/null and b/plugins/SlicerT/artwork.png differ diff --git a/plugins/SlicerT/artwork.xcf b/plugins/SlicerT/artwork.xcf new file mode 100644 index 00000000000..63cd2e12f50 Binary files /dev/null and b/plugins/SlicerT/artwork.xcf differ diff --git a/plugins/SlicerT/bg.png b/plugins/SlicerT/bg.png deleted file mode 100644 index a9d1c82733c..00000000000 Binary files a/plugins/SlicerT/bg.png and /dev/null differ