Пример #1
0
int main(int argc, char *argv[]) 
{
#if defined(QTVIDEOSINK_PATH)
    //this allows the example to run from the QtGStreamer build tree without installing QtGStreamer
    setenv("GST_PLUGIN_PATH", QTVIDEOSINK_PATH, 0);
#endif
    
    QGst::init();

    qRegisterMetaType<GPSInfo>();
    
    GOOGLE_PROTOBUF_VERIFY_VERSION;

    // initialize resources, if needed
    // Q_INIT_RESOURCE(resfile);

    QApplication app(argc, argv);
    
    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));

    MainForm mainForm;
    mainForm.show();

    int result = app.exec();
    google::protobuf::ShutdownProtobufLibrary();
    QGst::cleanup();

    return result;
}
bool
DrStrangecodeRssReader::OnAppInitializing(AppRegistry& appRegistry)
{

	// Create a form
	MainForm *pMainForm = new MainForm();
	pMainForm->Initialize();
	pMainForm->SetName(kMainFormNameString);

	ItemForm * pItemForm = new ItemForm();
	pItemForm->Initialize();
	pItemForm->SetName(kItemFormNameString);

	// Add the form to the frame
	Frame *pFrame = GetAppFrame()->GetFrame();

	pFrame->AddControl(*pMainForm);
	pFrame->AddControl(*pItemForm);

	// Set the current form
	pFrame->SetCurrentForm(*pMainForm);

	// Draw and Show the form
	pMainForm->Draw();
	pMainForm->Show();

	return true;
}
Пример #3
0
int main( int argc, char ** argv )
{
    QApplication a( argc, argv );
    MainForm *w = new MainForm;
    w->show();
    return a.exec();
}
bool
UserInterface::OnAppInitializing(AppRegistry& appRegistry)
{
	// TODO:
	// Initialize UI resources and application specific data.
	// The application's permanent data and context can be obtained from the appRegistry.
	//
	// If this method is successful, return true; otherwise, return false.
	// If this method returns false, the application will be terminated.

	// Uncomment the following statement to listen to the screen on/off events.
	//PowerManager::SetScreenEventListener(*this);

	// Create a form
	MainForm *pMainForm = new MainForm();
	pMainForm->Initialize();

	// Add the form to the frame
	Frame *pFrame = GetAppFrame()->GetFrame();
	pFrame->AddControl(*pMainForm);

	// Set the current form
	pFrame->SetCurrentForm(*pMainForm);

	// Draw and Show the form
	pMainForm->Draw();
	pMainForm->Show();

	return true;
}
Пример #5
0
bool Instrument::unmapInstrument (void)
{
#ifdef CONFIG_MIDI_INSTRUMENT

	if (m_iMap < 0 || m_iBank < 0 || m_iProg < 0)
		return false;

	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return false;
	if (pMainForm->client() == NULL)
		return false;

	lscp_midi_instrument_t instr;

	instr.map  = m_iMap;
	instr.bank = (m_iBank & 0x0fff);
	instr.prog = (m_iProg & 0x7f);

	if (::lscp_unmap_midi_instrument(pMainForm->client(), &instr) != LSCP_OK) {
		pMainForm->appendMessagesClient("lscp_unmap_midi_instrument");
		return false;
	}

	return true;

#else

	return false;

#endif
}
Пример #6
0
// Instrument map name enumerator.
QStringList Instrument::getMapNames (void)
{
	QStringList maps;

	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return maps;
	if (pMainForm->client() == NULL)
		return maps;

#ifdef CONFIG_MIDI_INSTRUMENT
	int *piMaps = ::lscp_list_midi_instrument_maps(pMainForm->client());
	if (piMaps == NULL) {
		if (::lscp_client_get_errno(pMainForm->client()))
			pMainForm->appendMessagesClient("lscp_list_midi_instruments");
	} else {
		for (int iMap = 0; piMaps[iMap] >= 0; iMap++) {
			const QString& sMapName = getMapName(piMaps[iMap]);
			if (!sMapName.isEmpty())
				maps.append(sMapName);
		}
	}
#endif

	return maps;
}
Пример #7
0
// Browse and open an instrument file.
void InstrumentForm::openInstrumentFile (void)
{
	MainForm* pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return;

	Options *pOptions = pMainForm->options();
	if (pOptions == NULL)
		return;

	// FIXME: the instrument file filters should be restricted,
	// depending on the current engine.
	const QString& sEngineName = m_ui.EngineNameComboBox->currentText().toUpper();
	QStringList filters;
	if (sEngineName.contains("GIG"))
		filters << tr("GIG Instrument files") + " (*.gig *.dls)";
	if (sEngineName.contains("SFZ"))
		filters << tr("SFZ Instrument files") + " (*.sfz)";
	if (sEngineName.contains("SF2"))
		filters << tr("SF2 Instrument files") + " (*.sf2)";
	const QString& filter = filters.join(";;");

	QString sInstrumentFile = QFileDialog::getOpenFileName(this,
		QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption.
		pOptions->sInstrumentDir, // Start here.
		filter                    // File filter.
	);

	if (sInstrumentFile.isEmpty())
		return;

	m_ui.InstrumentFileComboBox->setEditText(sInstrumentFile);
	updateInstrumentName();
}
bool ChannelStrip::channelFxEdit (void)
{
	MainForm *pMainForm = MainForm::getInstance();
	if (!pMainForm || !channel())
		return false;

	pMainForm->appendMessages(QObject::tr("channel fx sends..."));

	bool bResult = false;

#if CONFIG_FXSEND
	ChannelFxForm *pChannelFxForm =
		new ChannelFxForm(channel(), parentWidget());
	if (pChannelFxForm) {
		//pChannelForm->setup(this);
		bResult = pChannelFxForm->exec();
		delete pChannelFxForm;
	}
#else // CONFIG_FXSEND
	QMessageBox::critical(this,
		QSAMPLER_TITLE ": " + tr("Unavailable"),
			tr("Sorry, QSampler was built without FX send support!\n\n"
			   "(Make sure you have a recent liblscp when recompiling QSampler)"));
#endif // CONFIG_FXSEND

	return bResult;
}
// Browse and open an instrument file.
void ChannelForm::openInstrumentFile (void)
{
	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return;
	if (pMainForm->client() == NULL)
		return;

	Options *pOptions = pMainForm->options();
	if (pOptions == NULL)
		return;

	// FIXME: the instrument file filters should be restricted,
	// depending on the current engine.
	QString sInstrumentFile = QFileDialog::getOpenFileName(this,
		QSAMPLER_TITLE ": " + tr("Instrument files"), // Caption.
		pOptions->sInstrumentDir,                 // Start here.
		tr("Instrument files") + " (*.gig *.dls)" // Filter (GIG and DLS files)
	);

	if (sInstrumentFile.isEmpty())
		return;

	m_ui.InstrumentFileComboBox->setEditText(sInstrumentFile);
	updateInstrumentName();
}
// Update whole channel usage state.
bool ChannelStrip::updateChannelUsage (void)
{
	if (m_pChannel == NULL)
		return false;

	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm->client() == NULL)
		return false;

	// This only makes sense on fully loaded channels...
	if (m_pChannel->instrumentStatus() < 100)
		return false;

	// Get current channel voice count.
	int iVoiceCount  = ::lscp_get_channel_voice_count(
		pMainForm->client(), m_pChannel->channelID());
// Get current stream count.
	int iStreamCount = ::lscp_get_channel_stream_count(
		pMainForm->client(), m_pChannel->channelID());
	// Get current channel buffer fill usage.
	// As benno has suggested this is the percentage usage
	// of the least filled buffer stream...
	int iStreamUsage = ::lscp_get_channel_stream_usage(
		pMainForm->client(), m_pChannel->channelID());;

	// Update the GUI elements...
	m_ui.StreamUsageProgressBar->setValue(iStreamUsage);
	m_ui.StreamVoiceCountTextLabel->setText(
		QString("%1 / %2").arg(iStreamCount).arg(iVoiceCount));

	// We're clean.
	return true;
}
// Show device options dialog.
void ChannelForm::setupDevice ( Device *pDevice,
	Device::DeviceType deviceTypeMode,
	const QString& sDriverName )
{
	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return;
	if (pMainForm->client() == NULL)
		return;

	// Create the device form if not already...
	if (m_pDeviceForm == NULL) {
		m_pDeviceForm = new DeviceForm(this, Qt::Dialog);
		m_pDeviceForm->setAttribute(Qt::WA_ShowModal);
		QObject::connect(m_pDeviceForm, SIGNAL(devicesChanged()),
			this, SLOT(updateDevices()));
	}

	// Refresh the device form with selected data.
	if (m_pDeviceForm) {
		m_pDeviceForm->setDeviceTypeMode(deviceTypeMode);
		m_pDeviceForm->refreshDevices();
		m_pDeviceForm->setDevice(pDevice);
		m_pDeviceForm->setDriverName(sDriverName);
		m_pDeviceForm->show();
	}
}
Пример #12
0
void Channel::appendMessagesColor( const QString& s,
	const QString& c ) const
{
	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm)
		pMainForm->appendMessagesColor(channelName() + ' ' + s, c);
}
Пример #13
0
// Instrument file loader.
bool Channel::loadInstrument ( const QString& sInstrumentFile, int iInstrumentNr )
{
	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return false;
	if (pMainForm->client() == NULL || m_iChannelID < 0)
		return false;
	if (!isInstrumentFile(sInstrumentFile))
		return false;
	if (m_iInstrumentStatus == 100 && m_sInstrumentFile == sInstrumentFile && m_iInstrumentNr == iInstrumentNr)
		return true;

	if (
		::lscp_load_instrument_non_modal(
			pMainForm->client(),
			qsamplerUtilities::lscpEscapePath(
				sInstrumentFile).toUtf8().constData(),
			iInstrumentNr, m_iChannelID
		) != LSCP_OK
	) {
		appendMessagesClient("lscp_load_instrument");
		return false;
	}

	appendMessages(QObject::tr("Instrument: \"%1\" (%2).")
		.arg(sInstrumentFile).arg(iInstrumentNr));

	return setInstrument(sInstrumentFile, iInstrumentNr);
}
Пример #14
0
    virtual bool OnInit(void) override
    {
        Application::InitializeBase();

        Url::Ptr pUrl;

        if (argc < 2) {
            wxConfig config("IcingaStudio");
            wxString wUrl;

            if (!config.Read("url", &wUrl))
                wUrl = "https://localhost:5665/";

            std::string url = wUrl.ToStdString();

            ConnectForm f(NULL, new Url(url));
            if (f.ShowModal() != wxID_OK)
                return false;

            pUrl = f.GetUrl();
            url = pUrl->Format(true);
            wUrl = url;
            config.Write("url", wUrl);
        } else {
            pUrl = new Url(argv[1].ToStdString());
        }

        MainForm *m = new MainForm(NULL, pUrl);
        m->Show();

        return true;
    }
Пример #15
0
int main(int argc, char *argv[]) {

    QApplication app(argc, argv);
    app.setApplicationName(APPLICATION_NAME);

//    for (int i = 0; i < QStyleFactory::keys().length(); i++) {
//        std::cout << QStyleFactory::keys().at(i).toStdString() << std::endl;
//    }
//    app.setStyle("Fusion");

    qRegisterMetaType<streamer::DownloadError>("streamer::DownloadError");
    qRegisterMetaType<streamer::MessageType>("streamer::MessageType");
    qRegisterMetaType<streamer::PlaybackCallbackType>("streamer::MPVCallbackType");
    qRegisterMetaType<streamer::DownloadInfo>("streamer::DownloadInfo");
    qRegisterMetaType<std::string>("std::string");
    qRegisterMetaType<std::list<std::string>>("std::list<std::string>");
    qRegisterMetaType<std::list<std::string>>("std::list<std::string>&");
    qRegisterMetaType<QTextBlock>("QTextBlock");
    qRegisterMetaType<QTextCursor>("QTextCursor");

    setlocale(LC_NUMERIC, "C"); // libmpv needs this :/


#if defined(MINGW)
    QIcon::setThemeName("icons");
#endif

    MainForm *form = new MainForm();
    form->show();

    if (form->disclaimer) {
        return 0;
    }
    return app.exec();
}
Пример #16
0
int main( int argc, char ** argv )
{
    QApplication a( argc, argv );
    MainForm w;
    w.show();
    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
    return a.exec();
}
Пример #17
0
int main(int argc, char *argv[])
{
	QApplication app(argc, argv);
	MainForm *mainform = new MainForm;
	app.setMainWidget(mainform); 
	mainform->show();
	return app.exec();
}
Пример #18
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainForm w;
    w.show();
    
    return a.exec();
}
Пример #19
0
Файл: main.cpp Проект: suma/hex
int main(int argc, char *argv[])
{
	HexApp app(argc, argv);
	QTextCodec::setCodecForLocale(QTextCodec::codecForLocale());
	MainForm *editor = new MainForm();
	editor->show();
	return app.exec();
}
Пример #20
0
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainForm mainForm;
    mainForm.showMaximized();
    mainForm.setFocus();
    return a.exec();
}
Пример #21
0
int main()
{
	MainForm mainForm;

	mainForm.Init();
	mainForm.CreateGUI();
	mainForm.Show();
}
Пример #22
0
void Options::sendFineTuningSettings() {
	setMaxVoices(iMaxVoices);
	setMaxStreams(iMaxStreams);

	MainForm *pMainForm = MainForm::getInstance();
	if (!pMainForm || !pMainForm->client())
		return;

	pMainForm->appendMessages(QObject::tr("Sent fine tuning settings."));
}
Пример #23
0
vector<int> StrokeGroup::Preclassification( ofstream& logFile)
{
if(nstrokes >= 1)
	{
  MainForm *sgobj = new MainForm();
  
  sgarraylist = sgobj->Annotate(strklist,logFile);
  }
return sgarraylist;

}
Пример #24
0
int Options::getEffectiveMaxStreams() {
#ifndef CONFIG_MAX_VOICES
	return -1;
#else
	MainForm *pMainForm = MainForm::getInstance();
	if (!pMainForm || !pMainForm->client())
		return -1;

	return ::lscp_get_streams(pMainForm->client());
#endif // CONFIG_MAX_VOICES
}
Пример #25
0
// Sync methods.
bool Instrument::mapInstrument (void)
{
#ifdef CONFIG_MIDI_INSTRUMENT

	MainForm *pMainForm = MainForm::getInstance();
	if (pMainForm == NULL)
		return false;
	if (pMainForm->client() == NULL)
		return false;

	if (m_iMap < 0 || m_iBank < 0 || m_iProg < 0)
		return false;

	lscp_midi_instrument_t instr;

	instr.map  = m_iMap;
	instr.bank = (m_iBank & 0x0fff);
	instr.prog = (m_iProg & 0x7f);

	lscp_load_mode_t load_mode;
	switch (m_iLoadMode) {
		case 3:
			load_mode = LSCP_LOAD_PERSISTENT;
			break;
		case 2:
			load_mode = LSCP_LOAD_ON_DEMAND_HOLD;
			break;
		case 1:
			load_mode = LSCP_LOAD_ON_DEMAND;
			break;
		case 0:
		default:
			load_mode = LSCP_LOAD_DEFAULT;
			break;
	}

	if (::lscp_map_midi_instrument(pMainForm->client(), &instr,
			m_sEngineName.toUtf8().constData(),
			qsamplerUtilities::lscpEscapePath(
				m_sInstrumentFile).toUtf8().constData(),
			m_iInstrumentNr, m_fVolume, load_mode,
			m_sName.toUtf8().constData()) != LSCP_OK) {
		pMainForm->appendMessagesClient("lscp_map_midi_instrument");
		return false;
	}

	return true;

#else

	return false;

#endif
}
Пример #26
0
int main(int argc, char *argv[])
{
    // initialize resources, if needed
    // Q_INIT_RESOURCE(resfile);

    QApplication app(argc, argv);

    MainForm mainForm;
    mainForm.show();

    return app.exec();
}
Пример #27
0
int main(int argc, char **argv) {
	QApplication app(argc, argv);
	
	QTranslator qtTranslator;
	qtTranslator.load("kboy_" + QLocale::system().name(), QDir::homePath()+"/.kboy/lang");
	app.installTranslator(&qtTranslator);

	MainForm dlg;
	dlg.show();
 
	return app.exec();
}
Пример #28
0
int main(int argc, char *argv[])
{
	#if _DEBUG
		AllocConsole();
	#endif

	argc =0;
	QApplication a(argc, NULL);
	MainForm w;
	w.show();

	return a.exec();	
}
Пример #29
0
int main( int argc, char **argv ) {
	QApplication app( argc, argv );
	QTextCodec::setCodecForCStrings( QTextCodec::codecForName("utf8:") );
	//QPixmap pixmap(":/img/projekt.jpg");
	//QSplashScreen splash(pixmap);
	//app.setWindowIcon(QIcon(":/img/projekt-ikon.png"));
	//splash.show();
	//splash.showMessage(QObject::tr("Startuji..."), Qt::AlignTop | Qt::AlignRight);
	MainForm mf;
//	mf.setColor();
	mf.show();
	//splash.finish(&mf);
	return app.exec();
}
Пример #30
0
int main()
{
	MainForm mainClient;

	mainClient.Init();

	mainClient.CreateGUI();

	mainClient.ShowModal();

	getchar();

	return 0;
}