From 5557b72e16dbb3eef5eab76363096d828cb734f6 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Sun, 16 Sep 2012 13:53:42 +0000 Subject: fixed some bugs, see ChangeLog --- muse2/ChangeLog | 4 + muse2/muse/arranger/tlist.cpp | 1 - muse2/muse/instruments/editinstrument.cpp | 8 +- muse2/muse/instruments/editinstrument.h | 2 +- muse2/muse/instruments/editinstrumentbase.ui | 14 +- muse2/muse/mixer/astrip.cpp | 38 +-- muse2/muse/mixer/astrip.h | 3 +- muse2/muse/mixer/rack.cpp | 5 +- muse2/muse/part.cpp | 5 +- muse2/muse/widgets/projectcreate.ui | 415 +++++++++++++++++++++++++++ muse2/muse/widgets/unusedwavefiles.cpp | 7 +- 11 files changed, 461 insertions(+), 41 deletions(-) diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 11b56da3..0ba1a672 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,7 @@ +16.09.2012: + - Fixed allocation error with drag&drop of plugins (rj) + - Fixed close menu alternative in Instrument editor (rj) + - Changed Aux name on strips to reflect the actual Aux strip name (rj) 09.09.2012: - Added instructions on how to record audio with MusE to the new manual (rj) 08.09.2012: diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 6f8837e8..9297e7a8 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -601,7 +601,6 @@ void TList::returnPressed() editTrack->name().toLatin1().constData(), editor->text().toLatin1().constData())); editTrack->setName(editor->text()); - //MusEGlobal::song->update(SC_TRACK_MODIFIED); //DELETETHIS MusEGlobal::song->endUndo(-1); //uagh, why "-1", why no proper flags? } } diff --git a/muse2/muse/instruments/editinstrument.cpp b/muse2/muse/instruments/editinstrument.cpp index 7205af9d..8378bd68 100644 --- a/muse2/muse/instruments/editinstrument.cpp +++ b/muse2/muse/instruments/editinstrument.cpp @@ -74,7 +74,7 @@ EditInstrument::EditInstrument(QWidget* parent, Qt::WFlags fl) fileOpenAction->setIcon(QIcon(*openIcon)); fileSaveAction->setIcon(QIcon(*saveIcon)); fileSaveAsAction->setIcon(QIcon(*saveasIcon)); - fileExitAction->setIcon(QIcon(*exitIcon)); + fileCloseAction->setIcon(QIcon(*exitIcon)); viewController->setSelectionMode(QAbstractItemView::SingleSelection); toolBar->addAction(QWhatsThis::createAction(this)); Help->addAction(QWhatsThis::createAction(this)); @@ -948,12 +948,12 @@ void EditInstrument::fileSaveAs() } //--------------------------------------------------------- -// fileExit +// fileClose //--------------------------------------------------------- -void EditInstrument::fileExit() +void EditInstrument::fileClose() { - + close(); } //--------------------------------------------------------- diff --git a/muse2/muse/instruments/editinstrument.h b/muse2/muse/instruments/editinstrument.h index 9e7af7d2..90745301 100644 --- a/muse2/muse/instruments/editinstrument.h +++ b/muse2/muse/instruments/editinstrument.h @@ -82,7 +82,7 @@ class EditInstrument : public QMainWindow, public Ui::EditInstrumentBase { virtual void fileOpen(); virtual void fileSave(); virtual void fileSaveAs(); - virtual void fileExit(); + virtual void fileClose(); virtual void helpWhatsThis(); void instrumentChanged(); void tabChanged(QWidget*); diff --git a/muse2/muse/instruments/editinstrumentbase.ui b/muse2/muse/instruments/editinstrumentbase.ui index 65bc007d..e1f935d5 100644 --- a/muse2/muse/instruments/editinstrumentbase.ui +++ b/muse2/muse/instruments/editinstrumentbase.ui @@ -1837,7 +1837,7 @@ Typically, set to 127/127, or an unused - + @@ -1909,18 +1909,18 @@ Typically, set to 127/127, or an unused fileSaveAsAction - + - E&xit + &Close - Exit + Close - fileExitAction + fileCloseAction @@ -2040,10 +2040,10 @@ Typically, set to 127/127, or an unused - fileExitAction + fileCloseAction activated() EditInstrumentBase - fileExit() + fileClose() -1 diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp index 49954a0c..a75968a1 100644 --- a/muse2/muse/mixer/astrip.cpp +++ b/muse2/muse/mixer/astrip.cpp @@ -664,7 +664,7 @@ void AudioStrip::updateChannels() // 1 - aux send //--------------------------------------------------------- -MusEGui::Knob* AudioStrip::addKnob(int type, int id, MusEGui::DoubleLabel** dlabel) +MusEGui::Knob* AudioStrip::addKnob(int type, int id, MusEGui::DoubleLabel** dlabel, QLabel *name) { MusEGui::Knob* knob = new MusEGui::Knob(this); knob->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); @@ -698,23 +698,20 @@ MusEGui::Knob* AudioStrip::addKnob(int type, int id, MusEGui::DoubleLabel** dlab } pl->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); - QString label; - if (type == 0) - label = tr("Pan"); - else - label.sprintf("Aux%d", id+1); - - QLabel* plb = new QLabel(label, this); - ///plb->setFont(MusEGlobal::config.fonts[1]); - plb->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); - plb->setAlignment(Qt::AlignCenter); - - grid->addWidget(plb, _curGridRow, 0); + // QString label; + // if (type == 0) + // label = tr("Pan"); + // else + // label = name; + + //QLabel* plb = new QLabel(label, this); + name->setParent(this); + name->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum)); + name->setAlignment(Qt::AlignCenter); + + grid->addWidget(name, _curGridRow, 0); grid->addWidget(pl, _curGridRow+1, 0); grid->addWidget(knob, _curGridRow, 1, 2, 1); - //grid->addWidget(plb, _curGridRow, 0, Qt::AlignCenter); - //grid->addWidget(pl, _curGridRow+1, 0, Qt::AlignCenter); - //grid->addWidget(knob, _curGridRow, 1, 2, 1, Qt::AlignCenter); _curGridRow += 2; connect(knob, SIGNAL(valueChanged(double,int)), pl, SLOT(setValue(double))); @@ -822,8 +819,11 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) int auxsSize = MusEGlobal::song->auxs()->size(); if (t->hasAuxSend()) { for (int idx = 0; idx < auxsSize; ++idx) { - MusEGui::DoubleLabel* al; - MusEGui::Knob* ak = addKnob(1, idx, &al); + MusEGui::DoubleLabel* al; // the thought was to aquire the correct Aux name for each Aux + // now they are only called Aux1, Aux2, which isn't too usable. + QLabel *name = new QLabel(((MusECore::Track*)(MusEGlobal::song->auxs()->at(idx)))->name(),this); + MusEGui::Knob* ak = addKnob(1, idx, &al, name); + auxKnob.push_back(ak); auxLabel.push_back(al); double val = MusECore::fast_log10(t->auxSend(idx))*20.0; @@ -895,7 +895,7 @@ AudioStrip::AudioStrip(QWidget* parent, MusECore::AudioTrack* at) // pan, balance //--------------------------------------------------- - pan = addKnob(0, 0, &panl); + pan = addKnob(0, 0, &panl, new QLabel("Pan", this)); pan->setValue(t->pan()); //--------------------------------------------------- diff --git a/muse2/muse/mixer/astrip.h b/muse2/muse/mixer/astrip.h index f995ce5e..81edc664 100644 --- a/muse2/muse/mixer/astrip.h +++ b/muse2/muse/mixer/astrip.h @@ -73,6 +73,7 @@ class AudioStrip : public Strip { QToolButton* stereo; QToolButton* pre; MusEGui::TransparentToolButton* off; + MusEGui::TransparentToolButton* showArr; double volume; double panVal; @@ -80,7 +81,7 @@ class AudioStrip : public Strip { //QToolButton* iR; //QToolButton* oR; - MusEGui::Knob* addKnob(int, int, MusEGui::DoubleLabel**); + MusEGui::Knob* addKnob(int, int, MusEGui::DoubleLabel**, QLabel *name); void updateOffState(); void updateVolume(); diff --git a/muse2/muse/mixer/rack.cpp b/muse2/muse/mixer/rack.cpp index f7a6d899..aa679d5f 100644 --- a/muse2/muse/mixer/rack.cpp +++ b/muse2/muse/mixer/rack.cpp @@ -587,11 +587,8 @@ void EffectRack::dropEvent(QDropEvent *event) if(event->mimeData()->hasFormat("text/x-muse-plugin")) { - char *tmpStr = new char[event->mimeData()->data("text/x-muse-plugin").size()]; - strcpy(tmpStr, event->mimeData()->data("text/x-muse-plugin").data()); - MusECore::Xml xml(tmpStr); + MusECore::Xml xml(event->mimeData()->data("text/x-muse-plugin").data()); initPlugin(xml, idx); - delete tmpStr; } else if (event->mimeData()->hasUrls()) diff --git a/muse2/muse/part.cpp b/muse2/muse/part.cpp index 9950c362..d270f6c0 100644 --- a/muse2/muse/part.cpp +++ b/muse2/muse/part.cpp @@ -742,13 +742,14 @@ Part::~Part() { if (_prevClone!=this || _nextClone!=this) { - printf("THIS MIGHT BE A HINT FOR BUGS: Part isn't unchained in ~Part()! i'll do that now. this is\n" + if (MusEGlobal::debugMsg) { + printf("THIS MIGHT BE A HINT FOR BUGS: Part isn't unchained in ~Part()! i'll do that now. this is\n" "not an actual bug, actually that manual unchain should be unneccessary if this was coded\n" "properly. but as it wasn't, and the unchain was always done manually, this might be an\n" "indicator that it have been forgotten. either your computer will explode in 3..2..1..now,\n" "or you can ignore this message.\n" "\n"); - + } unchainClone(this); } diff --git a/muse2/muse/widgets/projectcreate.ui b/muse2/muse/widgets/projectcreate.ui index 7d42628e..cc9c3ffe 100644 --- a/muse2/muse/widgets/projectcreate.ui +++ b/muse2/muse/widgets/projectcreate.ui @@ -161,6 +161,421 @@ + + + + + + + 0 + 0 + 0 + + + + + + + 220 + 220 + 220 + + + + + + + 255 + 255 + 255 + + + + + + + 237 + 237 + 237 + + + + + + + 110 + 110 + 110 + + + + + + + 147 + 147 + 147 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 220 + 220 + 220 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 237 + 237 + 237 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 220 + 220 + 220 + + + + + + + 255 + 255 + 255 + + + + + + + 237 + 237 + 237 + + + + + + + 110 + 110 + 110 + + + + + + + 147 + 147 + 147 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 220 + 220 + 220 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 237 + 237 + 237 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 110 + 110 + 110 + + + + + + + 220 + 220 + 220 + + + + + + + 255 + 255 + 255 + + + + + + + 237 + 237 + 237 + + + + + + + 110 + 110 + 110 + + + + + + + 147 + 147 + 147 + + + + + + + 110 + 110 + 110 + + + + + + + 255 + 255 + 255 + + + + + + + 110 + 110 + 110 + + + + + + + 220 + 220 + 220 + + + + + + + 220 + 220 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + 220 + 220 + 220 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + true diff --git a/muse2/muse/widgets/unusedwavefiles.cpp b/muse2/muse/widgets/unusedwavefiles.cpp index 729559fe..50417bb8 100644 --- a/muse2/muse/widgets/unusedwavefiles.cpp +++ b/muse2/muse/widgets/unusedwavefiles.cpp @@ -58,8 +58,9 @@ void UnusedWaveFiles::findWaveFiles() filter.append("*.ogg"); filter.append("*.flac"); allWaveFiles= dir.entryList(filter); - if (!allWaveFiles.count()) + if (allWaveFiles.count() == 0) return; + // get med files QStringList medFiles; if (ui->currentProjRadioButton->isChecked()) { @@ -69,6 +70,7 @@ void UnusedWaveFiles::findWaveFiles() QStringList medFilter("*.med"); medFiles = dir.entryList(medFilter); } + foreach (QString medFile, medFiles) { QString fname = MusEGlobal::museProject+"/"+ medFile; //printf("fopen %s\n", fname.toLatin1().data()); @@ -113,7 +115,8 @@ void UnusedWaveFiles::accept() // move the wca file if it exists QFileInfo wf(MusEGlobal::museProject + "/" + file); if (QFile::exists(MusEGlobal::museProject + "/" + wf.baseName()+".wca")) { - QFile::rename(MusEGlobal::museProject + "/" + wf.baseName()+".wca", MusEGlobal::museProject + "/unused/" +wf.baseName()+".wca"); + QFile::rename(MusEGlobal::museProject + "/" + wf.baseName()+".wca", + MusEGlobal::museProject + "/unused/" +wf.baseName()+".wca"); } } -- cgit v1.2.3