summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
Diffstat (limited to 'muse2')
-rw-r--r--muse2/muse/cobject.cpp78
-rw-r--r--muse2/muse/cobject.h11
-rw-r--r--muse2/muse/conf.cpp6
-rw-r--r--muse2/muse/widgets/CMakeLists.txt3
-rw-r--r--muse2/muse/widgets/genset.cpp79
-rw-r--r--muse2/muse/widgets/genset.h10
-rw-r--r--muse2/muse/widgets/gensetbase.ui83
-rw-r--r--muse2/muse/widgets/mdisettings.cpp44
-rw-r--r--muse2/muse/widgets/mdisettings.h34
-rw-r--r--muse2/muse/widgets/mdisettings_base.ui60
10 files changed, 366 insertions, 42 deletions
diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp
index 5e007fe3..398f8be7 100644
--- a/muse2/muse/cobject.cpp
+++ b/muse2/muse/cobject.cpp
@@ -32,23 +32,7 @@ TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlag
: QMainWindow(parent, f)
{
if (initInited==false)
- {
- for (int i=0;i<TOPLEVELTYPE_LAST_ENTRY;i++)
- {
- _widthInit[i]=800;
- _heightInit[i]=600;
- _sharesWhenFree[i]=false;
- _sharesWhenSubwin[i]=true;
- _defaultSubwin[i]=false;
- }
-
- _defaultSubwin[ARRANGER]=true;
-
- _defaultSubwin[SCORE]=true; //FINDMICH
- _sharesWhenFree[SCORE]=true;
-
- initInited=true;
- }
+ initConfiguration();
initalizing=true;
@@ -80,7 +64,6 @@ TopWin::TopWin(ToplevelType t, QWidget* parent, const char* name, Qt::WindowFlag
}
-
//---------------------------------------------------------
// readStatus
//---------------------------------------------------------
@@ -303,12 +286,37 @@ void TopWin::storeInitialState()
_toolbarNonsharedInit[_type] = saveState();
}
+
+
+//initConfiguration() restores default "traditional muse" configuration
+void TopWin::initConfiguration()
+{
+ if (initInited==false)
+ {
+ for (int i=0;i<TOPLEVELTYPE_LAST_ENTRY;i++)
+ {
+ _widthInit[i]=800;
+ _heightInit[i]=600;
+ _sharesWhenFree[i]=false;
+ _sharesWhenSubwin[i]=true;
+ _defaultSubwin[i]=false;
+ }
+
+ _defaultSubwin[ARRANGER]=true;
+
+ initInited=true;
+ }
+}
+
//---------------------------------------------------------
// readConfiguration
//---------------------------------------------------------
void TopWin::readConfiguration(ToplevelType t, Xml& xml)
{
+ if (initInited==false)
+ initConfiguration();
+
for (;;) {
Xml::Token token = xml.parse();
if (token == Xml::Error || token == Xml::End)
@@ -324,6 +332,12 @@ void TopWin::readConfiguration(ToplevelType t, Xml& xml)
_toolbarNonsharedInit[t] = QByteArray::fromHex(xml.parse1().toAscii());
else if (tag == "shared_toolbars")
_toolbarSharedInit[t] = QByteArray::fromHex(xml.parse1().toAscii());
+ else if (tag == "shares_when_free")
+ _sharesWhenFree[t] = xml.parseInt();
+ else if (tag == "shares_when_subwin")
+ _sharesWhenSubwin[t] = xml.parseInt();
+ else if (tag == "default_subwin")
+ _defaultSubwin[t] = xml.parseInt();
else
xml.unknown("TopWin");
break;
@@ -336,17 +350,27 @@ void TopWin::readConfiguration(ToplevelType t, Xml& xml)
}
}
+
//---------------------------------------------------------
// writeConfiguration
//---------------------------------------------------------
void TopWin::writeConfiguration(ToplevelType t, int level, Xml& xml)
{
+ if (!initInited)
+ {
+ printf ("WARNING: TopWin::writeConfiguration() called although the config hasn't been\n"
+ " initalized! writing default configuration\n");
+ initConfiguration();
+ }
xml.tag(level++, "topwin");
xml.intTag(level, "width", _widthInit[t]);
xml.intTag(level, "height", _heightInit[t]);
xml.strTag(level, "nonshared_toolbars", _toolbarNonsharedInit[t].toHex().data());
xml.strTag(level, "shared_toolbars", _toolbarSharedInit[t].toHex().data());
+ xml.intTag(level, "shares_when_free", _sharesWhenFree[t]);
+ xml.intTag(level, "shares_when_subwin", _sharesWhenSubwin[t]);
+ xml.intTag(level, "default_subwin", _defaultSubwin[t]);
xml.etag(level, "topwin");
}
@@ -371,3 +395,21 @@ void TopWin::restoreMainwinState()
if (sharesToolsAndMenu())
initTopwinState();
}
+
+QString TopWin::typeName(ToplevelType t)
+{
+ switch (t)
+ {
+ case PIANO_ROLL: return tr("Piano roll");
+ case LISTE: return tr("List editor");
+ case DRUM: return tr("Drum editor");
+ case MASTER: return tr("Master track editor");
+ case LMASTER: return tr("Master track list editor");
+ case WAVE: return tr("Wave editor");
+ case CLIPLIST: return tr("Clip list");
+ case MARKER: return tr("Marker view");
+ case SCORE: return tr("Score editor");
+ case ARRANGER: return tr("Arranger");
+ default: return tr("<unknown toplevel type>");
+ }
+}
diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h
index f76f6f61..6b982747 100644
--- a/muse2/muse/cobject.h
+++ b/muse2/muse/cobject.h
@@ -14,6 +14,7 @@
#include <QMainWindow>
#include <list>
#include <QByteArray>
+#include <QString>
class QMdiSubWindow;
class QFocusEvent;
@@ -39,6 +40,7 @@ class TopWin : public QMainWindow
};
ToplevelType type() const { return _type; }
+ static QString typeName(ToplevelType t);
virtual void readStatus(Xml&);
@@ -58,6 +60,11 @@ class TopWin : public QMainWindow
void addToolBar(QToolBar* toolbar);
QToolBar* addToolBar(const QString& title);
+
+ static bool _sharesWhenFree[TOPLEVELTYPE_LAST_ENTRY];
+ static bool _sharesWhenSubwin[TOPLEVELTYPE_LAST_ENTRY];
+ static bool _defaultSubwin[TOPLEVELTYPE_LAST_ENTRY];
+
private:
QMdiSubWindow* mdisubwin;
bool _sharesToolsAndMenu;
@@ -71,6 +78,7 @@ class TopWin : public QMainWindow
virtual QMdiSubWindow* createMdiWrapper();
+ static void initConfiguration();
protected:
QAction* subwinAction;
@@ -82,9 +90,6 @@ class TopWin : public QMainWindow
static int _heightInit[TOPLEVELTYPE_LAST_ENTRY];
static QByteArray _toolbarNonsharedInit[TOPLEVELTYPE_LAST_ENTRY];
static QByteArray _toolbarSharedInit[TOPLEVELTYPE_LAST_ENTRY];
- static bool _sharesWhenFree[TOPLEVELTYPE_LAST_ENTRY];
- static bool _sharesWhenSubwin[TOPLEVELTYPE_LAST_ENTRY];
- static bool _defaultSubwin[TOPLEVELTYPE_LAST_ENTRY];
static bool initInited;
void initTopwinState();
diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp
index 7451e22c..5fea91a5 100644
--- a/muse2/muse/conf.cpp
+++ b/muse2/muse/conf.cpp
@@ -883,12 +883,6 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
}
//else if (tag == "midiSyncInfo")
// readConfigMidiSyncInfo(xml);
- else if (tag == "arranger") {
- if (muse && muse->arranger)
- muse->arranger->readStatus(xml);
- else
- xml.skip(tag);
- }
else if (tag == "drumedit")
DrumEdit::readConfiguration(xml);
else if (tag == "pianoroll")
diff --git a/muse2/muse/widgets/CMakeLists.txt b/muse2/muse/widgets/CMakeLists.txt
index a4da398f..b1eb888a 100644
--- a/muse2/muse/widgets/CMakeLists.txt
+++ b/muse2/muse/widgets/CMakeLists.txt
@@ -42,6 +42,7 @@ QT4_WRAP_CPP (widget_mocs
doublelabel.h
filedialog.h
genset.h
+ mdisettings.h
header.h
hitscale.h
intlabel.h
@@ -104,6 +105,7 @@ file (GLOB widgets_ui_files
editsysexdialogbase.ui
fdialogbuttons.ui
gensetbase.ui
+ mdisettings_base.ui
itransformbase.ui
metronomebase.ui
midisync.ui
@@ -139,6 +141,7 @@ file (GLOB widgets_source_files
drange.cpp
filedialog.cpp
genset.cpp
+ mdisettings.cpp
header.cpp
hitscale.cpp
intlabel.cpp
diff --git a/muse2/muse/widgets/genset.cpp b/muse2/muse/widgets/genset.cpp
index d8c76874..3aff8247 100644
--- a/muse2/muse/widgets/genset.cpp
+++ b/muse2/muse/widgets/genset.cpp
@@ -163,8 +163,31 @@ Shorter periods are desirable.</string>
connect(setBigtimeCurrent, SIGNAL(clicked()), SLOT(bigtimeCurrent()));
connect(setArrangerCurrent, SIGNAL(clicked()), SLOT(arrangerCurrent()));
connect(setTransportCurrent, SIGNAL(clicked()), SLOT(transportCurrent()));
+
+ connect(buttonTraditionalPreset, SIGNAL(clicked()), SLOT(traditionalPreset()));
+ connect(buttonMDIPreset, SIGNAL(clicked()), SLOT(mdiPreset()));
+ connect(buttonBorlandPreset, SIGNAL(clicked()), SLOT(borlandPreset()));
+
+ addMdiSettings(TopWin::ARRANGER);
+ addMdiSettings(TopWin::SCORE);
+ addMdiSettings(TopWin::PIANO_ROLL);
+ addMdiSettings(TopWin::DRUM);
+ addMdiSettings(TopWin::LISTE);
+ addMdiSettings(TopWin::WAVE);
+ addMdiSettings(TopWin::MASTER);
+ addMdiSettings(TopWin::LMASTER);
+ addMdiSettings(TopWin::CLIPLIST);
+ addMdiSettings(TopWin::MARKER);
+
}
+void GlobalSettingsConfig::addMdiSettings(TopWin::ToplevelType t)
+{
+ MdiSettings* temp = new MdiSettings(t, this);
+ layoutMdiSettings->addWidget(temp);
+ mdisettings.push_back(temp);
+}
+
//---------------------------------------------------------
// updateSettings
//---------------------------------------------------------
@@ -265,6 +288,20 @@ void GlobalSettingsConfig::updateSettings()
moveArmedCheckBox->setChecked(config.moveArmedCheckBox);
projectSaveCheckBox->setChecked(config.useProjectSaveDialog);
popsDefStayOpenCheckBox->setChecked(config.popupsDefaultStayOpen);
+
+ updateMdiSettings();
+}
+
+void GlobalSettingsConfig::updateMdiSettings()
+{
+ for (std::list<MdiSettings*>::iterator it = mdisettings.begin(); it!=mdisettings.end(); it++)
+ (*it)->update_settings();
+}
+
+void GlobalSettingsConfig::applyMdiSettings()
+{
+ for (std::list<MdiSettings*>::iterator it = mdisettings.begin(); it!=mdisettings.end(); it++)
+ (*it)->apply_settings();
}
//---------------------------------------------------------
@@ -386,6 +423,9 @@ void GlobalSettingsConfig::apply()
muse->setHeartBeat(); // set guiRefresh
midiSeq->msgSetRtc(); // set midi tick rate
+
+ applyMdiSettings();
+
muse->changeConfig(true); // save settings
}
@@ -496,3 +536,42 @@ void GlobalSettingsConfig::defaultInstrumentsPath()
QString dir = configPath + "/instruments";
userInstrumentsPath->setText(dir);
}
+
+
+void GlobalSettingsConfig::traditionalPreset()
+{
+ for (std::list<MdiSettings*>::iterator it = mdisettings.begin(); it!=mdisettings.end(); it++)
+ {
+ TopWin::ToplevelType type = (*it)->type();
+ TopWin::_sharesWhenFree[type]=false;
+ TopWin::_defaultSubwin[type]=false;
+ }
+ TopWin::_defaultSubwin[TopWin::ARRANGER]=true;
+
+ updateMdiSettings();
+}
+
+void GlobalSettingsConfig::mdiPreset()
+{
+ for (std::list<MdiSettings*>::iterator it = mdisettings.begin(); it!=mdisettings.end(); it++)
+ {
+ TopWin::ToplevelType type = (*it)->type();
+ TopWin::_sharesWhenSubwin[type]=true;
+ TopWin::_defaultSubwin[type]=true;
+ }
+
+ updateMdiSettings();
+}
+
+void GlobalSettingsConfig::borlandPreset()
+{
+ for (std::list<MdiSettings*>::iterator it = mdisettings.begin(); it!=mdisettings.end(); it++)
+ {
+ TopWin::ToplevelType type = (*it)->type();
+ TopWin::_sharesWhenFree[type]=true;
+ TopWin::_defaultSubwin[type]=false;
+ }
+
+ updateMdiSettings();
+}
+
diff --git a/muse2/muse/widgets/genset.h b/muse2/muse/widgets/genset.h
index ea094296..bc9ed1dd 100644
--- a/muse2/muse/widgets/genset.h
+++ b/muse2/muse/widgets/genset.h
@@ -10,8 +10,11 @@
#define __GENSET_H__
#include "ui_gensetbase.h"
+#include "cobject.h"
+#include "mdisettings.h"
#include <QShowEvent>
+#include <list>
//---------------------------------------------------------
// GlobalSettingsConfig
@@ -22,6 +25,9 @@ class GlobalSettingsConfig : public QDialog, public Ui::GlobalSettingsDialogBase
private slots:
void updateSettings();
+ void updateMdiSettings();
+ void addMdiSettings(TopWin::ToplevelType t);
+ void applyMdiSettings();
void apply();
void ok();
void cancel();
@@ -32,10 +38,14 @@ class GlobalSettingsConfig : public QDialog, public Ui::GlobalSettingsDialogBase
void transportCurrent();
void selectInstrumentsPath();
void defaultInstrumentsPath();
+ void traditionalPreset();
+ void mdiPreset();
+ void borlandPreset();
protected:
void showEvent(QShowEvent*);
QButtonGroup *startSongGroup;
+ std::list<MdiSettings*> mdisettings;
public:
GlobalSettingsConfig(QWidget* parent=0);
diff --git a/muse2/muse/widgets/gensetbase.ui b/muse2/muse/widgets/gensetbase.ui
index 68f3ebb5..6b5ab8a8 100644
--- a/muse2/muse/widgets/gensetbase.ui
+++ b/muse2/muse/widgets/gensetbase.ui
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>526</width>
+ <width>556</width>
<height>506</height>
</rect>
</property>
@@ -23,7 +23,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
- <number>0</number>
+ <number>3</number>
</property>
<widget class="QWidget" name="TabPage">
<attribute name="title">
@@ -1333,19 +1333,6 @@ Adjusts responsiveness of audio controls and
</property>
</widget>
</item>
- <item row="5" column="0">
- <spacer name="verticalSpacer_2">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
<item row="4" column="0">
<widget class="QLabel" name="TextLabel1_3">
<property name="toolTip">
@@ -1370,6 +1357,72 @@ Otherwise, hold Ctrl to keep them open.</string>
</layout>
</widget>
</item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>MDI-subwindowness and sharing menus</string>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_9">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Presets:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="buttonTraditionalPreset">
+ <property name="text">
+ <string>traditional MusE SDI</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="buttonMDIPreset">
+ <property name="text">
+ <string>Cakewalk-like MDI</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="buttonBorlandPreset">
+ <property name="text">
+ <string>Borland-like MDI</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QScrollArea" name="scrollArea">
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="scrollAreaWidgetContents_2">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>482</width>
+ <height>168</height>
+ </rect>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <layout class="QVBoxLayout" name="layoutMdiSettings"/>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
</layout>
</widget>
</widget>
diff --git a/muse2/muse/widgets/mdisettings.cpp b/muse2/muse/widgets/mdisettings.cpp
new file mode 100644
index 00000000..127aa5c1
--- /dev/null
+++ b/muse2/muse/widgets/mdisettings.cpp
@@ -0,0 +1,44 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: genset.cpp,v 1.7.2.8 2009/12/01 03:52:40 terminator356 Exp $
+//
+// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//=========================================================
+
+#include <stdio.h>
+
+#include <QFileDialog>
+#include <QRect>
+#include <QShowEvent>
+
+#include "mdisettings.h"
+#include "app.h"
+#include "gconfig.h"
+#include "midiseq.h"
+#include "globals.h"
+#include "icons.h"
+
+MdiSettings::MdiSettings(TopWin::ToplevelType t, QWidget* parent) : QWidget(parent)
+{
+ _type=t;
+ setupUi(this);
+
+ groupBox->setTitle(TopWin::typeName(t));
+ update_settings();
+}
+
+
+void MdiSettings::update_settings()
+{
+ isSubwinCheckbox->setChecked(TopWin::_defaultSubwin[_type]);
+ shareSubwinCheckbox->setChecked(TopWin::_sharesWhenSubwin[_type]);
+ shareFreeCheckbox->setChecked(TopWin::_sharesWhenFree[_type]);
+}
+
+void MdiSettings::apply_settings()
+{
+ TopWin::_defaultSubwin[_type] = isSubwinCheckbox->isChecked();
+ TopWin::_sharesWhenSubwin[_type] = shareSubwinCheckbox->isChecked();
+ TopWin::_sharesWhenFree[_type] = shareFreeCheckbox->isChecked();
+}
diff --git a/muse2/muse/widgets/mdisettings.h b/muse2/muse/widgets/mdisettings.h
new file mode 100644
index 00000000..2f1bdf55
--- /dev/null
+++ b/muse2/muse/widgets/mdisettings.h
@@ -0,0 +1,34 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: genset.h,v 1.3 2004/01/25 09:55:17 wschweer Exp $
+//
+// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//=========================================================
+
+#ifndef __MDISETTINGS_H__
+#define __MDISETTINGS_H__
+
+#include <QWidget>
+#include "ui_mdisettings_base.h"
+#include "cobject.h"
+
+//---------------------------------------------------------
+// GlobalSettingsConfig
+//---------------------------------------------------------
+
+class MdiSettings : public QWidget, private Ui::MdiSettingsBase
+{
+ Q_OBJECT
+
+ private:
+ TopWin::ToplevelType _type;
+
+ public:
+ MdiSettings(TopWin::ToplevelType t, QWidget* parent=0);
+ void update_settings();
+ void apply_settings();
+ TopWin::ToplevelType type() { return _type; }
+};
+
+#endif
diff --git a/muse2/muse/widgets/mdisettings_base.ui b/muse2/muse/widgets/mdisettings_base.ui
new file mode 100644
index 00000000..af32f174
--- /dev/null
+++ b/muse2/muse/widgets/mdisettings_base.ui
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MdiSettingsBase</class>
+ <widget class="QWidget" name="MdiSettingsBase">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>338</width>
+ <height>100</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>GroupBox</string>
+ </property>
+ <property name="flat">
+ <bool>true</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="isSubwinCheckbox">
+ <property name="text">
+ <string>MDI subwin</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QCheckBox" name="shareSubwinCheckbox">
+ <property name="text">
+ <string>Shares menu when subwin</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <widget class="QCheckBox" name="shareFreeCheckbox">
+ <property name="text">
+ <string>Shares menu when free</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>