bool StyledButton::qt_property( int id, int f, QVariant* v)
{
    switch ( id - staticMetaObject()->propertyOffset() ) {
    case 0: switch( f ) {
	case 0: setColor(v->asColor()); break;
	case 1: *v = QVariant( this->color() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 1: switch( f ) {
	case 0: setPixmap(v->asPixmap()); break;
	case 1: if ( this->pixmap() ) *v = QVariant( *pixmap() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 2: switch( f ) {
	case 0: setEditor((EditorType&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->editor() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 3: switch( f ) {
	case 0: setScale(v->asBool()); break;
	case 1: *v = QVariant( this->scale(), 0 ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    default:
	return QButton::qt_property( id, f, v );
    }
    return TRUE;
}
Esempio n. 2
0
NitroSynth::NitroSynth(audioMasterCallback pCallback)
:	AudioEffectX(pCallback, 0, 128),
	fSamplePeriod(1.0f/44100.0f),
	bRecording(false),
	iRecorderState(IDLE)
{
	if ( pCallback )
	{
		setNumInputs(0);
		setNumOutputs(2);
		canProcessReplacing();
		isSynth();
		setUniqueID('SRTN');
	}

	for ( int i = 0 ; i < 8 ; i++ )
		if ( i < 6 )
			pInstruments[i] = new Instrument(new WaveDuty(), & pParameters[i]);
		else
			pInstruments[i] = new Instrument(new Noise(), & pParameters[i]);

#ifndef NO_VST_GUI
	setEditor(new NitroSynthInterface(this));
#endif // NO_VST_GUI
}
Esempio n. 3
0
ReadSiteconProto::ReadSiteconProto(const Descriptor& _desc, const QList<PortDescriptor*>& _ports, const QList<Attribute*>& _attrs ) 
: SiteconIOProto( _desc, _ports, _attrs ) {
    
    attrs << new Attribute(BaseAttributes::URL_IN_ATTRIBUTE(), BaseTypes::STRING_TYPE(), true);
    QMap<QString, PropertyDelegate*> delegateMap;
    delegateMap[BaseAttributes::URL_IN_ATTRIBUTE().getId()] = new URLDelegate(SiteconIO::getFileFilter(), SiteconIO::SITECON_ID, true, false, false);
    setEditor(new DelegateEditor(delegateMap));
    setIconPath(":sitecon/images/sitecon.png");
}
Esempio n. 4
0
AudioProcessorEditor* FilterNode::createEditor()
{
	FilterEditor* filterEditor = new FilterEditor(this);
	setEditor(filterEditor);
	
	std::cout << "Creating editor." << std::endl;

	return filterEditor;
}
Esempio n. 5
0
StyledButton::StyledButton(QWidget* parent, const char* name)
    : QButton( parent, name ), pix( 0 ), spix( 0 ), s( 0 ), formWindow( 0 ), mousePressed( false )
{
    setMinimumSize( minimumSizeHint() );
    setAcceptDrops( true );

    connect( this, SIGNAL(clicked()), SLOT(onEditor()));

    setEditor( ColorEditor );
}
Esempio n. 6
0
AudioProcessorEditor* AudioNode::createEditor()
{
	
	AudioEditor* editor = new AudioEditor(this);

	setEditor(editor);
	
	return editor; 

}
void DefaultComboBoxEditor::onCreate(const DefaultComboBoxEditor * Id)
{
	Inherited::onCreate(Id);

    if(Id != NULL && Id->getEditor() != NULL)
    {
        FieldContainerUnrecPtr FCCopy(Id->getEditor()->shallowCopy());
        setEditor(dynamic_pointer_cast<TextField>(FCCopy));
    }
}
Esempio n. 8
0
AudioProcessorEditor* SourceNode::createEditor()
{
	SourceNodeEditor* ed = new SourceNodeEditor(this, viewport);
	setEditor(ed);
	
	std::cout << "Creating editor." << std::endl;
	//filterEditor = new FilterEditor(this);
	return ed;

	//return 0;
}
Esempio n. 9
0
//------------------------------------------------------------------------------------
TutorialVST2Effect::TutorialVST2Effect (audioMasterCallback audioMaster)
: AudioEffectX (audioMaster, 1, kNumParameters)
{
	setUniqueID (CCONST('G', 'U', 'I', '0'));
	setNumInputs (2);
	setNumOutputs (2);
	parameters[kLeftVolumeParameter] = 1.f;
	parameters[kRightVolumeParameter] = 1.f;

	extern AEffGUIEditor* createEditor (AudioEffectX*);
	setEditor (createEditor (this));
}
Esempio n. 10
0
CQPropertyEditorMgr::
CQPropertyEditorMgr()
{
  setEditor("CAngle"   , new CQPropertyAngleEditor);
  setEditor("CLineDash", new CQPropertyLineDashEditor);
  setEditor("QColor"   , new CQPropertyColorEditor   );
  setEditor("QFont"    , new CQPropertyFontEditor    );
  setEditor("QPalette" , new CQPropertyPaletteEditor );
  setEditor("QPointF"  , new CQPropertyPointEditor   );
  setEditor("QSizeF"   , new CQPropertySizeFEditor   );
}
Esempio n. 11
0
bool FindDialog::qt_invoke( int _id, QUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: init(); break;
    case 1: destroy(); break;
    case 2: doFind(); break;
    case 3: setEditor((EditorInterface*)static_QUType_ptr.get(_o+1),(QObject*)static_QUType_ptr.get(_o+2)); break;
    case 4: languageChange(); break;
    default:
	return QDialog::qt_invoke( _id, _o );
    }
    return TRUE;
}
Esempio n. 12
0
WriteSiteconProto::WriteSiteconProto(const Descriptor& _desc, const QList<PortDescriptor*>& _ports, const QList<Attribute*>& _attrs ) 
: SiteconIOProto( _desc, _ports, _attrs ) {
    attrs << new Attribute(BaseAttributes::URL_OUT_ATTRIBUTE(), BaseTypes::STRING_TYPE(), true );
    attrs << new Attribute(BaseAttributes::FILE_MODE_ATTRIBUTE(), BaseTypes::NUM_TYPE(), false, SaveDoc_Roll);

    QMap<QString, PropertyDelegate*> delegateMap;
    delegateMap[BaseAttributes::URL_OUT_ATTRIBUTE().getId()] = new URLDelegate(SiteconIO::getFileFilter(), SiteconIO::SITECON_ID);
    delegateMap[BaseAttributes::FILE_MODE_ATTRIBUTE().getId()] = new FileModeDelegate(false);
    
    setEditor(new DelegateEditor(delegateMap));
    setIconPath(":sitecon/images/sitecon.png");
    setValidator(new ScreenedParamValidator(BaseAttributes::URL_OUT_ATTRIBUTE().getId(), ports.first()->getId(), BaseSlots::URL_SLOT().getId()));
    setPortValidator(SITECON_IN_PORT_ID, new ScreenedSlotValidator(BaseSlots::URL_SLOT().getId()));
}
Esempio n. 13
0
AudioProcessorEditor* LfpDisplayNode::createEditor()
{

	LfpDisplayEditor* editor = new LfpDisplayEditor(this);

	//editor->setBuffers (displayBuffer, eventBuffer);
	//editor->setUIComponent (getUIComponent());
	//editor->setConfiguration (config);
	//editor->updateNumInputs(getNumInputs());
	//editor->updateSampleRate(sampleRate);

	setEditor(editor);
	
	return editor;

}
Esempio n. 14
0
CompleterTextEditNumberBar::CompleterTextEditNumberBar(QTextEdit* edtr, QWidget* parent):
    QWidget(parent)
{
    markerWidth=16;
    linenumberColor=QColor("black");
    linenumberFont.setFamily("Courier New");
    linenumberFont.setPointSize(10);
    linenumberFont.setFixedPitch(true);
    linenumberColumnColor=QColor("gainsboro");
    markerColumnColor=QColor("darkgray");
    errorMarkerColor=QColor("red");
    warningMarkerColor=QColor("green");
    infoMarkerColor=QColor("blue");
    setEditor(edtr);
    setFixedWidth(fontMetrics().width(QString("0000") + markerWidth+4));
}
Esempio n. 15
0
QFCompleterTextEditNumberBar::QFCompleterTextEditNumberBar(QTextEdit* edtr, QWidget* parent):
    QWidget(parent)
{
    markerWidth=16;
    linenumberColor=QColor("black");
    linenumberFont.setFamily(ProgramOptions::getConfigValue("quickfit/code_font", "Hack").toString());
    linenumberFont.setPointSize(ProgramOptions::getConfigValue("quickfit/code_pointsize", 10).toInt());
    linenumberFont.setFixedPitch(true);
    linenumberColumnColor=QColor("gainsboro");
    markerColumnColor=QColor("darkgray");
    errorMarkerColor=QColor("red");
    warningMarkerColor=QColor("green");
    infoMarkerColor=QColor("blue");
    setEditor(edtr);
    setFixedWidth(fontMetrics().width(QString("0000") + markerWidth+4));
}
Esempio n. 16
0
AudioProcessorEditor* DisplayNode::createEditor()
{

    Visualizer* visualizer = new Visualizer(this, viewport, dataViewport);

    GenericProcessor* source = (GenericProcessor*) getSourceNode();


    visualizer->setBuffers(source->getContinuousBuffer(),source->getEventBuffer());
    visualizer->setUIComponent(getUIComponent());
    visualizer->setConfiguration(config);

    setEditor(visualizer);

    std::cout << "Creating visualizer." << std::endl;
    return visualizer;

}
Esempio n. 17
0
ZynWise::ZynWise(audioMasterCallback audioMaster) 
	: AudioEffectX(audioMaster, PROGRAMS_COUNT, kParamsCount)
{
    if (audioMaster) 
	{
		isSynth(true);
		programsAreChunks(true);
		setNumInputs(INPUTS_COUNT);
        setNumOutputs(OUTPUTS_COUNT);
        setUniqueID(VST_ID);
        canProcessReplacing();

		View *view = new MainView(this);
		view->SetData(&_zasf);
		_gui = new Gui(this, GUI_WIDTH, GUI_HEIGHT);
		_gui->SetView(view);
		setEditor(_gui);
    }
}
Esempio n. 18
0
void ComboBox::onCreate(const ComboBox * Id)
{
	Inherited::onCreate(Id);
    
    ListGeneratedPopupMenuUnrecPtr TheMenu(ListGeneratedPopupMenu::create());
    setComboListPopupMenu(TheMenu);
	
    if(Id != NULL)
    {
        if(Id->getExpandButton() != NULL)
        {
            FieldContainerUnrecPtr FCCopy(Id->getExpandButton()->shallowCopy());
            setExpandButton(dynamic_pointer_cast<ToggleButton>(FCCopy));
        }
        if(Id->getEditor() != NULL)
        {
            FieldContainerUnrecPtr FCCopy(Id->getEditor()->shallowCopy());
            setEditor(dynamic_pointer_cast<ComboBoxEditor>(FCCopy));
        }
    }
}
Esempio n. 19
0
void Spinner::setModel(SpinnerModelPtr model)
{
    _Model = model;
    setEditor(ComponentUnrecPtr(createEditor(_Model)));
}
DeclarationBuilder::DeclarationBuilder(EditorIntegrator* editor)
{
  setEditor(editor);
}
Esempio n. 21
0
Vst::Vst (audioMasterCallback audioMaster, bool asInstrument) :
    AudioEffectX (audioMaster, 128, 128),
    myApp(0),
    myHost(0),
    myWindow(0),
    bufferSize(0),
    listEvnts(0),
    hostSendVstEvents(false),
    hostSendVstMidiEvent(false),
    hostReportConnectionChanges(false),
    hostAcceptIOChanges(false),
    hostSendVstTimeInfo(false),
    hostReceiveVstEvents(false),
    hostReceiveVstMidiEvents(false),
    hostReceiveVstTimeInfo(false),
    opened(false),
    currentHostProg(0),
    chunkData(0)
{
    setNumInputs (DEFAULT_INPUTS*2);
    setNumOutputs (DEFAULT_OUTPUTS*2);

    if(asInstrument)
        setUniqueID (uniqueIDInstrument);
    else
        setUniqueID (uniqueIDEffect);

    isSynth(asInstrument);
    canProcessReplacing(true);
    programsAreChunks(true);
    vst_strncpy (programName, "Default", kVstMaxProgNameLen);	// default program name

    qRegisterMetaType<ConnectionInfo>("ConnectionInfo");
    qRegisterMetaType<ObjectInfo>("ObjectInfo");
    qRegisterMetaType<int>("ObjType::Enum");
    qRegisterMetaType<QVariant>("QVariant");
    qRegisterMetaType<AudioBuffer*>("AudioBuffer*");

    qRegisterMetaTypeStreamOperators<ObjectInfo>("ObjectInfo");

    QCoreApplication::setOrganizationName("CtrlBrk");
    QCoreApplication::setApplicationName("VstBoard");

#ifdef QT_NO_DEBUG
    if(qtTranslator.load("qt_" + QLocale::system().name(), ":/translations/"))
        qApp->installTranslator(&qtTranslator);
    if(commonTranslator.load("common_" + QLocale::system().name(), ":/translations/"))
        qApp->installTranslator(&commonTranslator);
    if(myappTranslator.load("vstboard_" + QLocale::system().name(), ":/translations/"))
        qApp->installTranslator(&myappTranslator);
#endif
    myHost = new MainHostVst(this,0,"plugin/");
    if(myHost->doublePrecision)
        canDoubleReplacing(true);
    connect(myHost, SIGNAL(DelayChanged(long)),
            this, SLOT(DelayChanged(long)));

    myWindow = new MainWindowVst(myHost);
    qEditor = new Gui(this);
    setEditor(qEditor);
    qEditor->SetMainWindow(myWindow);
}
Esempio n. 22
0
ScriptEditor::ScriptEditor(const QString& source, const QString& filename, int type) :
    ChildTab(NULL), ui(new Ui::ScriptEditor), m_language(ENGINE_QTSCRIPT), m_editor(NULL)
{
    ui->setupUi(this);

    m_exampleBtn = new QPushButton(this);
    m_exampleBtn->setToolTip(tr("Examples"));
    m_exampleBtn->setCheckable(true);
    m_exampleBtn->setIconSize(QSize(24, 24));
    m_exampleBtn->setIcon(QIcon(":/actions/info"));
    m_exampleBtn->setFlat(true);
    m_exampleBtn->setStyleSheet("padding: 3px;");

    m_settingsBtn = new QPushButton(this);
    m_settingsBtn->setToolTip(tr("Settings"));
    m_settingsBtn->setCheckable(true);
    m_settingsBtn->setIconSize(QSize(24, 24));
    m_settingsBtn->setIcon(QIcon(":/actions/system"));
    m_settingsBtn->setFlat(true);
    m_settingsBtn->setStyleSheet("padding: 3px;");

    QLabel *docLabel = new QLabel(this);
    docLabel->setTextFormat(Qt::RichText);
    docLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
    docLabel->setOpenExternalLinks(true);
    docLabel->setText(tr("<a href=\"http://technika.junior.cz/docs/Lorris/index.html\">Documentation</a>"));
    docLabel->setToolTip("http://technika.junior.cz/docs/Lorris/index.html");

    QToolBar *bar = new QToolBar(this);
    bar->setIconSize(QSize(24, 24));

    QAction *load = bar->addAction(QIcon(":/actions/open"), tr("Load"), this, SLOT(loadAct()));
    QAction *save = bar->addAction(QIcon(":/actions/save"), tr("Save"), this, SLOT(saveAct()));
    QAction *saveAs = bar->addAction(QIcon(":/actions/save-as"), tr("Save as..."), this, SLOT(saveAs()));
    bar->addSeparator();
    QAction *undo = bar->addAction(QIcon(":/actions/undo"), tr("Undo"), this, SIGNAL(undo()));
    QAction *redo = bar->addAction(QIcon(":/actions/redo"), tr("Redo"), this, SIGNAL(redo()));
    bar->addSeparator();
    QAction *apply = bar->addAction(QIcon(":/icons/start"), tr("Apply"), this, SLOT(applyAct()));
    bar->addSeparator();
    bar->addWidget(m_exampleBtn);
    bar->addWidget(m_settingsBtn);
    bar->addSeparator();
    bar->addWidget(docLabel);

    load->setShortcut(QKeySequence("Ctrl+O"));
    load->setToolTip(tr("Load (Ctrl+O)"));
    save->setShortcut(QKeySequence("Ctrl+S"));
    save->setToolTip(tr("Save (Ctrl+S)"));
    saveAs->setShortcut(QKeySequence("Ctrl+Shift+S"));
    saveAs->setToolTip(tr("Save as... (Ctrl+Shift+S)"));
    apply->setShortcut(QKeySequence("F5"));
    apply->setToolTip(tr("Apply (F5)"));

    connect(this, SIGNAL(undoAvailable(bool)), undo, SLOT(setEnabled(bool)));
    connect(this, SIGNAL(redoAvailable(bool)), redo, SLOT(setEnabled(bool)));

    ui->mainLayout->insertWidget(0, bar);

    quint32 editor_cfg = sConfig.get(CFG_QUINT32_SCRIPTEDITOR_TYPE);

#ifdef USE_KATE
    setEditor(EDITOR_KATE);
#elif defined(USE_QSCI)
    setEditor(EDITOR_QSCINTILLA);
#else
    setEditor(EDITOR_INTERNAL);
#endif

    if(editor_cfg != UINT_MAX)
        setEditor(editor_cfg);

    undo->setToolTip(tr("Undo (%1)").arg(m_editor->getUndoShortcut()));
    redo->setToolTip(tr("Redo (%1)").arg(m_editor->getRedoShortcut()));

    ui->resizeLine->setOrientation(false);
    ui->resizeLine->setResizeLayout(ui->mainLayout);
    ui->mainLayout->setStretch(ui->mainLayout->indexOf(ui->errorEdit), sConfig.get(CFG_QUINT32_SCRIPTEDITOR_STR));
    ui->mainLayout->setStretch(ui->mainLayout->indexOf(ui->errorEdit)-2, 100 - sConfig.get(CFG_QUINT32_SCRIPTEDITOR_STR));
    ui->resizeLine->updateStretch();

    m_errors = 0;
    m_ignoreFocus = false;

    m_editor->setText(source);
    m_changed = !source.isEmpty();

    setLanguage(type);

    connect(&m_status_timer, SIGNAL(timeout()), SLOT(clearStatus()));
    connect(qApp,   SIGNAL(focusChanged(QWidget*,QWidget*)), SLOT(focusChanged(QWidget*,QWidget*)));

    ui->errorBtn->setChecked(sConfig.get(CFG_BOOL_SHOW_SCRIPT_ERROR));
    on_errorBtn_toggled(ui->errorBtn->isChecked());

    setFilename(filename);
    m_contentChanged = false;
    m_fileChanged = false;
    checkChange();

    connect(m_exampleBtn,  SIGNAL(clicked()), SLOT(exampleBtn()));
    connect(m_settingsBtn, SIGNAL(clicked()), SLOT(settingsBtn()));
}