Index: NetworkEditor/src/MainWindow.hxx
===================================================================
--- NetworkEditor/src/MainWindow.hxx (revision 11596)
+++ NetworkEditor/src/MainWindow.hxx (working copy)
@@ -101,6 +101,31 @@
QString backendLogo = ":/icons/images/editdelete.png"; // TODO: Change this icon
if (_networkPlayer) delete _networkPlayer;
_networkPlayer = 0;
+
+
+#ifdef USE_LADSPA
+ QAction * recompileFaustPluginsAction = new QAction(QIcon(":/icons/images/exec.png"),"Recompile Faust modules",this);
+ connect(recompileFaustPluginsAction, SIGNAL(triggered()),this, SLOT(onRecompileFaustRequest()));
+
+ QAction * reloadFaustPluginsAction = new QAction("Reload Faust modules",this);
+ connect(reloadFaustPluginsAction, SIGNAL(triggered()),this,SLOT(onReloadFaustPlugins()));
+
+ QAction * embedSvgDiagramsOptionAction = new QAction("Embed new SVG diagrams",this);
+ embedSvgDiagramsOptionAction->setCheckable(true);
+ connect(embedSvgDiagramsOptionAction, SIGNAL(changed()),this, SLOT(onOptionEmbedSvgDiagramsChanged()));
+// //_canvas, SLOT(setEmbedSVGDiagramsOption()));
+
+ QMenu * subMenuFaust = new QMenu();
+ subMenuFaust->addAction(recompileFaustPluginsAction);
+ subMenuFaust->addAction(reloadFaustPluginsAction);
+ subMenuFaust->addAction(embedSvgDiagramsOptionAction);
+ subMenuFaust->setIcon(QIcon(":/icons/images/faustlogo.svg"));
+ subMenuFaust->setTitle("Faust");
+ ui.menu_Interface->addMenu(subMenuFaust);
+
+
+#endif
+
#ifdef USE_JACK
CLAM::JACKNetworkPlayer * jackPlayer = new CLAM::JACKNetworkPlayer();
backend = "JACK";
@@ -142,8 +167,7 @@
connect(_processingTreeDock, SIGNAL(visibilityChanged(bool)), ui.action_Show_processing_toolbox, SLOT(setChecked(bool)));
connect(ui.action_Print, SIGNAL(triggered()), _canvas, SLOT(print()));
connect(_canvas, SIGNAL(changed()), this, SLOT(updateCaption()));
- connect(_canvas, SIGNAL(openFileWithExternalApplicationRequest()), this, SLOT(on_action_Processing_Open_File_With_External_Application_triggered()));
-// connect(_canvas, SIGNAL(editFileRequest()), this, SLOT(on_action_Processing_Launch_Editor_triggered()));
+ connect(_canvas, SIGNAL(openFileWithExternalApplicationRequest()), this, SLOT(onProcessingOpenFileWithExternalApplication()));
updateCaption();
}
@@ -272,7 +296,7 @@
void on_action_Online_tutorial_triggered()
{
QString helpUrl = "http://iua-share.upf.es/wikis/clam/index.php/Network_Editor_tutorial";
- emit on_action_Launch_Browser_triggered(helpUrl);
+ emit onLaunchBrowser(helpUrl);
}
void on_action_About_triggered()
{
@@ -412,6 +436,15 @@
" the network but changing the '.clamnetwork' extension to '.ui'
\n"
));
}
+
+
+ void onOptionEmbedSvgDiagramsChanged()
+ {
+ QAction *action = qobject_cast(sender());
+ if (!action) return;
+ _canvas->setEmbedSVGDiagramsOption(action->isChecked());
+ }
+
void on_action_Run_prototyper_triggered()
{
QMessageBox::warning(this, tr("Feature not implemented"),
@@ -421,7 +454,7 @@
));
}
- void on_action_Compile_Faust_triggered()
+ void onRecompileFaustRequest()
{
QMessageBox::warning(this, tr("Faust loading (incomplete feature)"),
tr(
@@ -482,15 +515,16 @@
std::cout << "\t...compiling done" << std::endl;
}
}
- on_action_Reload_Faust_Plugins_triggered(faustLoader);
+ onReloadFaustPlugins();
//#endif
#endif
}
- void on_action_Reload_Faust_Plugins_triggered(RunTimeFaustLibraryLoader & faustLibraryLoader)
+ //void onReloadFaustPlugins(RunTimeFaustLibraryLoader & faustLibraryLoader)
+ void onReloadFaustPlugins()
{
#if USE_LADSPA
-
+ RunTimeFaustLibraryLoader faustLibraryLoader;
faustLibraryLoader.Load();
// delete the previous instance of processingtree
delete(_processingTree);
@@ -513,13 +547,13 @@
}
- void on_action_Processing_Open_File_With_External_Application_triggered ()
+ void onProcessingOpenFileWithExternalApplication()
{
QString fileName="file://"+_canvas->getFileNameToOpenWithExternalApplication();
- on_action_Launch_Browser_triggered(fileName);
+ onLaunchBrowser(fileName);
}
- void on_action_Launch_Browser_triggered (QString & fileNameToBrowse) const
+ void onLaunchBrowser (QString & fileNameToBrowse) const
{
#if QT_VERSION >= 0x040200
std::cout << "opening "<(widget))->renderer();
if (!renderer->load(QString(svgDiagramFile.c_str())))
renderer->load(tr(":/icons/images/%1").arg(factory.GetValueFromAttribute(className,"icon").c_str()));
- widget->resize(renderer->defaultSize().width(),renderer->defaultSize().height());
-// widget->setMinimumSize(widget->size());
return widget;
}
#endif
Index: NetworkEditor/src/MainWindow.ui
===================================================================
--- NetworkEditor/src/MainWindow.ui (revision 11596)
+++ NetworkEditor/src/MainWindow.ui (working copy)
@@ -90,7 +90,6 @@
-
@@ -119,7 +118,6 @@
-
@@ -331,14 +329,6 @@
&Open
-
-
- :/icons/images/exec.png
-
-
- &Reload Faust modules
-
-
Index: NetworkEditor/src/NetworkCanvas.hxx
===================================================================
--- NetworkEditor/src/NetworkCanvas.hxx (revision 11596)
+++ NetworkEditor/src/NetworkCanvas.hxx (working copy)
@@ -415,6 +415,7 @@
_colorResizeHandle = colorResizeHandle;
_colorPort = colorPort;
}
+
private slots:
void onClearSelections()
{
@@ -917,6 +918,7 @@
: NetworkCanvas(parent)
, _network(0)
, _fileNameToOpen(0)
+ , _embedSVGDiagramsOption(false)
{
setWindowState(windowState() ^ Qt::WindowFullScreen);
@@ -1086,9 +1088,6 @@
}
-
-
-
virtual QWidget * embededWidgetFor(void * processing);
virtual unsigned nInports(void * processing) { return ((CLAM::Processing*)processing)->GetInPorts().Size();}
virtual unsigned nOutports(void * processing) { return ((CLAM::Processing*)processing)->GetOutPorts().Size();}
@@ -1431,7 +1430,12 @@
return 1;
}
+ void setEmbedSVGDiagramsOption (bool state=true)
+ {
+ _embedSVGDiagramsOption=state;
+ };
+
private slots:
void onCopyConnection()
{
@@ -1865,6 +1869,7 @@
private:
CLAM::Network * _network;
mutable QString _fileNameToOpen;
+ bool _embedSVGDiagramsOption;
};
Index: NetworkEditor/src/ProcessingBox.cxx
===================================================================
--- NetworkEditor/src/ProcessingBox.cxx (revision 11596)
+++ NetworkEditor/src/ProcessingBox.cxx (working copy)
@@ -118,6 +118,29 @@
if (minimumWidthsizeHint().isValid())
+ {
+ std::cout<<"minimum size: "<sizeHint().width();
+ const double embededHintHeight = _embeded->sizeHint().height();
+ std::cout<<"hint size: "<maximumEmbededWidth)
+ factor=(maximumEmbededWidth/embededHintWidth);
+ if (embededHintHeight>maximumEmbededHeight)
+ factor=std::min(factor,(maximumEmbededHeight/embededHintHeight));
+ minimumHeight=std::max(minimumHeight,(int)(embededHintHeight*factor));
+ minimumWidth=std::max(minimumWidth,(int)(embededHintWidth*factor));
+ std::cout<<"Factor: "<update();