summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2006-09-03 21:08:34 +0000
committerRobert Jonsson <spamatica@gmail.com>2006-09-03 21:08:34 +0000
commitbac4b43ef47cffdca8fc3a64fa0121206caf278f (patch)
tree257c7ef95dd10c5bfb95a387b2a6ce7ae31dc6ee
parenta5dbb325155db659223de7dd97855ac44d3be823 (diff)
Removed various warnings
Added red line to identify selected track Some fixes to adding automation tracks
-rw-r--r--muse/ChangeLog3
-rw-r--r--muse/muse/arranger/arranger.cpp33
-rw-r--r--muse/muse/arranger/arranger.h2
-rw-r--r--muse/muse/arranger/tlswidget.cpp13
-rw-r--r--muse/muse/arranger/tlswidget.h4
-rw-r--r--muse/muse/arranger/tlwidget.cpp13
-rw-r--r--muse/muse/midifile.cpp4
-rw-r--r--muse/muse/song.cpp4
-rw-r--r--muse/muse/song.h2
-rw-r--r--muse/muse/thread.cpp4
-rw-r--r--muse/muse/ticksynth.cpp8
11 files changed, 57 insertions, 33 deletions
diff --git a/muse/ChangeLog b/muse/ChangeLog
index d29a75f2..f9913192 100644
--- a/muse/ChangeLog
+++ b/muse/ChangeLog
@@ -1,3 +1,6 @@
+3.9 (rj)
+ * added red line to the left of track to identify selected track
+ * various fixes, adding controllers etc
31.8 (ws)
* plugin racks can now hold an unlimited number of plugins
29.8 (ws)
diff --git a/muse/muse/arranger/arranger.cpp b/muse/muse/arranger/arranger.cpp
index 805efc62..eef7f20f 100644
--- a/muse/muse/arranger/arranger.cpp
+++ b/muse/muse/arranger/arranger.cpp
@@ -698,27 +698,38 @@ void Arranger::appendSubtrack(TLWidget* trackWidget)
at->h = minTrackHeight;
at->ctrl = CTRL_NO_CTRL;
t->subtracks.push_back(at);
- initSubtrack(t, at);
- updateIndex();
+ if(initSubtrack(t, at)==true) {
+ updateIndex();
+ }
+ else {
+ t->subtracks.remove(at);
+ delete at;
+ }
}
//---------------------------------------------------------
// initSubtrack
//---------------------------------------------------------
-void Arranger::initSubtrack(Track* t, ArrangerTrack* at)
+bool Arranger::initSubtrack(Track* t, ArrangerTrack* at)
{
TLSWidget* tw = new TLSWidget(t, at, canvas);
tw->setFixedHeight(at->h);
- tl->insertWidget(tlIndex(at), tw);
- tw->setCtrl(at->ctrl);
- at->tw = tw;
- connect(tw, SIGNAL(minusClicked(TLSWidget*)), SLOT(removeSubtrack(TLSWidget*)));
- connect(tw, SIGNAL(controllerChanged(int)), canvas->widget(), SLOT(update()));
- connect(tw, SIGNAL(drag(int, int)), SLOT(drag(int,int)));
- connect(tw, SIGNAL(startDrag(int)), SLOT(startDrag(int)));
- tw->show();
+ if(tw->setCtrl(at->ctrl) == true) {
+ tl->insertWidget(tlIndex(at), tw);
+ at->tw = tw;
+ connect(tw, SIGNAL(minusClicked(TLSWidget*)), SLOT(removeSubtrack(TLSWidget*)));
+ connect(tw, SIGNAL(controllerChanged(int)), canvas->widget(), SLOT(update()));
+ connect(tw, SIGNAL(drag(int, int)), SLOT(drag(int,int)));
+ connect(tw, SIGNAL(startDrag(int)), SLOT(startDrag(int)));
+ tw->show();
+ }
+ else {
+ delete tw;
+ return false;
+ }
+ return true;
}
//---------------------------------------------------------
diff --git a/muse/muse/arranger/arranger.h b/muse/muse/arranger/arranger.h
index 8a8632b4..451cd889 100644
--- a/muse/muse/arranger/arranger.h
+++ b/muse/muse/arranger/arranger.h
@@ -116,7 +116,7 @@ class Arranger : public QWidget {
TrackInfo* createTrackInfo();
int tlIndex(Track*) const;
int tlIndex(ArrangerTrack* t) const;
- void initSubtrack(Track* t, ArrangerTrack*);
+ bool initSubtrack(Track* t, ArrangerTrack*);
ArrangerTrack* atrack(int idx);
void insertTrack1(Track*);
diff --git a/muse/muse/arranger/tlswidget.cpp b/muse/muse/arranger/tlswidget.cpp
index 798b077d..393e7d1e 100644
--- a/muse/muse/arranger/tlswidget.cpp
+++ b/muse/muse/arranger/tlswidget.cpp
@@ -193,7 +193,7 @@ void TLSWidget::configChanged()
// showControllerList
//---------------------------------------------------------
-void TLSWidget::showControllerList()
+bool TLSWidget::showControllerList()
{
Ctrl* c = ctrl();
int id;
@@ -205,10 +205,10 @@ void TLSWidget::showControllerList()
CtrlDialog cd(_ctrlTrack, id);
int rv = cd.exec();
if (rv != 1)
- return;
+ return false;
id = cd.curId();
if (id == CTRL_NO_CTRL)
- return;
+ return false;
if (id != CTRL_OTHER)
break;
ConfigMidiCtrl* mce = new ConfigMidiCtrl((MidiTrack*)_track);
@@ -216,19 +216,19 @@ void TLSWidget::showControllerList()
delete mce;
}
setCtrl(id);
+ return true;
}
//---------------------------------------------------------
// setCtrl
//---------------------------------------------------------
-void TLSWidget::setCtrl(int ctrl)
+bool TLSWidget::setCtrl(int ctrl)
{
if (ctrl == CTRL_NO_CTRL || ctrl == CTRL_OTHER) {
// this controller subtrack is new, ask user for
// controller:
- showControllerList();
- return;
+ return showControllerList();
}
if (_ctrlTrack && _ctrlTrack != _track) {
@@ -255,6 +255,7 @@ void TLSWidget::setCtrl(int ctrl)
ctrlList->setText(at->controller->name());
emit controllerChanged(ctrl);
}
+ return true;
}
//---------------------------------------------------------
diff --git a/muse/muse/arranger/tlswidget.h b/muse/muse/arranger/tlswidget.h
index 8f30a482..ccdfa3b8 100644
--- a/muse/muse/arranger/tlswidget.h
+++ b/muse/muse/arranger/tlswidget.h
@@ -58,7 +58,7 @@ class TLSWidget : public QWidget, public CtrlEditor {
private slots:
void labelMinusClicked();
- void showControllerList();
+ bool showControllerList();
void selectionChanged();
void configChanged();
void controllerListChanged(int);
@@ -74,7 +74,7 @@ class TLSWidget : public QWidget, public CtrlEditor {
TLSWidget(Track*, ArrangerTrack*, TimeCanvas* tc);
Track* track() const { return _track; }
Track* ctrlTrack() const { return _ctrlTrack; }
- void setCtrl(int ctrl);
+ bool setCtrl(int ctrl);
void setIdx(int n) { trackIdx = n; }
};
diff --git a/muse/muse/arranger/tlwidget.cpp b/muse/muse/arranger/tlwidget.cpp
index eff4d515..53c524b7 100644
--- a/muse/muse/arranger/tlwidget.cpp
+++ b/muse/muse/arranger/tlwidget.cpp
@@ -255,6 +255,7 @@ void TLWidget::configChanged()
label = new QLabel;
l->addWidget(label);
label->setIndent(3);
+ //label->setAlignment(Qt::AlignCener);
label->setFont(*config.fonts[1]);
label->setText(_track->cname());
@@ -627,10 +628,18 @@ void TLWidget::paintEvent(QPaintEvent* ev)
QRect r(ev->rect());
QColor color(_track->selected() ? selectBgColor : bgColor);
p.fillRect(r, color);
- paintHLine(p, r.x(), r.x() + r.width(), height() - splitWidth);
+
+ if (r==rect()) // only draw on full redraw
+ paintHLine(p, r.x(), r.x() + r.width(), height() - splitWidth);
QPalette pl = nameEdit->palette();
pl.setColor(QPalette::Window, color);
pl.setColor(QPalette::Base, color);
nameEdit->setPalette(pl);
+
+ // The selected track will get a 4 pixel red bar to the left
+ if ( _track->selected() && r==rect() /* only draw on full redraw */) {
+ QColor color(200,10,10);
+ QRect qr(0, 0, 4,r.height()-splitWidth);
+ p.fillRect(qr, color);
+ }
}
-
diff --git a/muse/muse/midifile.cpp b/muse/muse/midifile.cpp
index 7df44faa..e6eb051b 100644
--- a/muse/muse/midifile.cpp
+++ b/muse/muse/midifile.cpp
@@ -338,9 +338,9 @@ int MidiFile::readEvent(MidiEvent* event, MidiFileTrack* t)
event->setType(ME_SYSEX);
event->setData(buffer, len);
- if ((len == gmOnMsgLen) && memcmp(buffer, gmOnMsg, gmOnMsgLen) == 0)
+ if ((len == (signed)gmOnMsgLen) && memcmp(buffer, gmOnMsg, gmOnMsgLen) == 0)
_midiType = MT_GM;
- else if ((len == gsOnMsgLen) && memcmp(buffer, gsOnMsg, gsOnMsgLen) == 0)
+ else if ((len == (signed)gsOnMsgLen) && memcmp(buffer, gsOnMsg, gsOnMsgLen) == 0)
_midiType = MT_GS;
if (buffer[0] == 0x43) { // Yamaha
diff --git a/muse/muse/song.cpp b/muse/muse/song.cpp
index 1ab80764..888c4fe2 100644
--- a/muse/muse/song.cpp
+++ b/muse/muse/song.cpp
@@ -494,13 +494,13 @@ void Song::swapTracks(int i1, int i2)
//---------------------------------------------------------
// setTickPos
//---------------------------------------------------------
-
+/*
void Song::setTickPos(int idx, unsigned int tick)
{
Pos pos(tick);
setPos(idx, pos);
}
-
+*/
//---------------------------------------------------------
// setPos
// song->setPos(Song::CPOS, pos, true, true, true);
diff --git a/muse/muse/song.h b/muse/muse/song.h
index 40842a3f..00708d59 100644
--- a/muse/muse/song.h
+++ b/muse/muse/song.h
@@ -160,7 +160,7 @@ class Song : public QObject {
void setMeasureLen(int l);
void changePart(Part*, unsigned, unsigned);
void createLRPart(Track* track);
- void setTickPos(int, unsigned);
+ //void setTickPos(int, unsigned);
void setPos(int, const AL::Pos&);
void setPos(int, const AL::Pos&, bool sig, bool isSeek = true,
diff --git a/muse/muse/thread.cpp b/muse/muse/thread.cpp
index ea8de818..e2039248 100644
--- a/muse/muse/thread.cpp
+++ b/muse/muse/thread.cpp
@@ -79,7 +79,7 @@ void Thread::start(int prio, void* ptr)
}
int rv;
- if (rv = pthread_create(&thread, attributes, ::loop, this)) {
+ if ((rv = pthread_create(&thread, attributes, ::loop, this))) {
fprintf(stderr, "creating thread <%s> failed: %s\n",
_name, strerror(rv));
thread = 0;
@@ -222,7 +222,7 @@ void Thread::loop()
*/
if (debugMsg)
printf("Thread <%s, id %p> has %s priority %d\n",
- _name, pthread_self(), policy == SCHED_FIFO ? "SCHED_FIFO" : "SCHED_OTHER",
+ _name, (void *)pthread_self(), policy == SCHED_FIFO ? "SCHED_FIFO" : "SCHED_OTHER",
realTimePriority);
_running = true;
diff --git a/muse/muse/ticksynth.cpp b/muse/muse/ticksynth.cpp
index 4c8d037f..1d9b0c4a 100644
--- a/muse/muse/ticksynth.cpp
+++ b/muse/muse/ticksynth.cpp
@@ -91,10 +91,10 @@ class MetronomeSynthIF : public SynthIF
iMPEvent MetronomeSynthIF::getData(MPEventList* el, iMPEvent i, unsigned pos, int/*ports*/, unsigned n, float** buffer)
{
- int curPos = pos;
- int endPos = pos + n;
- int off = pos;
- int frameOffset = audio->getFrameOffset();
+ unsigned curPos = pos;
+ unsigned endPos = pos + n;
+ unsigned off = pos;
+ unsigned frameOffset = audio->getFrameOffset();
for (; i != el->end(); ++i) {
unsigned frame = i->time() - frameOffset;