Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Minuet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Education
Minuet
Commits
11ba8dcf
Commit
11ba8dcf
authored
Jun 21, 2016
by
Sandro Andrade
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial plugincontroller implementation and sample plugin
parent
3c74566b
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
162 additions
and
15 deletions
+162
-15
CMakeLists.txt
CMakeLists.txt
+1
-0
src/CMakeLists.txt
src/CMakeLists.txt
+1
-0
src/app/exercisecontroller.cpp
src/app/exercisecontroller.cpp
+1
-1
src/app/main.cpp
src/app/main.cpp
+2
-2
src/app/midisequencer.cpp
src/app/midisequencer.cpp
+2
-2
src/app/minuetmainwindow.cpp
src/app/minuetmainwindow.cpp
+3
-3
src/app/minuetmainwindow.h
src/app/minuetmainwindow.h
+2
-2
src/app/wizard.cpp
src/app/wizard.cpp
+1
-1
src/interfaces/iexercisecontroller.h
src/interfaces/iexercisecontroller.h
+1
-1
src/interfaces/iplugin.h
src/interfaces/iplugin.h
+3
-1
src/interfaces/iplugincontroller.h
src/interfaces/iplugincontroller.h
+1
-1
src/interfaces/isoundbackend.h
src/interfaces/isoundbackend.h
+1
-1
src/plugins/CMakeLists.txt
src/plugins/CMakeLists.txt
+1
-0
src/plugins/fluidsynthsoundbackend/CMakeLists.txt
src/plugins/fluidsynthsoundbackend/CMakeLists.txt
+11
-0
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.cpp
...plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.cpp
+35
-0
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.h
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.h
+39
-0
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.json
...lugins/fluidsynthsoundbackend/fluidsynthsoundbackend.json
+12
-0
src/shell/CMakeLists.txt
src/shell/CMakeLists.txt
+1
-0
src/shell/core.cpp
src/shell/core.cpp
+2
-0
src/shell/plugincontroller.cpp
src/shell/plugincontroller.cpp
+30
-0
src/shell/plugincontroller.h
src/shell/plugincontroller.h
+12
-0
No files found.
CMakeLists.txt
View file @
11ba8dcf
...
...
@@ -31,6 +31,7 @@ ecm_setup_version(${KDE_APPLICATIONS_VERSION} VARIABLE_PREFIX MINUET
find_package
(
Qt5
${
QT_MIN_VERSION
}
CONFIG REQUIRED COMPONENTS Core Gui Widgets Quick
)
find_package
(
KF5
${
KF5_MIN_VERSION
}
REQUIRED COMPONENTS
CoreAddons
I18n
XmlGui
KIO
...
...
src/CMakeLists.txt
View file @
11ba8dcf
add_subdirectory
(
interfaces
)
add_subdirectory
(
shell
)
add_subdirectory
(
plugins
)
add_subdirectory
(
app
)
src/app/exercisecontroller.cpp
View file @
11ba8dcf
...
...
@@ -24,7 +24,7 @@
#include "midisequencer.h"
#include <K
I18n/K
LocalizedString>
#include <KLocalizedString>
#include <QDir>
#include <QDateTime>
...
...
src/app/main.cpp
View file @
11ba8dcf
...
...
@@ -24,8 +24,8 @@
#include "minuet_version.h"
#include <KCrash
/KCrash
>
#include <K
CoreAddons/K
AboutData>
#include <KCrash>
#include <KAboutData>
#include <QCommandLineParser>
...
...
src/app/midisequencer.cpp
View file @
11ba8dcf
...
...
@@ -25,8 +25,8 @@
#include "minuetsettings.h"
#include "midisequenceroutputthread.h"
#include <K
I18n/K
LocalizedString>
#include <K
WidgetsAddons/K
MessageBox>
#include <KLocalizedString>
#include <KMessageBox>
#include <QtMath>
#include <QLoggingCategory>
...
...
src/app/minuetmainwindow.cpp
View file @
11ba8dcf
...
...
@@ -26,9 +26,9 @@
#include "midisequencer.h"
#include "exercisecontroller.h"
#include <K
XmlGui/K
ActionCollection>
#include <K
WidgetsAddons/K
MessageBox>
#include <KConfig
Widgets/KConfig
Dialog>
#include <KActionCollection>
#include <KMessageBox>
#include <KConfigDialog>
#include <QQmlEngine>
#include <QQmlContext>
...
...
src/app/minuetmainwindow.h
View file @
11ba8dcf
...
...
@@ -26,8 +26,8 @@
#include "ui_settingsmidi.h"
#include "minuetsettings.h"
#include <K
CoreAddons/K
Process>
#include <KXmlGui
/KXmlGui
Window>
#include <KProcess>
#include <KXmlGuiWindow>
#include <QLoggingCategory>
...
...
src/app/wizard.cpp
View file @
11ba8dcf
...
...
@@ -24,7 +24,7 @@
#include "minuetsettings.h"
#include <K
I18n/K
LocalizedString>
#include <KLocalizedString>
#include <QTimer>
#include <QDirIterator>
...
...
src/interfaces/iexercisecontroller.h
View file @
11ba8dcf
...
...
@@ -35,7 +35,7 @@ class MINUETINTERFACES_EXPORT IExerciseController : public QObject
Q_OBJECT
public:
IExerciseController
(
QObject
*
parent
);
explicit
IExerciseController
(
QObject
*
parent
=
0
);
~
IExerciseController
()
override
;
};
...
...
src/interfaces/iplugin.h
View file @
11ba8dcf
...
...
@@ -35,10 +35,12 @@ class MINUETINTERFACES_EXPORT IPlugin : public QObject
Q_OBJECT
public:
IPlugin
(
QObject
*
parent
);
explicit
IPlugin
(
QObject
*
parent
=
0
);
~
IPlugin
()
override
;
};
}
Q_DECLARE_INTERFACE
(
Minuet
::
IPlugin
,
"org.kde.minuet.IPlugin"
)
#endif
src/interfaces/iplugincontroller.h
View file @
11ba8dcf
...
...
@@ -35,7 +35,7 @@ class MINUETINTERFACES_EXPORT IPluginController : public QObject
Q_OBJECT
public:
IPluginController
(
QObject
*
parent
);
explicit
IPluginController
(
QObject
*
parent
=
0
);
~
IPluginController
()
override
;
};
...
...
src/interfaces/isoundbackend.h
View file @
11ba8dcf
...
...
@@ -35,7 +35,7 @@ class MINUETINTERFACES_EXPORT ISoundBackend : public QObject
Q_OBJECT
public:
ISoundBackend
(
QObject
*
parent
);
explicit
ISoundBackend
(
QObject
*
parent
=
0
);
~
ISoundBackend
()
override
;
};
...
...
src/plugins/CMakeLists.txt
0 → 100644
View file @
11ba8dcf
add_subdirectory
(
fluidsynthsoundbackend
)
src/plugins/fluidsynthsoundbackend/CMakeLists.txt
0 → 100644
View file @
11ba8dcf
set
(
fluidsynthsoundbackend_PLUGIN_SRCS
fluidsynthsoundbackend.cpp
)
add_library
(
minuetfluidsynthsoundbackend MODULE
${
fluidsynthsoundbackend_PLUGIN_SRCS
}
)
target_link_libraries
(
minuetfluidsynthsoundbackend
Minuet::Interfaces
)
install
(
TARGETS minuetfluidsynthsoundbackend DESTINATION
${
PLUGIN_INSTALL_DIR
}
/minuet/
)
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.cpp
0 → 100644
View file @
11ba8dcf
/****************************************************************************
**
** 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 "fluidsynthsoundbackend.h"
FluidSynthSoundBackend
::
FluidSynthSoundBackend
(
QObject
*
parent
)
:
Minuet
::
IPlugin
(
parent
)
{
}
FluidSynthSoundBackend
::~
FluidSynthSoundBackend
()
{
}
#include "moc_fluidsynthsoundbackend.cpp"
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.h
0 → 100644
View file @
11ba8dcf
/****************************************************************************
**
** 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_FLUIDSYNTHSOUNDBACKEND_H
#define MINUET_FLUIDSYNTHSOUNDBACKEND_H
#include <interfaces/iplugin.h>
class
FluidSynthSoundBackend
:
public
Minuet
::
IPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA
(
IID
"org.kde.minuet.IPlugin"
FILE
"fluidsynthsoundbackend.json"
)
Q_INTERFACES
(
Minuet
::
IPlugin
)
public:
explicit
FluidSynthSoundBackend
(
QObject
*
parent
=
0
);
~
FluidSynthSoundBackend
()
override
;
};
#endif
src/plugins/fluidsynthsoundbackend/fluidsynthsoundbackend.json
0 → 100644
View file @
11ba8dcf
{
"KPlugin"
:
{
"Category"
:
"Sound Backends"
,
"Description"
:
"This plugin provides Minuet with a FluidSynth-based implementation of sound backend."
,
"Icon"
:
"utilities-terminal"
,
"Id"
:
"minuetfluidsynthsoundbackend"
,
"Name"
:
"FluidSynth-based Audio Backend"
,
"ServiceTypes"
:
[
"Minuet/Plugin"
]
}
}
src/shell/CMakeLists.txt
View file @
11ba8dcf
...
...
@@ -11,6 +11,7 @@ generate_export_header(minuetshell EXPORT_FILE_NAME minuetshellexport.h)
target_link_libraries
(
minuetshell
Minuet::Interfaces
KF5::CoreAddons
)
install
(
TARGETS
...
...
src/shell/core.cpp
View file @
11ba8dcf
...
...
@@ -38,6 +38,7 @@ bool Core::initialize()
return
true
;
m_self
=
new
Core
;
return
true
;
}
...
...
@@ -62,6 +63,7 @@ Core::Core(QObject *parent)
m_exerciseController
(
new
ExerciseController
)
{
((
PluginController
*
)
m_pluginController
.
data
())
->
initialize
();
}
}
...
...
src/shell/plugincontroller.cpp
View file @
11ba8dcf
...
...
@@ -22,17 +22,47 @@
#include "plugincontroller.h"
#include <KPluginLoader>
#include <interfaces/iplugin.h>
#include <QDebug>
namespace
Minuet
{
PluginController
::
PluginController
(
QObject
*
parent
)
:
IPluginController
(
parent
)
{
m_plugins
=
KPluginLoader
::
findPlugins
(
QStringLiteral
(
"minuet"
),
[
&
](
const
KPluginMetaData
&
meta
)
{
if
(
!
meta
.
serviceTypes
().
contains
(
QStringLiteral
(
"Minuet/Plugin"
)))
{
qDebug
()
<<
"Plugin"
<<
meta
.
fileName
()
<<
"is installed into the minuet plugin directory, but does not have"
"
\"
Minuet/Plugin
\"
set as the service type. This plugin will not be loaded."
;
return
false
;
}
return
true
;
});
}
PluginController
::~
PluginController
()
{
}
bool
PluginController
::
initialize
()
{
foreach
(
const
KPluginMetaData
&
pluginMetaData
,
m_plugins
)
{
if
(
m_loadedPlugins
.
value
(
pluginMetaData
))
continue
;
KPluginLoader
loader
(
pluginMetaData
.
fileName
());
IPlugin
*
plugin
=
qobject_cast
<
IPlugin
*>
(
loader
.
instance
());
if
(
plugin
)
m_loadedPlugins
.
insert
(
pluginMetaData
,
plugin
);
}
return
true
;
}
}
src/shell/plugincontroller.h
View file @
11ba8dcf
...
...
@@ -25,11 +25,15 @@
#include <interfaces/iplugincontroller.h>
#include <KPluginMetaData>
#include "minuetshellexport.h"
namespace
Minuet
{
class
IPlugin
;
class
MINUETSHELL_EXPORT
PluginController
:
public
IPluginController
{
Q_OBJECT
...
...
@@ -37,6 +41,14 @@ class MINUETSHELL_EXPORT PluginController : public IPluginController
public:
PluginController
(
QObject
*
parent
=
0
);
~
PluginController
()
override
;
bool
initialize
();
private:
QVector
<
KPluginMetaData
>
m_plugins
;
typedef
QHash
<
KPluginMetaData
,
IPlugin
*>
InfoToPluginMap
;
InfoToPluginMap
m_loadedPlugins
;
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment