Skip to content

Commit

Permalink
- CDrumCell from Multi
Browse files Browse the repository at this point in the history
  • Loading branch information
psemiletov committed Sep 25, 2024
1 parent c358556 commit 4360502
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 3 deletions.
39 changes: 38 additions & 1 deletion Source/PluginEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ CDrumCell::CDrumCell()
cell_label.setFont (f_samplename_font);
cell_label.setText ("EMPTY CELL", juce::dontSendNotification);

//cell_label.cell = this;
//cell_label.cell = this; //for CDrumCell

xoffs += cell_label.getWidth();
xoffs += XFILLER;
Expand Down Expand Up @@ -1538,6 +1538,7 @@ bool CCellLabel::isInterestedInFileDrag (const StringArray &files)
};


/*
void CCellLabel::filesDropped (const StringArray &files, int x, int y)
{
if (! editor)
Expand All @@ -1558,6 +1559,42 @@ void CCellLabel::filesDropped (const StringArray &files, int x, int y)
cell->set_name (s->name);
setColour (juce::Label::backgroundColourId, juce::Colour (180, 209, 220));
};
*/

void CCellLabel::filesDropped (const StringArray &files, int x, int y)
{
if (! editor)
return;

std::string fname = files[0].toStdString();

cell->editor->tmr_leds.stopTimer();
cell->editor->audioProcessor.suspendProcessing (true);


cell->editor->need_to_update_cells = false; //чтобы кит не подгрузился по таймеру

if (! editor->audioProcessor.drumkit)
editor->audioProcessor.drumkit = new CDrumKit();

cell->editor->audioProcessor.drumkit->kit_type = KIT_TYPE_QDRUMLABOOH;

cell->editor->audioProcessor.drumkit->kit_name = cell->editor->l_kit_name.getText().toStdString();

// std::cout << "cell_number: " << cell_number << std::endl;

CDrumSample *s = cell->editor->audioProcessor.drumkit->load_sample_to_index (cell->cell_number,
fname,
cell->editor->audioProcessor.session_samplerate);

cell->editor->audioProcessor.drumkit->loaded = true; //типа кит целиком загружен

setText (s->name, juce::dontSendNotification);
cell->set_name (s->name);
setColour (juce::Label::backgroundColourId, juce::Colour (180, 209, 220));

cell->editor->audioProcessor.suspendProcessing (false);
}


void CAudioProcessorEditor::save_quick_kit()
Expand Down
6 changes: 4 additions & 2 deletions Source/PluginEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class CDrumCell: public juce::Component/*,

juce::Button *bt_fx_close;

//CCellLabel cell_label;
// CCellLabel cell_label;

Label cell_label;

Expand Down Expand Up @@ -183,6 +183,7 @@ class CDrumCell: public juce::Component/*,
juce::GroupComponent gr_group;



CAudioProcessorEditor *editor = 0; //uplink

CLed led;
Expand All @@ -192,7 +193,8 @@ class CDrumCell: public juce::Component/*,
CFx fx;


CCellLabel cell_label;
//CCellLabel cell_label;
Label cell_label;

size_t cell_number;

Expand Down

0 comments on commit 4360502

Please sign in to comment.