summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2011-01-04 18:48:12 +0000
committerTim E. Real <termtech@rogers.com>2011-01-04 18:48:12 +0000
commit212f604407e4a712563ca71eb281161ffcc91d85 (patch)
treec7e53dda9587a700198be425b86cb40bb4b78f35 /muse2/muse
parent15a9ee1018248dfb3902ba1d5995c22c97cd2380 (diff)
Please see ChangeLog
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/arranger/alayout.cpp22
-rw-r--r--muse2/muse/arranger/alayout.h3
-rw-r--r--muse2/muse/arranger/arranger.cpp24
-rw-r--r--muse2/muse/arranger/arranger.h5
-rw-r--r--muse2/muse/midiedit/pianoroll.cpp5
-rw-r--r--muse2/muse/route.cpp2
6 files changed, 50 insertions, 11 deletions
diff --git a/muse2/muse/arranger/alayout.cpp b/muse2/muse/arranger/alayout.cpp
index c59ba563..c7e1e4e3 100644
--- a/muse2/muse/arranger/alayout.cpp
+++ b/muse2/muse/arranger/alayout.cpp
@@ -82,6 +82,10 @@ TLLayout::~TLLayout()
void TLLayout::setGeometry(const QRect &rect)
{
+ //if(_inSetGeometry) // p4.0.11 Tim
+ // return;
+ //_inSetGeometry = true;
+
int w = rect.width();
int h = rect.height();
@@ -109,19 +113,22 @@ void TLLayout::setGeometry(const QRect &rect)
int x1 = s0.width();
int x2 = x1 + s1.width();
- li[0]->setGeometry(QRect(0, 0, s0.width(), y2));
+ li[0]->setGeometry(QRect(0, 0, s0.width(), y2));
QWidget* widget = stack->visibleWidget();
int range = s0.height() - y2;
if (range < 0)
range = 0;
- sb->setShown(range != 0);
+ // Note this appears to cause a single recursive call to this function - jumps to beginning,
+ // because now the scroll bar wants to be put in the layout.
+ sb->setVisible(range != 0);
if (range)
sb->setMaximum(range);
if (widget) {
- QSize r(s0.width(), y2);
- widget->setGeometry(0, 0, r.width(), r.height());
+ //QSize r(s0.width(), y2);
+ QSize r(s0.width(), y2 < s0.height() ? s0.height() : y2); // p4.0.11 Tim
+ widget->setGeometry(0, 0, r.width(), r.height());
}
li[1]->setGeometry(QRect(x1, 0, s1.width(), y2));
@@ -129,6 +136,8 @@ void TLLayout::setGeometry(const QRect &rect)
li[3]->setGeometry(QRect(x2, y1, aw, ah));
li[4]->setGeometry(QRect(0, y2, w, s4.height()));
li[5]->setGeometry(QRect(3, y3, s5.width(), s5.height()));
+
+ //_inSetGeometry = false;
}
//---------------------------------------------------------
@@ -138,6 +147,8 @@ void TLLayout::setGeometry(const QRect &rect)
QSize TLLayout::sizeHint() const
{
return QSize(150, 100);
+ // p4.0.11 Tim. 100 was allowing vertically shrunk trackinfo widgets. Nope, no help.
+ //return minimumSize();
}
//---------------------------------------------------------
@@ -148,7 +159,10 @@ QSize TLLayout::minimumSize() const
{
int w = stack->minimumSizeHint().width();
w += li[1]->sizeHint().width();
+
return QSize(w, 50);
+ // p4.0.11 Tim. 50 was allowing vertically shrunk trackinfo widgets. Nope, no help.
+ //return QSize(w, stack->minimumSizeHint().height());
}
//---------------------------------------------------------
diff --git a/muse2/muse/arranger/alayout.h b/muse2/muse/arranger/alayout.h
index 616c94c1..8ba1a829 100644
--- a/muse2/muse/arranger/alayout.h
+++ b/muse2/muse/arranger/alayout.h
@@ -25,6 +25,7 @@ class TLLayout : public QLayout
{
Q_OBJECT
+ bool _inSetGeometry;
QList<QLayoutItem*> ilist;
QLayoutItem* li[6];
QScrollBar* sb;
@@ -32,7 +33,7 @@ class TLLayout : public QLayout
public:
//TLLayout(QWidget *parent) : QLayout(parent, 0, -1) {}
- TLLayout(QWidget *parent) : QLayout(parent) { setContentsMargins(0, 0, 0, 0); setSpacing(-1); }
+ TLLayout(QWidget *parent) : QLayout(parent) { _inSetGeometry = false; setContentsMargins(0, 0, 0, 0); setSpacing(-1); }
~TLLayout() { clear(); }
void addItem(QLayoutItem *item) { ilist.append(item); }
diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp
index b27a47d1..d9cf5d5b 100644
--- a/muse2/muse/arranger/arranger.cpp
+++ b/muse2/muse/arranger/arranger.cpp
@@ -22,6 +22,7 @@
#include <QVBoxLayout>
#include <QWheelEvent>
#include <QPainter>
+//#include <QStackedWidget>
#include "arranger.h"
#include "song.h"
@@ -569,6 +570,7 @@ void Arranger::songChanged(int type)
if(type & SC_TRACK_REMOVED)
{
AudioStrip* w = (AudioStrip*)(trackInfo->getWidget(2));
+ //AudioStrip* w = (AudioStrip*)(trackInfo->widget(2));
if(w)
{
Track* t = w->getTrack();
@@ -580,6 +582,7 @@ void Arranger::songChanged(int type)
{
delete w;
trackInfo->addWidget(0, 2);
+ //trackInfo->insertWidget(2, 0);
selected = 0;
}
}
@@ -915,7 +918,7 @@ QSize WidgetStack::minimumSizeHint() const
s = s.expandedTo(ss);
}
}
- //printf("WidgetStack::minimumSizeHint width:%d height:%d\n", s.width(), s.height());
+ //printf("WidgetStack::minimumSizeHint width:%d height:%d\n", s.width(), s.height()); // REMOVE Tim.
return s;
}
@@ -949,8 +952,8 @@ void Arranger::controllerChanged(Track *t)
void Arranger::showTrackInfo(bool flag)
{
showTrackinfoFlag = flag;
- trackInfo->setShown(flag);
- infoScroll->setShown(flag);
+ trackInfo->setVisible(flag);
+ infoScroll->setVisible(flag);
updateTrackInfo(-1);
}
@@ -962,6 +965,7 @@ void Arranger::genTrackInfo(QWidget* parent)
{
trackInfo = new WidgetStack(parent, "trackInfoStack");
//trackInfo->setFocusPolicy(Qt::TabFocus); // p4.0.9
+ //trackInfo->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
noTrackInfo = new QWidget(trackInfo);
noTrackInfo->setAutoFillBackground(true);
@@ -979,6 +983,7 @@ void Arranger::genTrackInfo(QWidget* parent)
midiTrackInfo = new MidiTrackInfo(trackInfo);
//midiTrackInfo->setFocusPolicy(Qt::TabFocus); // p4.0.9
+ //midiTrackInfo->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum));
trackInfo->addWidget(noTrackInfo, 0);
trackInfo->addWidget(midiTrackInfo, 1);
trackInfo->addWidget(0, 2);
@@ -1045,3 +1050,16 @@ void Arranger::switchInfo(int n)
tgrid->update(); // muse-2 Qt4
}
+/*
+QSize WidgetStack::minimumSize() const
+{
+ printf("WidgetStack::minimumSize\n"); // REMOVE Tim.
+ return minimumSizeHint();
+}
+
+int WidgetStack::minimumHeight() const
+{
+ printf("WidgetStack::minimumHeight\n"); // REMOVE Tim.
+ return minimumSizeHint().height();
+}
+*/
diff --git a/muse2/muse/arranger/arranger.h b/muse2/muse/arranger/arranger.h
index d8e2c3fc..7ef79463 100644
--- a/muse2/muse/arranger/arranger.h
+++ b/muse2/muse/arranger/arranger.h
@@ -22,6 +22,7 @@ class QScrollBar;
class QToolButton;
class QWheelEvent;
class QKeyEvent;
+//class QStackedWidget;
class Header;
class TList;
@@ -55,7 +56,8 @@ class WidgetStack : public QWidget {
QWidget* visibleWidget() const;
int curIdx() const { return top; }
virtual QSize minimumSizeHint() const;
- //QSize minimumSize() const { return minimumSizeHint(); }
+ //QSize minimumSize() const;
+ //int minimumHeight() const;
};
//---------------------------------------------------------
@@ -75,6 +77,7 @@ class Arranger : public QWidget {
SpinBox* lenEntry;
bool showTrackinfoFlag;
WidgetStack* trackInfo;
+ //QStackedWidget* trackInfo;
QScrollBar* infoScroll;
//MidiTrackInfoBase* midiTrackInfo;
MidiTrackInfo* midiTrackInfo;
diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp
index c9c5632d..5c7a6761 100644
--- a/muse2/muse/midiedit/pianoroll.cpp
+++ b/muse2/muse/midiedit/pianoroll.cpp
@@ -915,7 +915,8 @@ void PianoRoll::writeStatus(int level, Xml& xml) const
xml.tag(level++, "pianoroll");
MidiEditor::writeStatus(level, xml);
splitter->writeStatus(level, xml);
-
+ hsplitter->writeStatus(level, xml);
+
for (std::list<CtrlEdit*>::const_iterator i = ctrlEditList.begin();
i != ctrlEditList.end(); ++i) {
(*i)->writeStatus(level, xml);
@@ -971,6 +972,8 @@ void PianoRoll::readStatus(Xml& xml)
}
else if (tag == splitter->objectName())
splitter->readStatus(xml);
+ else if (tag == hsplitter->objectName())
+ hsplitter->readStatus(xml);
else if (tag == "quantStrength")
_quantStrength = xml.parseInt();
else if (tag == "quantLimit")
diff --git a/muse2/muse/route.cpp b/muse2/muse/route.cpp
index 7356a890..19f8d09f 100644
--- a/muse2/muse/route.cpp
+++ b/muse2/muse/route.cpp
@@ -474,7 +474,7 @@ void addRoute(Route src, Route dst)
{
if(src.type != Route::TRACK_ROUTE || dst.type != Route::TRACK_ROUTE) // p3.3.49
{
- fprintf(stderr, "addRoute: source and destination are not track routes\n");
+ fprintf(stderr, "addRoute: source or destination are not track routes\n");
return;
}