• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ createChannel函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中createChannel函数的典型用法代码示例。如果您正苦于以下问题:C++ createChannel函数的具体用法?C++ createChannel怎么用?C++ createChannel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了createChannel函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

int main( int argc, char** argv )
{
    osgAnimation::Bone* bone0 = createBone( "bone0", osg::Vec3(0.0,0.0,0.0) );
    osgAnimation::Bone* bone1 = createBone( "bone1", osg::Vec3(1.0,0.0,0.0) );
    osgAnimation::Bone* bone2 = createBone( "bone2", osg::Vec3(1.0,0.0,0.0) );

    osg::ref_ptr<osgAnimation::Skeleton> skelroot = new osgAnimation::Skeleton;
    skelroot->setDefaultUpdateCallback();
    skelroot->addChild( bone0 );
    bone0->addChild( bone1 );
    bone1->addChild( bone2 );

    osg::ref_ptr<osgAnimation::Animation> anim = new osgAnimation::Animation;
    anim->setPlaymode( osgAnimation::Animation::PPONG );
    anim->addChannel( createChannel("bone1", osg::PI_2) );
    anim->addChannel( createChannel("bone2", osg::PI_2) );

    osg::ref_ptr<osgAnimation::BasicAnimationManager> manager = new osgAnimation::BasicAnimationManager;
    manager->registerAnimation( anim.get() );
    manager->playAnimation( anim.get() );

    osg::ref_ptr<osg::Group> root = new osg::Group;
    root->addChild( skelroot.get() );
    root->setUpdateCallback( manager.get() );

    osgViewer::Viewer viewer;
    viewer.setSceneData( root.get() );
    return viewer.run();
}
开发者ID:seafengl,项目名称:osgenginebook,代码行数:29,代码来源:skeleton.cpp


示例2: getChannel

ChannelList Chat::getChannelList(Player* player)
{
  ChannelList list;
  NormalChannelMap::iterator itn;
  PrivateChannelMap::iterator it;
  bool gotPrivate = false;

  // If has guild
  if(player->getGuildId() && player->getGuildName().length()){
    ChatChannel *channel = getChannel(player, CHANNEL_GUILD);

    if(channel)
      list.push_back(channel);
    else if((channel = createChannel(player, CHANNEL_GUILD)))
      list.push_back(channel);
  }

  if(player->getParty()){
    ChatChannel *channel = getChannel(player, CHANNEL_PARTY);

    if(channel)
      list.push_back(channel);
    else if((channel = createChannel(player, CHANNEL_PARTY)))
      list.push_back(channel);
  }

  for(itn = m_normalChannels.begin(); itn != m_normalChannels.end(); ++itn){
    if(!player->hasFlag(PlayerFlag_CannotBeMuted)){
      if(itn->first == CHANNEL_TRADE && player->getVocationId() == 0)
        continue;
      if(itn->first == CHANNEL_TRADE_ROOK && player->getVocationId() != 0)
        continue;
    }

    ChatChannel *channel = itn->second;
    list.push_back(channel);
  }

  for(it = m_privateChannels.begin(); it != m_privateChannels.end(); ++it){
    PrivateChatChannel* channel = it->second;

    if(channel){
      if(channel->isInvited(player))
        list.push_back(channel);

      if(channel->getOwner() == player->getGUID())
        gotPrivate = true;
    }
  }

  if(!gotPrivate)
    list.push_front(dummyPrivate);

  return list;
}
开发者ID:OMARTINEZ210,项目名称:server,代码行数:55,代码来源:chat.cpp


示例3: getChannel

ChannelList Chat::getChannelList(const Player& player)
{
	ChannelList list;
	if (player.getGuild()) {
		ChatChannel* channel = getChannel(player, CHANNEL_GUILD);
		if (channel) {
			list.push_back(channel);
		} else {
			channel = createChannel(player, CHANNEL_GUILD);
			if (channel) {
				list.push_back(channel);
			}
		}
	}

	if (player.getParty()) {
		ChatChannel* channel = getChannel(player, CHANNEL_PARTY);
		if (channel) {
			list.push_back(channel);
		} else {
			channel = createChannel(player, CHANNEL_PARTY);
			if (channel) {
				list.push_back(channel);
			}
		}
	}

	for (const auto& it : normalChannels) {
		ChatChannel* channel = getChannel(player, it.first);
		if (channel) {
			list.push_back(channel);
		}
	}

	bool hasPrivate = false;
	for (const auto& it : privateChannels) {
		if (PrivateChatChannel* channel = it.second) {
			uint32_t guid = player.getGUID();
			if (channel->isInvited(guid)) {
				list.push_back(channel);
			}

			if (channel->getOwner() == guid) {
				hasPrivate = true;
			}
		}
	}

	if (!hasPrivate && player.isPremium()) {
		list.push_front(dummyPrivate);
	}
	return list;
}
开发者ID:V-SGFX,项目名称:forgottenserver,代码行数:53,代码来源:chat.cpp


示例4: getChannel

ChannelList Chat::getChannelList(Player* player)
{
	ChannelList list;

	if (player->getGuild()) {
		ChatChannel* channel = getChannel(player, CHANNEL_GUILD);
		if (channel) {
			list.push_back(channel);
		} else {
			channel = createChannel(player, CHANNEL_GUILD);
			if (channel) {
				list.push_back(channel);
			}
		}
	}

	if (player->getParty()) {
		ChatChannel* channel = getChannel(player, CHANNEL_PARTY);
		if (channel) {
			list.push_back(channel);
		} else {
			channel = createChannel(player, CHANNEL_PARTY);
			if (channel) {
				list.push_back(channel);
			}
		}
	}

	for (NormalChannelMap::iterator it = m_normalChannels.begin(); it != m_normalChannels.end(); ++it) {
		ChatChannel* channel = getChannel(player, it->first);
		if (channel) {
			list.push_back(it->second);
		}
	}

	bool hasPrivate = false;
	for (PrivateChannelMap::iterator pit = m_privateChannels.begin(); pit != m_privateChannels.end(); ++pit) {
		if (PrivateChatChannel* channel = pit->second) {
			if (channel->isInvited(player)) {
				list.push_back(channel);
			}

			if (channel->getOwner() == player->getGUID()) {
				hasPrivate = true;
			}
		}
	}

	if (!hasPrivate && player->isPremium()) {
		list.push_front(dummyPrivate);
	}
	return list;
}
开发者ID:24312108k,项目名称:forgottenserver,代码行数:53,代码来源:chat.cpp


示例5: m_port1

MessageChannel::MessageChannel(ExecutionContext* context)
    : m_port1(MessagePort::create(*context))
    , m_port2(MessagePort::create(*context))
{
    ScriptWrappable::init(this);
    createChannel(m_port1.get(), m_port2.get());
}
开发者ID:coinpayee,项目名称:blink,代码行数:7,代码来源:MessageChannel.cpp


示例6: participants

/*!
  Creates a new private conference and invites additional attendees.
  The conference will get a random password.

  JSON Parameters:
  - participants (Array with fingerprints)
*/
bool ConferenceModule::Private::processJsonConferenceCreate(TcpSocketHandler &socket, const TcpProtocol::RequestHeader &header, const QVariant &data)
{
    auto json = data.toMap();
    auto participants = json.value("participants").toList();

    auto server = _pOwner->_serverBase;
    auto selfInfo = socket.getClientInfo();

    // Create invisible channel with random password.
    auto channel = server->createChannel();
    if (!server->joinChannel(selfInfo->id, channel->id)) {
        QVariantMap m;
        m["status"] = 500;
        m["error_message"] = "Can not create channel.";
        return socket.sendJsonResponse(header, m);
    }

    // Invite participants.
    foreach (auto o, participants) {
        auto fingerprint = o.toByteArray();
        auto sock = server->findSocket(fingerprint);
        if (sock) {
            QVariantMap m;
            m["method"] = "/conference/notify/invite";
            m["initiator"] = socket._key.fingerprint();
            m["channel"] = channel->toVariant();
            sock->sendJsonPackage(m);
        }
    }
开发者ID:hasbromlp,项目名称:ocs,代码行数:36,代码来源:conferencemodule.cpp


示例7: createChannel

int FlowData::createChannelGeometry(int dimension)
{
    int result = createChannel();
	//just take the dimension as if it was an offset to the geometryData array
    channels[result]->copyValues((float*)geometry.geometryData, 3, dimension);
    return result;
}
开发者ID:namyra,项目名称:VisLU2,代码行数:7,代码来源:FlowData.cpp


示例8: qDebug

void MumbleClient::processServerSync(quint8 *message, quint64 size)
{
    MumbleProto::ServerSync sync;
    sync.ParseFromArray(message,size);
    _session_id = sync.session();
    _max_bandwidth = sync.max_bandwidth();
    std::string welcome = sync.welcome_text();
    _synchronized = true;
    qDebug() << QString::fromStdString(welcome)
             << " max bandwidth: " << _max_bandwidth
             << " session: " << QString::number(_session_id);
#ifndef NO_CRYPT
    createChannel();
#endif
    MumbleProto::UserState us;
    us.set_session(_session_id);
    us.set_actor(_session_id);
    us.set_self_deaf(true);
    us.set_self_mute(true);
    us.set_comment(_settings->_callsign.toStdString().c_str());
    int msize = us.ByteSize();
    quint8 data[msize];
    us.SerializeToArray(data,msize);
    this->sendMessage(data,9,msize);
}
开发者ID:guyt101z,项目名称:qradiolink,代码行数:25,代码来源:mumbleclient.cpp


示例9: createChannel

Channel::shared_pointer ChannelProviderLocal::createChannel(
    string const & channelName,
    ChannelRequester::shared_pointer  const &channelRequester,
    short priority)
{
    return createChannel(channelName,channelRequester,priority,"");
}
开发者ID:anjohnson,项目名称:pvDatabaseCPP,代码行数:7,代码来源:channelProviderLocal.cpp


示例10: _controller

Animation::Animation(const char* id, AnimationTarget* target, int propertyId, unsigned int keyCount, unsigned long* keyTimes, float* keyValues, float* keyInValue, float* keyOutValue, unsigned int type)
    : _controller(Game::getInstance()->getAnimationController()), _id(id), _duration(0), _defaultClip(NULL), _clips(NULL)
{
    createChannel(target, propertyId, keyCount, keyTimes, keyValues, keyInValue, keyOutValue, type);
    // Release the animation because a newly created animation has a ref count of 1 and the channels hold the ref to animation.
    release();
    assert(getRefCount() == 1);
}
开发者ID:Jaegermeiste,项目名称:GamePlay,代码行数:8,代码来源:Animation.cpp


示例11: setTaskName

	//------------------------------------------------------------------------
	EventManager::EventManager(){
		setTaskName("EventSystem");

		NR_Log(Log::LOG_ENGINE, "EventManager: Initialize the event management system");

		// create default system wide channel
		createChannel(NR_DEFAULT_EVENT_CHANNEL);
	}
开发者ID:cgart,项目名称:nrEngine,代码行数:9,代码来源:EventManager.cpp


示例12: RsGxsUpdateBroadcastPage

/** Constructor */
GxsChannelDialog::GxsChannelDialog(QWidget *parent)
	: RsGxsUpdateBroadcastPage(rsGxsChannels, parent), GxsServiceDialog(dynamic_cast<GxsCommentContainer *>(parent))
{
	/* Invoke the Qt Designer generated object setup routine */
	ui.setupUi(this);

	/* Setup UI helper */
	mStateHelper = new UIStateHelper(this);

	mStateHelper->addWidget(TOKEN_TYPE_POSTS, ui.progressBar, UISTATE_LOADING_VISIBLE);
	mStateHelper->addWidget(TOKEN_TYPE_POSTS, ui.progressLabel, UISTATE_LOADING_VISIBLE);

	mStateHelper->addLoadPlaceholder(TOKEN_TYPE_GROUP_DATA, ui.nameLabel);

	mStateHelper->addWidget(TOKEN_TYPE_GROUP_DATA, ui.postButton);
	mStateHelper->addWidget(TOKEN_TYPE_GROUP_DATA, ui.logoLabel);

	mChannelQueue = new TokenQueue(rsGxsChannels->getTokenService(), this);

	connect(ui.postButton, SIGNAL(clicked()), this, SLOT(createMsg()));
//	connect(NotifyQt::getInstance(), SIGNAL(channelMsgReadSatusChanged(QString,QString,int)), this, SLOT(channelMsgReadSatusChanged(QString,QString,int)));

	/*************** Setup Left Hand Side (List of Channels) ****************/

	connect(ui.treeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(channelListCustomPopupMenu(QPoint)));
	connect(ui.treeWidget, SIGNAL(treeCurrentItemChanged(QString)), this, SLOT(selectChannel(QString)));
	connect(ui.todoPushButton, SIGNAL(clicked()), this, SLOT(todo()));

	mChannelId.clear();

	/* Set initial size the splitter */
	QList<int> sizes;
	sizes << 300 << width(); // Qt calculates the right sizes
	ui.splitter->setSizes(sizes);

	/* Initialize group tree */
	QToolButton *newChannelButton = new QToolButton(this);
	newChannelButton->setIcon(QIcon(":/images/add_channel24.png"));
	newChannelButton->setToolTip(tr("Create Channel"));
	connect(newChannelButton, SIGNAL(clicked()), this, SLOT(createChannel()));
	ui.treeWidget->addToolButton(newChannelButton);

	ownChannels = ui.treeWidget->addCategoryItem(tr("My Channels"), QIcon(IMAGE_CHANNELBLUE), true);
	subcribedChannels = ui.treeWidget->addCategoryItem(tr("Subscribed Channels"), QIcon(IMAGE_CHANNELRED), true);
	popularChannels = ui.treeWidget->addCategoryItem(tr("Popular Channels"), QIcon(IMAGE_CHANNELGREEN), false);
	otherChannels = ui.treeWidget->addCategoryItem(tr("Other Channels"), QIcon(IMAGE_CHANNELYELLOW), false);

	ui.progressLabel->hide();
	ui.progressBar->hide();

	ui.nameLabel->setMinimumWidth(20);

	/* load settings */
	processSettings(true);

	/* Initialize empty GUI */
	requestGroupData(mChannelId);
}
开发者ID:RedCraig,项目名称:retroshare,代码行数:59,代码来源:GxsChannelDialog.cpp


示例13: Model

FxMixer::FxMixer() :
	Model( NULL ),
	JournallingObject(),
	m_fxChannels()
{
	// create master channel
	createChannel();
	m_lastSoloed = -1;
}
开发者ID:NeiroNext,项目名称:lmms,代码行数:9,代码来源:FxMixer.cpp


示例14: createChannel

Channel::shared_pointer ChannelProviderLocal::createChannel(
    string const & channelName,
    ChannelRequester::shared_pointer  const &channelRequester,
    short priority,
    string const &address)
{
    if(!address.empty()) throw std::invalid_argument("address not allowed for local implementation");
    return createChannel(channelName, channelRequester, priority);
}
开发者ID:mrkraimer,项目名称:pvDatabaseCPP,代码行数:9,代码来源:channelProviderLocal.cpp


示例15: while

// make sure we have at least num channels
void FxMixer::allocateChannelsTo(int num)
{
	while( num > m_fxChannels.size() - 1 )
	{
		createChannel();

		// delete the default send to master
		deleteChannelSend( m_fxChannels.size()-1, 0 );
	}
}
开发者ID:NeiroNext,项目名称:lmms,代码行数:11,代码来源:FxMixer.cpp


示例16: qInfo

void Caster::onEncrypted() {
    qInfo() << "Connected";
    platform_channel_ = createChannel(QStringLiteral("sender-0"),
                                      QStringLiteral("receiver-0"));
    platform_channel_->addInterface(HeartbeatInterface::URN);
    receiver_ = static_cast<ReceiverInterface*>(
        platform_channel_->addInterface(ReceiverInterface::URN));
    Q_EMIT receiverChanged();
    Q_EMIT connected();
}
开发者ID:jhenstridge,项目名称:cast-app,代码行数:10,代码来源:caster.cpp


示例17: handle_JOIN

//doesn't currently handle when user is already in channel
void handle_JOIN(char** params, int socket){
  char *chanName = params[1];
  channel *chan;
  char *user;
  char *nick;
  struct ClientData *beingAdded;
  char msgbuf[515];
  int ifnew = 0;
  
  //search for user by socket
  //printf("searching for user\n");
  pthread_mutex_lock(&listLock);
  beingAdded = (struct ClientData *)list_seek(&clientList, &socket);
  printf("%s\n", beingAdded->nick);
  pthread_mutex_unlock(&listLock);
  user = beingAdded->user;
  nick = beingAdded->nick;
  
  //search for channel by name
  printf("searching for channel\n");
  chan = (channel *) findChannel(chanName);

  //if it doesn't exist, create the channel
  if(chan == NULL){
    chan = createChannel(chanName, 0, 0, "", socket);
    pthread_mutex_lock(&chanListLock);
    list_append(&channelList, chan);
    pthread_mutex_unlock(&chanListLock);
    ifnew = 1;
  }
  
  //add user to that channel
  printf("adding user to channel\n");
  //start by checking if user is already joined
  if(isUserInChannel(socket, chan) != -1){
    //printf("user is already in channel\n");
    return;
  } else {
    pairUserWithChannel(beingAdded, chan, ifnew, socket);
  }
  //send out the message
  printf("sending message\n");
  sprintf(msgbuf, ":%s!%[email protected] JOIN %s\r\n", nick, user, chanName); //needs user address
  sendMessage(msgbuf, socket);
  messageAllUsers(msgbuf, chan, socket);
  if((chan->topic)[0] != '\0'){
    sprintf(msgbuf, ":%s 332 %s %s :%s\r\n", host, nick, chanName, chan->topic);
    sendMessage(msgbuf, socket);
  }
  sprintf(msgbuf, ":%s!%[email protected] 353 %s = %s :nicknames eventually go here\r\n", nick, user, nick, chanName);
  sendMessage(msgbuf, socket);
  sprintf(msgbuf, ":%s!%[email protected] 366 %s %s :End of NAMES list\r\n", nick, user, nick, chanName);
  sendMessage(msgbuf, socket);
  return;
}
开发者ID:npwinkler,项目名称:CMSC-Work,代码行数:56,代码来源:handlers.c


示例18: ASSERT_MSG

SoundChannel& SoundDevice::activateSound(Sound& sound)
{
   if (getChannelsCount() == m_activeChannels.size())
   {
      ASSERT_MSG( false, "All sound channels are currently occupied" );
   }

   SoundChannel* channel = createChannel(sound, m_numBuffersUsed);
   m_activeChannels.push_back(channel);
   return *channel;
}
开发者ID:chenwenbin928,项目名称:tamy,代码行数:11,代码来源:SoundDevice.cpp


示例19: createChannel

LLAudioChannel * LLAudioEngine::getFreeChannel(const F32 priority)
{
	S32 i;
	for (i = 0; i < mNumChannels; i++)
	{
		if (!mChannels[i])
		{
			// No channel allocated here, use it.
			mChannels[i] = createChannel();
			return mChannels[i];
		}
		else
		{
			// Channel is allocated but not playing right now, use it.
			if (!mChannels[i]->isPlaying() && !mChannels[i]->isWaiting())
			{
				LL_DEBUGS("AudioEngine") << "Replacing unused channel" << llendl;
				mChannels[i]->cleanup();
				if (mChannels[i]->getSource())
				{
					mChannels[i]->getSource()->setChannel(NULL);
				}
				return mChannels[i];
			}
		}
	}

	// All channels used, check priorities.
	// Find channel with lowest priority and see if we want to replace it.
	F32 min_priority = 10000.f;
	LLAudioChannel *min_channelp = NULL;

	for (i = 0; i < mNumChannels; i++)
	{
		LLAudioChannel *channelp = mChannels[i];
		LLAudioSource *sourcep = channelp->getSource();
		if (sourcep->getPriority() < min_priority)
		{
			min_channelp = channelp;
			min_priority = sourcep->getPriority();
		}
	}

	if (min_priority > priority || !min_channelp)
	{
		// All playing channels have higher priority, return.
		return NULL;
	}

	LL_DEBUGS("AudioEngine") << "Flushing min channel" << llendl;
	// Flush the minimum priority channel, and return it.
	min_channelp->cleanup();
	return min_channelp;
}
开发者ID:OS-Development,项目名称:VW.Singularity,代码行数:54,代码来源:llaudioengine.cpp


示例20: pChannelConfig

void LoggingConfigurator::configureChannels(AbstractConfiguration* pConfig)
{
    AbstractConfiguration::Keys channels;
    pConfig->keys(channels);
    for (AbstractConfiguration::Keys::const_iterator it = channels.begin(); it != channels.end(); ++it)
    {
        AutoPtr<AbstractConfiguration> pChannelConfig(pConfig->createView(*it));
        AutoPtr<Channel> pChannel = createChannel(pChannelConfig);
        LoggingRegistry::defaultRegistry().registerChannel(*it, pChannel);
    }
    for (AbstractConfiguration::Keys::const_iterator it = channels.begin(); it != channels.end(); ++it)
    {
        AutoPtr<AbstractConfiguration> pChannelConfig(pConfig->createView(*it));
        Channel* pChannel = LoggingRegistry::defaultRegistry().channelForName(*it);
        configureChannel(pChannel, pChannelConfig);
    }
}
开发者ID:Victorcasas,项目名称:georest,代码行数:17,代码来源:LoggingConfigurator.cpp



注:本文中的createChannel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ createClient函数代码示例发布时间:2022-05-30
下一篇:
C++ createCamera函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap