/*
 * Copyright (C) 2026 Linux Studio Plugins Project <https://lsp-plug.in/>
 *           (C) 2026 Vladimir Sadovnikov <sadko4u@gmail.com>
 *
 * This file is part of lsp-plugins-trigger
 * Created on: 18 февр. 2024 г.
 *
 * lsp-plugins-trigger is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * lsp-plugins-trigger is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with lsp-plugins-trigger. If not, see <https://www.gnu.org/licenses/>.
 */

#ifndef PRIVATE_UI_TRIGGER_H_
#define PRIVATE_UI_TRIGGER_H_

#include <lsp-plug.in/plug-fw/ui.h>
#include <lsp-plug.in/fmt/Hydrogen.h>

namespace lsp
{
    namespace plugui
    {
        class trigger: public ui::Module
        {
            protected:
                ui::IPort                  *pCurrentSample;         // Current sample
                ui::IPort                  *pRevealSampleOnListen;  // Reveal sample on listen option
                tk::Button                 *wSampleListen[meta::trigger_metadata::SAMPLE_FILES];    // Listen buttons for files
                tk::Button                 *wSampleStop[meta::trigger_metadata::SAMPLE_FILES];      // Stop buttons for files

            protected:
                static status_t     slot_submit_listen_sample(tk::Widget *sender, void *ptr, void *data);
                static status_t     slot_submit_stop_sample(tk::Widget *sender, void *ptr, void *data);

            protected:
                status_t            show_sample(size_t index);

            public:
                explicit trigger(const meta::plugin_t *meta);
                trigger(const trigger &) = delete;
                trigger(trigger &&) = delete;
                virtual ~trigger() override;

                trigger & operator = (const trigger &) = delete;
                trigger & operator = (trigger &&) = delete;

            public:
                virtual status_t    init(ui::IWrapper *wrapper) override;
                virtual status_t    post_init() override;
        };
    } /* namespace plugui */
} /* namespace lsp */



#endif /* PRIVATE_UI_TRIGGER_H_ */
