1
0

OBSRemux.hpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /******************************************************************************
  2. Copyright (C) 2014 by Ruwen Hahn <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include "ui_OBSRemux.h"
  16. #include <QPointer>
  17. #include <QThread>
  18. class RemuxQueueModel;
  19. class RemuxWorker;
  20. class OBSRemux : public QDialog {
  21. Q_OBJECT
  22. QPointer<RemuxQueueModel> queueModel;
  23. QThread remuxer;
  24. QPointer<RemuxWorker> worker;
  25. std::unique_ptr<Ui::OBSRemux> ui;
  26. const char *recPath;
  27. virtual void closeEvent(QCloseEvent *event) override;
  28. virtual void reject() override;
  29. bool autoRemux;
  30. QString autoRemuxFile;
  31. public:
  32. explicit OBSRemux(const char *recPath, QWidget *parent = nullptr, bool autoRemux = false);
  33. virtual ~OBSRemux() override;
  34. using job_t = std::shared_ptr<struct media_remux_job>;
  35. void AutoRemux(QString inFile, QString outFile);
  36. protected:
  37. virtual void dropEvent(QDropEvent *ev) override;
  38. virtual void dragEnterEvent(QDragEnterEvent *ev) override;
  39. void remuxNextEntry();
  40. private slots:
  41. void rowCountChanged(const QModelIndex &parent, int first, int last);
  42. public slots:
  43. void updateProgress(float percent);
  44. void remuxFinished(bool success);
  45. void beginRemux();
  46. bool stopRemux();
  47. void clearFinished();
  48. void clearAll();
  49. signals:
  50. void remux(const QString &source, const QString &target);
  51. };