예제 #1
0
void CSMTools::MagicEffectCheckStage::perform(int stage, CSMDoc::Messages &messages)
{
    const CSMWorld::Record<ESM::MagicEffect> &record = mMagicEffects.getRecord(stage);

    // Skip "Base" records (setting!) and "Deleted" records
    if ((mIgnoreBaseRecords && record.mState == CSMWorld::RecordBase::State_BaseOnly) || record.isDeleted())
        return;

    ESM::MagicEffect effect = record.get();
    CSMWorld::UniversalId id(CSMWorld::UniversalId::Type_MagicEffect, effect.mId);
    
    if (effect.mData.mBaseCost < 0.0f)
    {
        messages.push_back(std::make_pair(id, "Base Cost is negative"));
    }

    if (effect.mIcon.empty())
    {
        messages.push_back(std::make_pair(id, "Icon is not specified"));
    }
    else if (!isTextureExists(effect.mIcon, true))
    {
        messages.push_back(std::make_pair(id, "No such Icon '" + effect.mIcon + "'"));
    }

    if (!effect.mParticle.empty() && !isTextureExists(effect.mParticle, false))
    {
        messages.push_back(std::make_pair(id, "No such Particle '" + effect.mParticle + "'"));
    }

    addMessageIfNotEmpty(messages, 
                         id, 
                         checkReferenceable(effect.mCasting, CSMWorld::UniversalId::Type_Static, "Casting Object"));
    addMessageIfNotEmpty(messages, 
                         id,
                         checkReferenceable(effect.mHit, CSMWorld::UniversalId::Type_Static, "Hit Object"));
    addMessageIfNotEmpty(messages,
                         id,
                         checkReferenceable(effect.mArea, CSMWorld::UniversalId::Type_Static, "Area Object"));
    addMessageIfNotEmpty(messages,
                         id,
                         checkReferenceable(effect.mBolt, CSMWorld::UniversalId::Type_Weapon, "Bolt Object"));

    addMessageIfNotEmpty(messages, id, checkSound(effect.mCastSound, "Casting Sound"));
    addMessageIfNotEmpty(messages, id, checkSound(effect.mHitSound, "Hit Sound"));
    addMessageIfNotEmpty(messages, id, checkSound(effect.mAreaSound, "Area Sound"));
    addMessageIfNotEmpty(messages, id, checkSound(effect.mBoltSound, "Bolt Sound"));

    if (effect.mDescription.empty())
    {
        messages.push_back(std::make_pair(id, "Description is empty"));
    }
}
예제 #2
0
static PyObject *
ImpulseResponse_new(PyTypeObject* type, PyObject* args, PyObject* kwds)
{
	ImpulseResponseP* self = (ImpulseResponseP*)type->tp_alloc(type, 0);

	if(self != nullptr)
	{
		PyObject* object;
		if(!PyArg_ParseTuple(args, "O:sound", &object))
			return nullptr;
		Sound* sound = checkSound(object);

		try
		{
			self->impulseResponse = new std::shared_ptr<aud::ImpulseResponse>(new aud::ImpulseResponse(std::make_shared<aud::StreamBuffer>(*reinterpret_cast<std::shared_ptr<aud::ISound>*>(sound->sound))));
		}
		catch(aud::Exception& e)
		{
			Py_DECREF(self);
			PyErr_SetString(AUDError, e.what());
			return nullptr;
		}
	}

	return (PyObject *)self;
}
예제 #3
0
SoundPlugin::SoundPlugin(unsigned base, bool bFirst, Buffer *config)
        : Plugin(base)
{
    load_data(soundData, &data, config);
    soundPlugin = this;
    user_data_id = getContacts()->registerUserData(info.title, soundUserData);

    m_bChanged = false;

    CmdSoundDisable   = registerType();
    EventSoundChanged = registerType();

    Command cmd;
    cmd->id		 = user_data_id + 1;
    cmd->text	 = I18N_NOOP("&Sound");
    cmd->icon	 = "sound";
    cmd->icon_on  = NULL;
    cmd->param	 = (void*)getSoundSetup;
    Event e(EventAddPreferences, cmd);
    e.process();

    cmd->id		  = CmdSoundDisable;
    cmd->text	  = I18N_NOOP("&Sound");
    cmd->icon	  = "nosound";
    cmd->icon_on  = "sound";
    cmd->bar_id   = ToolBarMain;
    cmd->bar_grp  = 0;
    cmd->menu_id  = 0;
    cmd->menu_grp = 0;
    cmd->flags	  = COMMAND_CHECK_STATE;
    Event eCmd(EventCommandCreate, cmd);
    eCmd.process();

    cmd->icon	  = NULL;
    cmd->icon_on  = NULL;
    cmd->bar_id   = 0;
    cmd->menu_id  = MenuMain;
    cmd->flags	  = COMMAND_CHECK_STATE;
    eCmd.process();

    Event ePlugin(EventGetPluginInfo, (void*)"_core");
    pluginInfo *info = (pluginInfo*)(ePlugin.process());
    core = static_cast<CorePlugin*>(info->plugin);

    m_sound	 = NULL;
#ifndef WIN32
    m_player = 0;
    connect(ExecManager::manager, SIGNAL(childExited(int,int)), this, SLOT(childExited(int,int)));
#endif
    m_checkTimer = new QTimer(this);
    connect(m_checkTimer, SIGNAL(timeout()), this, SLOT(checkSound()));
    if (bFirst)
        playSound(getStartUp());
}
예제 #4
0
void OSystem_Dreamcast::delayMillis(uint msecs)
{
  getMillis();
  unsigned int t, start = Timer();
  int time = (((unsigned int)msecs)*3125U)>>6;
  while (((int)((t = Timer())-start))<time) {
    if (_timerManager != NULL)
      ((DefaultTimerManager *)_timerManager)->handler();
    checkSound();
  }
  getMillis();
}
예제 #5
0
QWidget* AttentionPlugin::options() {
    if(!enabled) {
        return nullptr;
    }
    options_ = new QWidget();
    ui_.setupUi(options_);

    ui_.tb_open->setIcon(icoHost->getIcon("psi/browse"));
    ui_.tb_test->setIcon(icoHost->getIcon("psi/play"));

    connect(ui_.tb_open, SIGNAL(clicked()), SLOT(getSound()));
    connect(ui_.tb_test, SIGNAL(clicked()), SLOT(checkSound()));

    restoreOptions();

    return options_;
}
예제 #6
0
QWidget* GmailNotifyPlugin::options()
{
	if (!enabled)
		return 0;

	options_ = new QWidget;
	ui_.setupUi(options_);
	restoreOptions();

	ui_.tb_check->setIcon(iconHost->getIcon("psi/play"));
	ui_.tb_open->setIcon(iconHost->getIcon("psi/browse"));
	ui_.tb_open_prog->setIcon(iconHost->getIcon("psi/browse"));

	connect(ui_.tb_check, SIGNAL(clicked()), SLOT(checkSound()));
	connect(ui_.tb_open, SIGNAL(clicked()), SLOT(getSound()));
	connect(ui_.cb_accounts, SIGNAL(currentIndexChanged(int)), SLOT(updateOptions(int)));
	connect(ui_.tb_open_prog, SIGNAL(clicked()), SLOT(getProg()));

	return options_;
}
예제 #7
0
static PyObject *
DynamicMusic_addScene(DynamicMusicP* self, PyObject* args)
{
	PyObject* object;
	if(!PyArg_Parse(args, "O:sound", &object))
		return nullptr;

	Sound* sound = checkSound(object);
	if(!sound)
		return nullptr;

	try
	{
		return Py_BuildValue("i", (*reinterpret_cast<std::shared_ptr<aud::DynamicMusic>*>(self->dynamicMusic))->addScene(*reinterpret_cast<std::shared_ptr<aud::ISound>*>(sound->sound)));
	}
	catch(aud::Exception& e)
	{
		PyErr_SetString(AUDError, e.what());
		return nullptr;
	}
}
예제 #8
0
static PyObject *
DynamicMusic_addTransition(DynamicMusicP* self, PyObject* args)
{
	PyObject* object;
	int ini, end;
	if(!PyArg_ParseTuple(args, "iiO:sound", &ini, &end, &object))
		return nullptr;
	Sound* sound = checkSound(object);
	if(!sound)
		return nullptr;

	try
	{
		(*reinterpret_cast<std::shared_ptr<aud::DynamicMusic>*>(self->dynamicMusic))->addTransition(ini, end, *reinterpret_cast<std::shared_ptr<aud::ISound>*>(sound->sound));
		Py_RETURN_NONE;
	}
	catch(aud::Exception& e)
	{
		PyErr_SetString(AUDError, e.what());
		return nullptr;
	}
}
예제 #9
0
void ResourceManager::fireSound(const char* name) {
	if (!checkSound()) return;
    CIwResGroup* resGroup = IwGetResManager()->GetGroupNamed(SOUND_GROUP);
	CIwSoundSpec* SoundSpec = (CIwSoundSpec*)resGroup->GetResNamed(name, IW_SOUND_RESTYPE_SPEC);
	CIwSoundInst* SoundInstance = SoundSpec->Play();
}
예제 #10
0
파일: Phone.cpp 프로젝트: TylerOderkirk/ihu
void Phone::cancelCall(int callId)
{
//	qWarning(QString("Phone::cancelCall(%1)").arg(callId));
	checkSound();
	emit cancelCallSignal(callId);
}