예제 #1
0
void EffectsPanel::SetSequenceElements(SequenceElements *els) {
    int x = 0;
    RenderableEffect *p = effectManager->GetEffect(x);
    while (p != nullptr) {
        p->SetSequenceElements(els);
        x++;
        p = effectManager->GetEffect(x);
    }
}
예제 #2
0
void xLightsFrame::SetChoicebook(wxChoicebook* cb, const wxString& PageName)
{
    RenderableEffect *reff = effectManager.GetEffect(PageName.ToStdString());
    if (reff != nullptr) {
        for(size_t i=0; i<cb->GetPageCount(); i++)
        {
            if (cb->GetPageText(i) == reff->ToolTip())
            {
                cb->ChangeSelection(i);
                return;
            }
        }
    }
}
예제 #3
0
EffectsPanel::EffectsPanel(wxWindow *parent, EffectManager *manager) : effectManager(manager)
{
    //(*Initialize(EffectsPanel)
    wxFlexGridSizer* FlexGridSizer8;
    wxFlexGridSizer* FlexGridSizer6;
    wxFlexGridSizer* FlexGridSizer1;

    Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("wxID_ANY"));
    FlexGridSizer1 = new wxFlexGridSizer(0, 2, 0, 0);
    FlexGridSizer1->AddGrowableCol(0);
    EffectChoicebook = new wxChoicebook(this, ID_CHOICEBOOK1, wxDefaultPosition, wxDefaultSize, 0, _T("ID_CHOICEBOOK1"));
    FlexGridSizer1->Add(EffectChoicebook, 1, wxRIGHT|wxEXPAND, 2);
    FlexGridSizer8 = new wxFlexGridSizer(0, 1, 0, 0);
    FlexGridSizer6 = new wxFlexGridSizer(0, 2, 0, 0);
    BitmapButton_LayerEffect = new wxBitmapButton(this, ID_BITMAPBUTTON_CHOICEBOOK1, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON_CHOICEBOOK1"));
    BitmapButton_LayerEffect->SetDefault();
    FlexGridSizer6->Add(BitmapButton_LayerEffect, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1);
    BitmapButton_normal = new wxBitmapButton(this, ID_BITMAPBUTTON87, padlock16x16_green_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON87"));
    BitmapButton_normal->SetDefault();
    BitmapButton_normal->Hide();
    FlexGridSizer6->Add(BitmapButton_normal, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1);
    BitmapButton_locked = new wxBitmapButton(this, ID_BITMAPBUTTON1, padlock16x16_red_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON1"));
    BitmapButton_locked->SetDefault();
    BitmapButton_locked->Hide();
    FlexGridSizer6->Add(BitmapButton_locked, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1);
    BitmapButton_random = new wxBitmapButton(this, ID_BITMAPBUTTON88, padlock16x16_blue_xpm, wxDefaultPosition, wxSize(13,13), wxBU_AUTODRAW|wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON88"));
    BitmapButton_random->SetDefault();
    BitmapButton_random->Hide();
    FlexGridSizer6->Add(BitmapButton_random, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 1);
    FlexGridSizer8->Add(FlexGridSizer6, 1, wxALL|wxEXPAND, 1);
    FlexGridSizer1->Add(FlexGridSizer8, 1, wxEXPAND, 2);
    SetSizer(FlexGridSizer1);
    FlexGridSizer1->Fit(this);
    FlexGridSizer1->SetSizeHints(this);

    Connect(ID_CHOICEBOOK1,wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED,(wxObjectEventFunction)&EffectsPanel::EffectSelected);
    Connect(ID_BITMAPBUTTON_CHOICEBOOK1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&EffectsPanel::OnLockButtonClick);
    //*)

    this->SetName("Effect");


    for (auto it = effectManager->begin(); it != effectManager->end(); it++) {
        RenderableEffect *p = *it;
        wxScrolledWindow* sw = new wxScrolledWindow(EffectChoicebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxHSCROLL, _T("ID_PANEL" + p->Name()));
        wxPanel *panel = p->GetPanel(sw);
        wxFlexGridSizer *fgs = new wxFlexGridSizer(1, 1, 0, 0);
        fgs->AddGrowableCol(0);
        fgs->AddGrowableRow(0);
        fgs->Add(panel, 1, wxALL|wxEXPAND|wxALIGN_LEFT|wxALIGN_TOP, 2);

        sw->SetSizer(fgs);
        fgs->Fit(sw);
        fgs->SetSizeHints(sw);


        EffectChoicebook->AddPage(sw, p->ToolTip(), false);
    }
    EffectChoicebook->SetSelection(0);
    FlexGridSizer1->Fit(this);
    FlexGridSizer1->SetSizeHints(this);
}
예제 #4
0
void EffectsPanel::SetEffectPanelStatus(Model *cls, const wxString &name) {
    RenderableEffect *eff = effectManager->GetEffect(name.ToStdString());
    if (eff != nullptr) {
        eff->SetPanelStatus(cls);
	}
}
예제 #5
0
void EffectsPanel::SetDefaultEffectValues(Model *cls, AudioManager* audio, const wxString &name) {
    RenderableEffect *eff = effectManager->GetEffect(name.ToStdString());
    if (eff != nullptr) {
        eff->SetDefaultParameters(cls);
	}
}