File indexing completed on 2024-05-05 04:54:18

0001 /*
0002     SPDX-FileCopyrightText: 2017 Jean-Baptiste Mardelle
0003     SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 */
0005 
0006 #pragma once
0007 
0008 #include "assets/view/assetparameterview.hpp"
0009 #include "definitions.h"
0010 
0011 class QComboBox;
0012 class QToolButton;
0013 class TimecodeDisplay;
0014 class PositionWidget;
0015 class QHBoxLayout;
0016 
0017 class MixStackView : public AssetParameterView
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     MixStackView(QWidget *parent = nullptr);
0023     void setModel(const std::shared_ptr<AssetParameterModel> &model, QSize frameSize, bool addSpacer = false) override;
0024     void unsetModel();
0025     ObjectId stackOwner() const;
0026 
0027 Q_SIGNALS:
0028     void seekToTransPos(int pos);
0029 
0030 private Q_SLOTS:
0031     void durationChanged(const QModelIndex &, const QModelIndex &, const QVector<int> &roles);
0032     void updateDuration();
0033     void updatePosition();
0034     void slotAlignLeft();
0035     void slotAlignRight();
0036     void slotAlignCenter();
0037 
0038 private:
0039     // QHBoxLayout *m_positionLayout;
0040     PositionWidget *m_position;
0041     QHBoxLayout *m_durationLayout;
0042     TimecodeDisplay *m_duration;
0043     QToolButton *m_alignLeft;
0044     QToolButton *m_alignCenter;
0045     QToolButton *m_alignRight;
0046     MixAlignment alignment() const;
0047     void checkAlignment();
0048 };