From: terminator356 <ter...@us...> - 2006-09-24 19:32:35
|
Update of /cvsroot/lmuse/muse/muse/mixer In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20843/muse/mixer Modified Files: Tag: REL07 rack.cpp rack.h strip.cpp Log Message: Index: rack.h =================================================================== RCS file: /cvsroot/lmuse/muse/muse/mixer/rack.h,v retrieving revision 1.5.2.2 retrieving revision 1.5.2.3 diff -C2 -d -r1.5.2.2 -r1.5.2.3 *** rack.h 11 Feb 2006 22:21:21 -0000 1.5.2.2 --- rack.h 24 Sep 2006 19:32:31 -0000 1.5.2.3 *************** *** 46,49 **** --- 46,52 ---- EffectRack(QWidget*, AudioTrack* t); ~EffectRack(); + + AudioTrack* getTrack() { return track; } + QPoint getDragPos() { return dragPos; } }; Index: strip.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/mixer/strip.cpp,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** strip.cpp 17 Apr 2004 11:30:43 -0000 1.6 --- strip.cpp 24 Sep 2006 19:32:31 -0000 1.6.2.1 *************** *** 85,89 **** switch(track->type()) { case Track::AUDIO_OUTPUT: ! label->setBackgroundColor(white); break; case Track::AUDIO_GROUP: --- 85,89 ---- switch(track->type()) { case Track::AUDIO_OUTPUT: ! label->setBackgroundColor(green); break; case Track::AUDIO_GROUP: *************** *** 94,98 **** break; case Track::WAVE: ! label->setBackgroundColor(green); break; case Track::AUDIO_INPUT: --- 94,98 ---- break; case Track::WAVE: ! label->setBackgroundColor(magenta); break; case Track::AUDIO_INPUT: Index: rack.cpp =================================================================== RCS file: /cvsroot/lmuse/muse/muse/mixer/rack.cpp,v retrieving revision 1.7.2.5 retrieving revision 1.7.2.6 diff -C2 -d -r1.7.2.5 -r1.7.2.6 *** rack.cpp 19 Sep 2006 19:07:10 -0000 1.7.2.5 --- rack.cpp 24 Sep 2006 19:32:31 -0000 1.7.2.6 *************** *** 150,154 **** } ! enum { NEW, UP, DOWN, REMOVE, BYPASS, SHOW, SAVE }; QPopupMenu* menu = new QPopupMenu; menu->insertItem(QIconSet(*upIcon), tr("move up"), UP, UP); --- 150,154 ---- } ! enum { NEW, CHANGE, UP, DOWN, REMOVE, BYPASS, SHOW, SAVE }; QPopupMenu* menu = new QPopupMenu; menu->insertItem(QIconSet(*upIcon), tr("move up"), UP, UP); *************** *** 171,175 **** } else { ! menu->insertItem(tr("change"), NEW, NEW); menu->insertItem(tr("save preset"), SAVE, SAVE); if (idx == 0) --- 171,175 ---- } else { ! menu->insertItem(tr("change"), CHANGE, CHANGE); menu->insertItem(tr("save preset"), SAVE, SAVE); if (idx == 0) *************** *** 191,195 **** PluginI* plugi = new PluginI(); if (plugi->initPluginInstance(plugin, track->channels())) { ! printf("cannot intantiate plugin <%s>\n", plugin->name().latin1()); delete plugi; --- 191,195 ---- PluginI* plugi = new PluginI(); if (plugi->initPluginInstance(plugin, track->channels())) { ! printf("cannot instantiate plugin <%s>\n", plugin->name().latin1()); delete plugi; *************** *** 200,203 **** --- 200,219 ---- break; } + case CHANGE: + { + Plugin* plugin = PluginDialog::getPlugin(this); + if (plugin) { + PluginI* plugi = new PluginI(); + if (plugi->initPluginInstance(plugin, track->channels())) { + printf("cannot instantiate plugin <%s>\n", + plugin->name().latin1()); + delete plugi; + break; + } + audio->msgAddPlugin(track, idx, 0); + audio->msgAddPlugin(track, idx, plugi); + } + break; + } case REMOVE: audio->msgAddPlugin(track, idx, 0); *************** *** 332,335 **** --- 348,367 ---- if (pipe) { if ((*pipe)[idx] != NULL) { + QWidget *sw = event->source(); + if(sw) + { + if(strcmp(sw->className(), "EffectRack") == 0) + { + EffectRack *ser = (EffectRack*)sw; + Pipeline* spipe = ser->getTrack()->efxPipe(); + if(!spipe) + return; + QListBoxItem *i = ser->itemAt(contentsToViewport(ser->getDragPos())); + int idx0 = ser->index(i); + if (!(*spipe)[idx0] || + (idx == idx0 && (ser == this || ser->getTrack()->name() == track->name()))) + return; + } + } if(!QMessageBox::question(this, tr("Replace effect"),tr("Do you really want to replace the effect %1?").arg(pipe->name(idx)), tr("&Yes"), tr("&No"), *************** *** 391,394 **** --- 423,434 ---- { if (event->state() & LeftButton) { + Pipeline* pipe = track->efxPipe(); + if(!pipe) + return; + QListBoxItem *i = itemAt(contentsToViewport(dragPos)); + int idx0 = index(i); + if (!(*pipe)[idx0]) + return; + int distance = (dragPos-event->pos()).manhattanLength(); if (distance > QApplication::startDragDistance()) { |