Commit a5dadaf4 authored by Sandro Andrade's avatar Sandro Andrade

Initial architecture refactoring

parent 8897c363
......@@ -20,11 +20,12 @@ include(ECMSetupVersion)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(GenerateExportHeader)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(FeatureSummary)
ecm_setup_version(${KDE_APPLICATIONS_VERSION} VARIABLE_PREFIX MINUET
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/minuet_version.h"
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/app/minuet_version.h"
)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets Quick)
......@@ -73,9 +74,16 @@ endif()
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
include_directories(${minuet_SOURCE_DIR}/src/ ${minuet_BINARY_DIR}/src)
add_subdirectory(doc)
add_subdirectory(src)
add_subdirectory(icons)
add_subdirectory(exercises)
install(FILES org.kde.minuet.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata/)
install(EXPORT MinuetTargets
DESTINATION "${KDE_INSTALL_CMAKEPACKAGEDIR}/Minuet"
NAMESPACE Minuet::
FILE MinuetTargets.cmake)
kde_enable_exceptions()
set(minuet_SRCS
main.cpp
song.cpp
wizard.cpp
minuet.cpp
midisequencer.cpp
midisequenceroutputthread.cpp
exercisecontroller.cpp
)
kconfig_add_kcfg_files(minuet_SRCS minuetsettings.kcfgc)
ki18n_wrap_ui(minuet_SRCS
settingsmidi.ui
wizardsystemcheck.ui
)
add_executable(minuet ${minuet_SRCS})
target_link_libraries(minuet
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Quick
KF5::I18n
KF5::XmlGui
KF5::KIOWidgets
KF5::Crash
asound
drumstick-alsa
drumstick-file
)
install(TARGETS minuet ${INSTALL_TARGETS_DEFAULT_ARGS})
install(DIRECTORY qml DESTINATION ${KDE_INSTALL_DATADIR}/minuet)
install(PROGRAMS org.kde.minuet.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES minuetui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/minuet)
add_subdirectory(interfaces)
add_subdirectory(shell)
add_subdirectory(app)
kde_enable_exceptions()
set(minuet_SRCS
main.cpp
song.cpp
wizard.cpp
minuet.cpp
midisequencer.cpp
midisequenceroutputthread.cpp
exercisecontroller.cpp
)
kconfig_add_kcfg_files(minuet_SRCS minuetsettings.kcfgc)
ki18n_wrap_ui(minuet_SRCS
settingsmidi.ui
wizardsystemcheck.ui
)
add_executable(minuet ${minuet_SRCS})
target_link_libraries(minuet
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Quick
KF5::I18n
KF5::XmlGui
KF5::KIOWidgets
KF5::Crash
asound
drumstick-alsa
drumstick-file
)
install(TARGETS minuet ${INSTALL_TARGETS_DEFAULT_ARGS})
install(DIRECTORY qml DESTINATION ${KDE_INSTALL_DATADIR}/minuet)
install(PROGRAMS org.kde.minuet.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES minuetui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/minuet)
set(minuetinterfaces_LIB_SRCS
icore.cpp
iplugin.cpp
iplugincontroller.cpp
imidibackend.cpp
iexercisecontroller.cpp
)
add_library(minuetinterfaces ${minuetinterfaces_LIB_SRCS})
add_library(Minuet::Interfaces ALIAS minuetinterfaces)
generate_export_header(minuetinterfaces EXPORT_FILE_NAME minuetinterfacesexport.h)
target_link_libraries(minuetinterfaces
Qt5::Core
)
get_target_property(VAR minuetinterfaces INCLUDE_DIRECTORIES)
MESSAGE(STATUS "TESTE" "${VAR}")
install(TARGETS
minuetinterfaces
EXPORT MinuetTargets
${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/minuetinterfacesexport.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR}/minuet/interfaces
COMPONENT Devel)
install(FILES
icore.h
iplugin.h
iplugincontroller.h
imidibackend.h
iexercisecontroller.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR}/minuet/interfaces
COMPONENT Devel
)
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program 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 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#include "icore.h"
namespace Minuet
{
ICore *ICore::m_self = 0;
ICore::~ICore()
{
m_self = 0;
}
ICore *ICore::self()
{
return m_self;
}
ICore::ICore(QObject *parent)
: QObject(parent)
{
Q_ASSERT(m_self == 0);
m_self = this;
}
}
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program 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 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#ifndef MINUET_ICORE_H
#define MINUET_ICORE_H
#include <QtCore/QObject>
#include "minuetinterfacesexport.h"
namespace Minuet
{
class IPluginController;
class IMidiBackend;
class IExerciseController;
class MINUETINTERFACES_EXPORT ICore : public QObject
{
Q_OBJECT
public:
~ICore() override;
static ICore *self();
virtual Minuet::IPluginController *pluginController() = 0;
virtual Minuet::IMidiBackend *midiBackend() = 0;
virtual Minuet::IExerciseController *exerciseController() = 0;
protected:
ICore(QObject *parent = 0);
static ICore *m_self;
};
}
#endif
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program 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 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#include "iexercisecontroller.h"
namespace Minuet
{
IExerciseController::IExerciseController(QObject *parent)
: QObject(parent)
{
}
IExerciseController::~IExerciseController()
{
}
}
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program 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 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#ifndef MINUET_IEXERCISECONTROLLER_H
#define MINUET_IEXERCISECONTROLLER_H
#include <QtCore/QObject>
#include "minuetinterfacesexport.h"
namespace Minuet
{
class MINUETINTERFACES_EXPORT IExerciseController : public QObject
{
Q_OBJECT
public:
IExerciseController(QObject *parent);
~IExerciseController() override;
};
}
#endif
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program 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 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#include "imidibackend.h"
namespace Minuet
{
IMidiBackend::IMidiBackend(QObject *parent)
: QObject(parent)
{
}
IMidiBackend::~IMidiBackend()
{
}
}
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program 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 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#ifndef MINUET_IMIDIBACKEND_H
#define MINUET_IMIDIBACKEND_H
#include <QtCore/QObject>
#include "minuetinterfacesexport.h"
namespace Minuet
{
class MINUETINTERFACES_EXPORT IMidiBackend : public QObject
{
Q_OBJECT
public:
IMidiBackend(QObject *parent);
~IMidiBackend() override;
};
}
#endif
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program 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 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#include "iplugin.h"
namespace Minuet
{
IPlugin::IPlugin(QObject *parent)
: QObject(parent)
{
}
IPlugin::~IPlugin()
{
}
}
#include "moc_iplugin.cpp"
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program 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 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#ifndef MINUET_IPLUGIN_H
#define MINUET_IPLUGIN_H
#include <QtCore/QObject>
#include "minuetinterfacesexport.h"
namespace Minuet
{
class MINUETINTERFACES_EXPORT IPlugin : public QObject
{
Q_OBJECT
public:
IPlugin(QObject *parent);
~IPlugin() override;
};
}
#endif
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program 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 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
**
****************************************************************************/
#include "iplugincontroller.h"
namespace Minuet
{
IPluginController::IPluginController(QObject *parent)
: QObject(parent)
{
}
IPluginController::~IPluginController()
{
}
}
/****************************************************************************
**
** Copyright (C) 2016 by Sandro S. Andrade <sandroandrade@kde.org>
**
** This program 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 2 of
** the License or (at your option) version 3 or any later version
** accepted by the membership of KDE e.V. (or its successor approved
** by the membership of KDE e.V.), which shall act as a proxy
** defined in Section 14 of version 3 of the license.
**
** This program 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