drumstick  2.9.0
C++ MIDI libraries using Qt objects, idioms, and style.
vpiano-plugin.cpp
Go to the documentation of this file.
1 /*
2  Virtual Piano Widget for Qt
3  Copyright (C) 2008-2023, Pedro Lopez-Cabanillas <plcl@users.sf.net>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #include "vpiano-plugin.h"
20 #include <QtPlugin>
21 #include <drumstick/pianokeybd.h>
22 
23 using namespace drumstick::widgets;
24 
30 PianoKeybdPlugin::PianoKeybdPlugin(QObject *parent)
31  : QObject(parent)
32 { }
33 
34 void PianoKeybdPlugin::initialize(QDesignerFormEditorInterface * /* core */)
35 {
36  if (initialized)
37  return;
38 
39  initialized = true;
40 }
41 
42 bool PianoKeybdPlugin::isInitialized() const
43 {
44  return initialized;
45 }
46 
47 QWidget *PianoKeybdPlugin::createWidget(QWidget *parent)
48 {
49  return new PianoKeybd(parent);
50 }
51 
52 QString PianoKeybdPlugin::name() const
53 {
54  return QStringLiteral("drumstick::widgets::PianoKeybd");
55 }
56 
57 QString PianoKeybdPlugin::group() const
58 {
59  return QStringLiteral("Drumstick");
60 }
61 
62 QIcon PianoKeybdPlugin::icon() const
63 {
64  return QIcon(":/vpiano-plugin.png");
65 }
66 
67 QString PianoKeybdPlugin::toolTip() const
68 {
69  return QStringLiteral("Virtual Piano Keyboard");
70 }
71 
72 QString PianoKeybdPlugin::whatsThis() const
73 {
74  return QStringLiteral("The Virtual Piano Keyboard is a MIDI controller emulator");
75 }
76 
77 bool PianoKeybdPlugin::isContainer() const
78 {
79  return false;
80 }
81 
82 QString PianoKeybdPlugin::includeFile() const
83 {
84  return QStringLiteral("<drumstick/pianokeybd.h>");
85 }
86 
87 QString PianoKeybdPlugin::domXml() const
88 {
89  return "<ui language=\"c++\">\n"
90  " <widget class=\"drumstick::widgets::PianoKeybd\" name=\"pianoKeybd\">\n"
91  " <property name=\"geometry\">\n"
92  " <rect>\n"
93  " <x>0</x>\n"
94  " <y>0</y>\n"
95  " <width>640</width>\n"
96  " <height>80</height>\n"
97  " </rect>\n"
98  " </property>\n"
99  " </widget>\n"
100  "</ui>";
101 }
The QObject class is the base class of all Qt objects.
The PianoKeybd class.
Definition: pianokeybd.h:176
Drumstick Widgets library MIDI related widgets and functions.
Piano Keyboard Widget.
PianoKeybdPlugin class definition (Qt Designer plugin)