From ed8983cb98fec755e0b633c4ec24a238d71182fc Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 6 Jun 2018 07:59:57 +0200 Subject: Kit channels widget placeholder. --- src/Makefile.am | 2 ++ src/channelswidget.cc | 40 ++++++++++++++++++++++++++++++++++++++++ src/channelswidget.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ src/mainwindow.cc | 10 +++++++++- 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 src/channelswidget.cc create mode 100644 src/channelswidget.h 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 + +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() -- cgit v1.2.3