From 9c6c457618565fda91eb27b8ac6929d720531386 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Thu, 21 Apr 2011 21:21:22 +0000 Subject: dnd plugins --- muse2/ChangeLog | 3 +++ muse2/muse/mixer/rack.cpp | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/muse2/ChangeLog b/muse2/ChangeLog index 0a3f6c74..e90db090 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,6 @@ +21.04.2011: + - Fixed drag&drop plugin instantantiation (again), was using a string pointer to private data + now copies the data before use (rj) 19.04.2011: - Added undo/redo to master list editor for key editing, should implicitly mean that SC_KEY is emitted to detect song change (not tested) (rj) diff --git a/muse2/muse/mixer/rack.cpp b/muse2/muse/mixer/rack.cpp index afb8ae49..c2333e9d 100644 --- a/muse2/muse/mixer/rack.cpp +++ b/muse2/muse/mixer/rack.cpp @@ -417,6 +417,7 @@ void EffectRack::startDrag(int idx) xml.dump(xmlconf); QByteArray data(xmlconf.toLatin1().constData()); + //printf("sending %d [%s]\n", data.length(), xmlconf.toLatin1().constData()); QMimeData* md = new QMimeData(); md->setData("text/x-muse-plugin", data); @@ -482,9 +483,11 @@ void EffectRack::dropEvent(QDropEvent *event) if(event->mimeData()->hasFormat("text/x-muse-plugin")) { - QString outxml; - Xml xml(event->mimeData()->data("text/x-muse-plugin").data()); + char *tmpStr = new char[event->mimeData()->data("text/x-muse-plugin").size()]; + strcpy(tmpStr, event->mimeData()->data("text/x-muse-plugin").data()); + Xml xml(tmpStr); initPlugin(xml, idx); + delete tmpStr; } else if (event->mimeData()->hasUrls()) @@ -577,7 +580,9 @@ void EffectRack::initPlugin(Xml xml, int idx) if (tag == "plugin") { PluginI* plugi = new PluginI(); if (plugi->readConfiguration(xml, false)) { - printf("cannot instantiate plugin\n"); + //QString d; + //xml.dump(d); + //printf("cannot instantiate plugin [%s]\n", d.toLatin1().data()); delete plugi; } else { -- cgit v1.2.3 From 593be37c193d860113867c5aae0c3b241bc73528 Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Sat, 23 Apr 2011 22:43:59 +0000 Subject: key dropdown --- muse2/ChangeLog | 2 ++ muse2/muse/master/lmaster.cpp | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/muse2/ChangeLog b/muse2/ChangeLog index e90db090..a3e4706c 100644 --- a/muse2/ChangeLog +++ b/muse2/ChangeLog @@ -1,3 +1,5 @@ +24.04.2011: + - Improved master list editor editing of keys, dropdown should not 'stay behind' anymore (rj) 21.04.2011: - Fixed drag&drop plugin instantantiation (again), was using a string pointer to private data now copies the data before use (rj) diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp index 295dfb52..5c767060 100644 --- a/muse2/muse/master/lmaster.cpp +++ b/muse2/muse/master/lmaster.cpp @@ -79,10 +79,12 @@ QString keyToString(key_enum key) //flo case KEY_B_BEGIN: case KEY_B_END: printf("ILLEGAL FUNCTION CALL: keyToString called with key_sharp_begin etc.\n"); + return ""; break; default: printf("ILLEGAL FUNCTION CALL: keyToString called with illegal key value (not in enum)\n"); + return ""; } return keyStrs[index]; } @@ -457,8 +459,12 @@ void LMaster::itemPressed(QTreeWidgetItem* i, int column) if (editorColumn != column || editedItem != i) returnPressed(); } - else + else { + if (key_editor) + key_editor->hide(); + setFocus(); editorColumn = column; + } } //--------------------------------------------------------- @@ -514,9 +520,11 @@ void LMaster::itemDoubleClicked(QTreeWidgetItem* i) key_editor->addItems(keyStrs); } //key_editor->setText(editedItem->text(LMASTER_VAL_COL)); - key_editor->setCurrentIndex(keyStrs.indexOf(editedItem->text(LMASTER_VAL_COL))); + //key_editor->setCurrentIndex(keyStrs.indexOf(editedItem->text(LMASTER_VAL_COL))); + //key_editor->setCurrentIndex(-1); key_editor->setGeometry(itemRect); key_editor->show(); + key_editor->showPopup(); key_editor->setFocus(); //key_editor->selectAll(); connect(key_editor, SIGNAL(currentIndexChanged(int)), SLOT(returnPressed())); @@ -782,6 +790,7 @@ LMasterKeyEventItem::LMasterKeyEventItem(QTreeWidget* parent, const KeyEvent& ev setText(1, c2); setText(2, c3); setText(3, c4); + } -- cgit v1.2.3 From efac864c25429cdb853fba82484606f94fb6d4ec Mon Sep 17 00:00:00 2001 From: Robert Jonsson Date: Sat, 23 Apr 2011 23:44:22 +0000 Subject: don't warn samplerate for dummy audio --- muse2/muse/songfile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp index 7a690f74..3841a204 100644 --- a/muse2/muse/songfile.cpp +++ b/muse2/muse/songfile.cpp @@ -33,7 +33,7 @@ #include "wave.h" #include "midictrl.h" #include "amixer.h" -//#include "mixer/amixer.h" // p4.0.2 +#include "audiodev.h" #include "conf.h" #include "driver/jackmidi.h" #include "keyevent.h" @@ -1250,7 +1250,7 @@ void Song::read(Xml& xml) _follow = FollowMode(xml.parseInt()); else if (tag == "sampleRate") { int sRate = xml.parseInt(); - if (sRate != sampleRate) + if (audioDevice->deviceType() != AudioDevice::DUMMY_AUDIO && sRate != sampleRate) QMessageBox::warning(muse,"Wrong sample rate", "The sample rate in this project and the current system setting differs, the project may not work as intended!"); } else if (tag == "tempolist") { -- cgit v1.2.3