diff options
-rw-r--r-- | muse2/ChangeLog | 7 | ||||
-rw-r--r-- | muse2/muse/arranger/alayout.cpp | 22 | ||||
-rw-r--r-- | muse2/muse/arranger/alayout.h | 3 | ||||
-rw-r--r-- | muse2/muse/arranger/arranger.cpp | 24 | ||||
-rw-r--r-- | muse2/muse/arranger/arranger.h | 5 | ||||
-rw-r--r-- | muse2/muse/midiedit/pianoroll.cpp | 5 | ||||
-rw-r--r-- | muse2/muse/route.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/deicsonze/deicsonze.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/fluid/fluid.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/fluidsynth/fluidsynti.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/organ/organ.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/simpledrums/simpledrums.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/simpledrums2/simpledrums.cpp | 2 | ||||
-rw-r--r-- | muse2/synti/vam/vam.cpp | 2 |
14 files changed, 64 insertions, 18 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog index fb2fc8e6..54c07677 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,10 @@ +04.01.2011: + - Added saving and restoring of pianoroll trackinfo h-splitter state. (Tim) + TODO: Fix multiple velocity controllers appearing on reload. + - Fixed arranger trackinfo widgets sizing - were allowed to shrink vertically. (Tim) + TODO: Fix trackinfo scrollbar not showing at right time. + - Replace all QWidget::setShown() calls with setVisible(). (Tim) + It's supposed to be a Qt3 function, but still supported. 02.01.2011: - Fixed arranger focussing problems again. (Tim) Scratch setFocusProxy() fix of 31.12. Gave MusE a keyPress handler and pass it on to canvas. 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; } diff --git a/muse2/synti/deicsonze/deicsonze.cpp b/muse2/synti/deicsonze/deicsonze.cpp index 2b44ee21..78869cf6 100644 --- a/muse2/synti/deicsonze/deicsonze.cpp +++ b/muse2/synti/deicsonze/deicsonze.cpp @@ -273,7 +273,7 @@ bool DeicsOnze::guiVisible() const //--------------------------------------------------------- void DeicsOnze::showGui(bool val) { - _gui->setShown(val); + _gui->setVisible(val); } //--------------------------------------------------------- diff --git a/muse2/synti/fluid/fluid.cpp b/muse2/synti/fluid/fluid.cpp index 8bac3ca2..d1802354 100644 --- a/muse2/synti/fluid/fluid.cpp +++ b/muse2/synti/fluid/fluid.cpp @@ -283,7 +283,7 @@ bool ISynth::guiVisible() const void ISynth::showGui(bool flag) { - gui->setShown(flag); + gui->setVisible(flag); } //--------------------------------------------------------- diff --git a/muse2/synti/fluidsynth/fluidsynti.cpp b/muse2/synti/fluidsynth/fluidsynti.cpp index 72031d59..327cde39 100644 --- a/muse2/synti/fluidsynth/fluidsynti.cpp +++ b/muse2/synti/fluidsynth/fluidsynti.cpp @@ -738,7 +738,7 @@ bool FluidSynth::guiVisible() const void FluidSynth::showGui(bool val) { - gui->setShown(val); + gui->setVisible(val); } //--------------------------------------------------------- diff --git a/muse2/synti/organ/organ.cpp b/muse2/synti/organ/organ.cpp index ebbdde95..1aa87742 100644 --- a/muse2/synti/organ/organ.cpp +++ b/muse2/synti/organ/organ.cpp @@ -650,7 +650,7 @@ bool Organ::guiVisible() const void Organ::showGui(bool val) { - gui->setShown(val); + gui->setVisible(val); } //--------------------------------------------------------- diff --git a/muse2/synti/simpledrums/simpledrums.cpp b/muse2/synti/simpledrums/simpledrums.cpp index c30bba76..43f9ccee 100644 --- a/muse2/synti/simpledrums/simpledrums.cpp +++ b/muse2/synti/simpledrums/simpledrums.cpp @@ -854,7 +854,7 @@ void SimpleSynth::process(float** out, int offset, int len) void SimpleSynth::showGui(bool val) { SS_TRACE_IN - gui->setShown(val); + gui->setVisible(val); SS_TRACE_OUT } diff --git a/muse2/synti/simpledrums2/simpledrums.cpp b/muse2/synti/simpledrums2/simpledrums.cpp index 95309372..54db77ef 100644 --- a/muse2/synti/simpledrums2/simpledrums.cpp +++ b/muse2/synti/simpledrums2/simpledrums.cpp @@ -818,7 +818,7 @@ void SimpleSynth::process(float** out, int offset, int len) void SimpleSynth::showGui(bool val) { SS_TRACE_IN - gui->setShown(val); + gui->setVisible(val); SS_TRACE_OUT } diff --git a/muse2/synti/vam/vam.cpp b/muse2/synti/vam/vam.cpp index 62125789..6d9d181c 100644 --- a/muse2/synti/vam/vam.cpp +++ b/muse2/synti/vam/vam.cpp @@ -993,7 +993,7 @@ bool VAM::guiVisible() const void VAM::showGui(bool val) { - gui->setShown(val); + gui->setVisible(val); } //--------------------------------------------------------- |