summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2018-06-06 07:59:57 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2018-06-06 07:59:57 +0200
commited8983cb98fec755e0b633c4ec24a238d71182fc (patch)
tree44f5213261455606131384098482f0f0ed4b6394
parent668058ed445d56fe46ac7d5e5c2c2cc65b4e1e4c (diff)
Kit channels widget placeholder.
-rw-r--r--src/Makefile.am2
-rw-r--r--src/channelswidget.cc40
-rw-r--r--src/channelswidget.h47
-rw-r--r--src/mainwindow.cc10
4 files changed, 98 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index c3852c3..cefe0ff 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,6 +22,7 @@ dgedit_SOURCES = \
canvastoolselections.cc \
canvastoolthreshold.cc \
canvaswidget.cc \
+ channelswidget.cc \
filelist.cc \
instrumentdialog.cc \
instrumentwidget.cc \
@@ -48,6 +49,7 @@ EXTRA_DIST = \
canvastoolselections.h \
canvastoolthreshold.h \
canvaswidget.h \
+ channelswidget.h \
filelist.h \
instrumentdialog.h \
instrumentwidget.h \
diff --git a/src/channelswidget.cc b/src/channelswidget.cc
new file mode 100644
index 0000000..01b8feb
--- /dev/null
+++ b/src/channelswidget.cc
@@ -0,0 +1,40 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/***************************************************************************
+ * channelswidget.cc
+ *
+ * Sat May 26 09:28:12 CEST 2018
+ * Copyright 2018 Bent Bisballe Nyeng
+ * deva@aasimon.org
+ ****************************************************************************/
+
+/*
+ * This file is part of DrumGizmo.
+ *
+ * DrumGizmo 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) any later version.
+ *
+ * DrumGizmo 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 DrumGizmo; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+#include "channelswidget.h"
+
+#include "project.h"
+#include "settings.h"
+
+ChannelsWidget::ChannelsWidget(Settings& settings, Project& project)
+ : settings(settings)
+ , project(project)
+{
+}
+
+ChannelsWidget::~ChannelsWidget()
+{
+}
diff --git a/src/channelswidget.h b/src/channelswidget.h
new file mode 100644
index 0000000..4a514c6
--- /dev/null
+++ b/src/channelswidget.h
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/***************************************************************************
+ * channelswidget.h
+ *
+ * Sat May 26 09:28:12 CEST 2018
+ * Copyright 2018 Bent Bisballe Nyeng
+ * deva@aasimon.org
+ ****************************************************************************/
+
+/*
+ * This file is part of DrumGizmo.
+ *
+ * DrumGizmo 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) any later version.
+ *
+ * DrumGizmo 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 DrumGizmo; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+#pragma once
+
+#include <QMainWindow>
+
+class Project;
+class Settings;
+
+class ChannelsWidget
+ : public QMainWindow
+{
+ Q_OBJECT
+public:
+ ChannelsWidget(Settings& settings, Project& project);
+ ~ChannelsWidget();
+
+public slots:
+
+private:
+ Settings& settings;
+ Project& project;
+};
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 92a91e7..8091d2e 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -44,6 +44,7 @@
#include "instrumentdialog.h"
#include "projectserialiser.h"
#include "instrumentwidget.h"
+#include "channelswidget.h"
#define MAXVAL 10000000L
@@ -113,7 +114,7 @@ MainWindow::MainWindow(Settings& settings)
}
addDockWidget(Qt::LeftDockWidgetArea, instruments_dock);
- channels_dock = new QDockWidget(tr("Channels:"), this);
+ channels_dock = new QDockWidget(tr("Kit channels:"), this);
channels_dock->setObjectName("channels_dock");
channels_dock->setAllowedAreas(Qt::LeftDockWidgetArea);
channels_dock->setFeatures(QDockWidget::DockWidgetMovable);
@@ -276,6 +277,13 @@ void MainWindow::removeChannel()
void MainWindow::channelDoubleClicked(QListWidgetItem *item)
{
+ // Tab wasn't open already. Create it.
+ tab_widget->addTab(new ChannelsWidget(settings, project),
+ QPixmap(":icons/channel.png"),
+ tr("Channels"));
+ // Make new tab active
+ tab_widget->setCurrentIndex(tab_widget->count() - 1);
+
}
void MainWindow::updateWindowTitle()