diff --git a/mediafx/CMakeLists.txt b/mediafx/CMakeLists.txt index e01f00e..a9934e4 100644 --- a/mediafx/CMakeLists.txt +++ b/mediafx/CMakeLists.txt @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License along with mediaFX. # If not, see . -find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia Qml Quick Quick3D) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Multimedia Qml Quick Quick3D QUIET OPTIONAL_COMPONENTS WebEngineQuick) qt_policy(SET QTP0001 NEW) @@ -23,6 +23,7 @@ qt_add_executable(mediafx mediafx.cpp render_control.cpp clip.cpp + audio_clip.cpp visual_clip.cpp video_clip.cpp image_clip.cpp @@ -34,4 +35,9 @@ qt_add_qml_module(mediafx target_link_libraries(mediafx PRIVATE Qt6::Core Qt6::Gui Qt6::GuiPrivate Qt6::Multimedia Qt6::Qml Qt6::Quick Qt6::Quick3D) +if(${Qt6WebEngineQuick_FOUND}) + target_link_libraries(mediafx PRIVATE Qt6::WebEngineQuick) + add_definitions(-DWEBENGINEQUICK) +endif() + install(TARGETS mediafx RUNTIME DESTINATION) diff --git a/mediafx/audio_clip.cpp b/mediafx/audio_clip.cpp new file mode 100644 index 0000000..8b3785c --- /dev/null +++ b/mediafx/audio_clip.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2023 Andrew Wason + * + * This file is part of mediaFX. + * + * mediaFX is free software: you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * mediaFX 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with mediaFX. + * If not, see . + */ + +#include "audio_clip.h" +#include + +bool AudioClip::active() +{ + // XXX + return false; +} + +void AudioClip::setActive(bool active) +{ + Clip::setActive(active); + // XXX +} + +bool AudioClip::renderClip(const QMediaTimeRange::Interval& globalTime) +{ + // XXX + return true; +} + +void AudioClip::stop() +{ + Clip::stop(); + // XXX +} \ No newline at end of file diff --git a/mediafx/audio_clip.h b/mediafx/audio_clip.h new file mode 100644 index 0000000..9b31722 --- /dev/null +++ b/mediafx/audio_clip.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 Andrew Wason + * + * This file is part of mediaFX. + * + * mediaFX is free software: you can redistribute it and/or modify it under the + * terms of the GNU General Public License as published by the Free Software Foundation, + * either version 3 of the License, or (at your option) any later version. + * + * mediaFX 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with mediaFX. + * If not, see . + */ + +#pragma once + +#include "clip.h" +#include +#include + +class AudioClip : public Clip { + Q_OBJECT + QML_ELEMENT + +public: + using Clip::Clip; + +protected: + void setActive(bool active) override; + bool active() override; + + bool renderClip(const QMediaTimeRange::Interval& globalTime) override; + + virtual void stop() override; + +private: +}; diff --git a/mediafx/main.cpp b/mediafx/main.cpp index b1a3759..8295096 100644 --- a/mediafx/main.cpp +++ b/mediafx/main.cpp @@ -25,6 +25,9 @@ #include #include #include +#ifdef WEBENGINEQUICK +#include +#endif int main(int argc, char* argv[]) { @@ -33,6 +36,15 @@ int main(int argc, char* argv[]) const_cast("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM=1")); #endif +#ifdef WEBENGINEQUICK +#if !defined(QT_NO_OPENGL) + // https://doc.qt.io/qt-6/qml-qtwebengine-webengineview.html#rendering-to-opengl-surface + // https://doc.qt.io/qt-6/qtwebengine-overview.html#embedding-web-content-into-qt-quick-applications + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); +#endif + QtWebEngineQuick::initialize(); +#endif + QGuiApplication app(argc, argv); app.setOrganizationDomain("mediafx.stream");