コード例 #1
0
//-----------------------------------------------
// constructor
//-----------------------------------------------
LLVoiceVisualizer::LLVoiceVisualizer( const U8 type )
:LLHUDEffect( type )
{
	mCurrentTime					= mTimer.getTotalSeconds();
	mPreviousTime					= mCurrentTime;
	mStartTime						= mCurrentTime;
	mVoiceSourceWorldPosition		= LLVector3( 0.0f, 0.0f, 0.0f );
	mSpeakingAmplitude				= 0.0f;
	mCurrentlySpeaking				= false;
	mVoiceEnabled					= false;
	mMinGesticulationAmplitude		= DEFAULT_MINIMUM_GESTICULATION_AMPLITUDE;
	mMaxGesticulationAmplitude		= DEFAULT_MAXIMUM_GESTICULATION_AMPLITUDE;
	mSoundSymbol.mActive			= true;
	mSoundSymbol.mPosition			= LLVector3( 0.0f, 0.0f, 0.0f );
	
	mTimer.reset();
	
	const char* sound_level_img[] = 
	{
		"voice_meter_dot.j2c",
		"voice_meter_rings.j2c",
		"voice_meter_rings.j2c",
		"voice_meter_rings.j2c",
		"voice_meter_rings.j2c",
		"voice_meter_rings.j2c",
		"voice_meter_rings.j2c"
	};

	for (int i=0; i<NUM_VOICE_SYMBOL_WAVES; i++)
	{
		mSoundSymbol.mWaveFadeOutStartTime	[i] = mCurrentTime;
		mSoundSymbol.mTexture				[i] = LLViewerTextureManager::getFetchedTextureFromFile(sound_level_img[i], FALSE, LLViewerTexture::BOOST_UI);
		mSoundSymbol.mWaveActive			[i] = false;
		mSoundSymbol.mWaveOpacity			[i] = 1.0f;
		mSoundSymbol.mWaveExpansion			[i] = 1.0f;
	}

	mSoundSymbol.mTexture[0]->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);

	// The first instance loads the initial state from prefs.
	if (!sPrefsInitialized)
	{
		setPreferences();
       
		// Set up our listener to get updates on all prefs values we care about.
		gSavedSettings.getControl("LipSyncEnabled")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
		gSavedSettings.getControl("LipSyncOohAahRate")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
		gSavedSettings.getControl("LipSyncOoh")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
		gSavedSettings.getControl("LipSyncAah")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
		gSavedSettings.getControl("LipSyncOohPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
		gSavedSettings.getControl("LipSyncAahPowerTransfer")->getSignal()->connect(boost::bind(&handleVoiceVisualizerPrefsChanged, _2));
		
		sPrefsInitialized = true;
	}

}//---------------------------------------------------
コード例 #2
0
// Start of snippet 5
void MiniBrowserWidget::pressGoButton()
{
    setUrl(mEditor->text());
    if (mOnline) {
        mWeb->load(QUrl(mUrl));
        mStopButton->setEnabled(true);
        }
    QStringList list;
    list.append("url");
    emit setPreferences(list);
}
コード例 #3
0
int OddcastWnd::onInit() {
	int retval = ODDCASTWND_PARENT::onInit();

	setPreferences( SUGGESTED_W, OC_WINDOW_WIDTH ); 
	setPreferences( SUGGESTED_H, OC_WINDOW_HEIGHT ); 
	setPreferences( MAXIMUM_W, OC_WINDOW_WIDTH ); 
	setPreferences( MAXIMUM_H, OC_WINDOW_HEIGHT ); 
	setPreferences( MINIMUM_W, OC_WINDOW_WIDTH ); 
	setPreferences( MINIMUM_H, OC_WINDOW_HEIGHT ); 

	api->core_addCallback(0, this);	// for on status change

	m_hInst = the->gethInstance(); //api->main_gethInstance();
	m_hWnd = gethWnd(); 


//	appcmds_addCmd("RLY", SRB_RELAY); 
	// Add your AppCmdI to the guiobjectwnd 
//	getGuiObject()->guiobject_addAppCmds(this); 

	m_vu_on_off = 0;
	transcode_init();
	setOggEncoderText("Winamp 3 DSP");
	setTimer(myTimer, myTimerDuration);
	return retval;
}
コード例 #4
0
PrintDialogController::PrintDialogController(QString symbol,QWidget *parent)
{
    setSymbol(symbol);
    setPrinter(new QPrinter(QPrinter::HighResolution));
    setSettings(new QSettings());
    setDocumentService(new DocumentServices());
    setSaveToPdf(false);
    setPrintReleated(false);
    setPrintAndSave(1);
    setPreferences(new SettingsPreferencesService());
    setManager(new PrintManager());
    setView(new PrintDialogView(parent,this));
    directories();
    restoreDefaultPrintPreferences();
}
コード例 #5
0
ファイル: main.c プロジェクト: idunham/dtextra
/* saves the text in the conversation window */
void fileMenuCall(Widget w, XtPointer clientData, XtPointer callData)
{
    int itemNum;

    itemNum = (int) clientData;
    switch (itemNum)
    {
    case 0:
	setPreferences(mainWindow);
	break;
    case 1:
	saveFile(mainWindow);
	break;
    case 2:
        quitApplication();
	break;
    default:
    	break;
    }
}
コード例 #6
0
ファイル: cmd_preferences.c プロジェクト: junwuwei/brltty
static int
handlePreferencesCommands (int command, void *data) {
  switch (command & BRL_MSK_CMD) {
    {
      static const char modeString_preferences[] = "prf";
      static Preferences savedPreferences;

    case BRL_CMD_PREFMENU: {
      int ok = 0;

      if (isSpecialScreen(SCR_MENU)) {
        if (prefs.saveOnExit) {
          if (savePreferences()) {
            alert(ALERT_COMMAND_DONE);
          }
        }

        deactivateSpecialScreen(SCR_MENU);
        ok = 1;
      } else if (activateSpecialScreen(SCR_MENU)) {
        updateSessionAttributes();
        savedPreferences = prefs;
        ok = 1;
      }

      if (ok) {
        infoMode = 0;
      } else {
        alert(ALERT_COMMAND_REJECTED);
      }

      break;
    }

    case BRL_CMD_PREFSAVE:
      if (isSpecialScreen(SCR_MENU)) {
        if (savePreferences()) alert(ALERT_COMMAND_DONE);
        deactivateSpecialScreen(SCR_MENU);
      } else if (savePreferences()) {
        alert(ALERT_COMMAND_DONE);
      } else {
        alert(ALERT_COMMAND_REJECTED);
      }
      break;

    case BRL_CMD_PREFLOAD:
      if (isSpecialScreen(SCR_MENU)) {
        setPreferences(&savedPreferences);
        message(modeString_preferences, gettext("changes discarded"), 0);
      } else if (loadPreferences()) {
        alert(ALERT_COMMAND_DONE);
      } else {
        alert(ALERT_COMMAND_REJECTED);
      }
      break;
    }

    default: {
      int arg = command & BRL_MSK_ARG;

      switch (command & BRL_MSK_BLK) {
        {
          MenuItem *item;

        case BRL_CMD_BLK(SET_TEXT_TABLE):
          item = getPreferencesMenuItem_textTable();
          goto doSetMenuItem;

        case BRL_CMD_BLK(SET_ATTRIBUTES_TABLE):
          item = getPreferencesMenuItem_attributesTable();
          goto doSetMenuItem;

        case BRL_CMD_BLK(SET_CONTRACTION_TABLE):
          item = getPreferencesMenuItem_contractionTable();
          goto doSetMenuItem;

        case BRL_CMD_BLK(SET_KEYBOARD_TABLE):
          item = getPreferencesMenuItem_keyboardTable();
          goto doSetMenuItem;

        case BRL_CMD_BLK(SET_LANGUAGE_PROFILE):
          item = getPreferencesMenuItem_languageProfile();
          goto doSetMenuItem;

        doSetMenuItem:
          if (item) {
            unsigned int count = brl.textColumns;

            if (count <= arg) count = arg + 1;
            changeMenuItem(item);

            if (changeMenuSettingScaled(getMenuItemMenu(item), arg, count)) {
              break;
            }
          }

          alert(ALERT_COMMAND_REJECTED);
          break;
        }

        default:
          return 0;
      }

      break;
    }
  }

  return 1;
}
コード例 #7
0
WebPageProxy* WebInspectorProxy::platformCreateInspectorPage()
{
    ASSERT(inspectedPage());
    ASSERT(!m_inspectorView);

    RefPtr<WebPreferences> preferences = WebPreferences::create(String(), "WebKit2.", "WebKit2.");
#ifndef NDEBUG
    // Allow developers to inspect the Web Inspector in debug builds without changing settings.
    preferences->setDeveloperExtrasEnabled(true);
    preferences->setLogsPageMessagesToSystemConsoleEnabled(true);
#endif
    preferences->setJavaScriptRuntimeFlags({
    });
    RefPtr<WebPageGroup> pageGroup = WebPageGroup::create(inspectorPageGroupIdentifier(), false, false);

    auto pageConfiguration = API::PageConfiguration::create();
    pageConfiguration->setProcessPool(&inspectorProcessPool(inspectionLevel()));
    pageConfiguration->setPreferences(preferences.get());
    pageConfiguration->setPageGroup(pageGroup.get());
    m_inspectorView = GTK_WIDGET(webkitWebViewBaseCreate(*pageConfiguration.ptr()));
    g_object_add_weak_pointer(G_OBJECT(m_inspectorView), reinterpret_cast<void**>(&m_inspectorView));

    WKPageUIClientV2 uiClient = {
        { 2, this },
        nullptr, // createNewPage_deprecatedForUseWithV0
        nullptr, // showPage
        nullptr, // closePage
        nullptr, // takeFocus
        nullptr, // focus
        nullptr, // unfocus
        nullptr, // runJavaScriptAlert
        nullptr, // runJavaScriptConfirm
        nullptr, // runJavaScriptPrompt
        nullptr, // setStatusText
        nullptr, // mouseDidMoveOverElement_deprecatedForUseWithV0
        nullptr, // missingPluginButtonClicked_deprecatedForUseWithV0
        nullptr, // didNotHandleKeyEvent
        nullptr, // didNotHandleWheelEvent
        nullptr, // areToolbarsVisible
        nullptr, // setToolbarsVisible
        nullptr, // isMenuBarVisible
        nullptr, // setMenuBarVisible
        nullptr, // isStatusBarVisible
        nullptr, // setStatusBarVisible
        nullptr, // isResizable
        nullptr, // setResizable
        nullptr, // getWindowFrame,
        nullptr, // setWindowFrame,
        nullptr, // runBeforeUnloadConfirmPanel
        nullptr, // didDraw
        nullptr, // pageDidScroll
        exceededDatabaseQuota,
        nullptr, // runOpenPanel,
        nullptr, // decidePolicyForGeolocationPermissionRequest
        nullptr, // headerHeight
        nullptr, // footerHeight
        nullptr, // drawHeader
        nullptr, // drawFooter
        nullptr, // printFrame
        nullptr, // runModal
        nullptr, // unused
        nullptr, // saveDataToFileInDownloadsFolder
        nullptr, // shouldInterruptJavaScript
        nullptr, // createPage
        nullptr, // mouseDidMoveOverElement
        nullptr, // decidePolicyForNotificationPermissionRequest
        nullptr, // unavailablePluginButtonClicked_deprecatedForUseWithV1
        nullptr, // showColorPicker
        nullptr, // hideColorPicker
        nullptr, // unavailablePluginButtonClicked
    };

    WebPageProxy* inspectorPage = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(m_inspectorView));
    ASSERT(inspectorPage);
    WKPageSetPageUIClient(toAPI(inspectorPage), &uiClient.base);

    return inspectorPage;
}
コード例 #8
0
ファイル: MainWindow.cpp プロジェクト: Huanglihan/cgal
  QObject::connect(this->actionShow_Axis, SIGNAL(toggled(bool)),
	   this->viewer, SLOT(toggleShowAxis(bool)));
  QObject::connect(this->actionShow_Vertex, SIGNAL(toggled(bool)),
	   this->viewer, SLOT(toggleShowVertex(bool)));
  QObject::connect(this->actionShow_DEdge, SIGNAL(toggled(bool)),
	   this->viewer, SLOT(toggleShowDEdge(bool)));
  QObject::connect(this->actionShow_VEdge, SIGNAL(toggled(bool)),
	   this->viewer, SLOT(toggleShowVEdge(bool)));
  QObject::connect(this->actionShow_Facet, SIGNAL(toggled(bool)),
	   this->viewer, SLOT(toggleShowFacet(bool)));
  QObject::connect(this->actionFlat, SIGNAL(toggled(bool)),
	   this->viewer, SLOT(toggleFlat(bool)));

  // Preferences
  QObject::connect(this->actionPreferences, SIGNAL(triggered()),
	   this->viewer, SLOT(setPreferences()));

  // Help menu actions
  QObject::connect(this->actionDemo_Help, SIGNAL(triggered()),
	   this->viewer, SLOT(help()));
  QObject::connect(this->actionAbout_T3_demo, SIGNAL(triggered()),
       this, SLOT(popupAboutDemo()));

  // Quit
  QObject::connect(this->actionQuit, SIGNAL(triggered()),
	   qApp, SLOT(closeAllWindows()));

  // Viewer signals
  QObject::connect(this, SIGNAL(sceneChanged()),
	   this->viewer, SLOT(updateGL()));
}