コード例 #1
0
ファイル: RemotePlugin.cpp プロジェクト: Lukas-W/lmms
bool RemotePlugin::processMessage( const message & _m )
{
	lock();
	message reply_message( _m.id );
	bool reply = false;
	switch( _m.id )
	{
		case IdUndefined:
			unlock();
			return false;

		case IdInitDone:
			reply = true;
			break;

		case IdSampleRateInformation:
			reply = true;
			reply_message.addInt( Engine::mixer()->processingSampleRate() );
			break;

		case IdBufferSizeInformation:
			reply = true;
			reply_message.addInt( Engine::mixer()->framesPerPeriod() );
			break;

		case IdChangeInputCount:
			m_inputCount = _m.getInt( 0 );
			resizeSharedProcessingMemory();
			break;

		case IdChangeOutputCount:
			m_outputCount = _m.getInt( 0 );
			resizeSharedProcessingMemory();
			break;

		case IdChangeInputOutputCount:
			m_inputCount = _m.getInt( 0 );
			m_outputCount = _m.getInt( 1 );
			resizeSharedProcessingMemory();
			break;

		case IdDebugMessage:
			fprintf( stderr, "RemotePlugin::DebugMessage: %s",
						_m.getString( 0 ).c_str() );
			break;

		case IdProcessingDone:
		case IdQuit:
		default:
			break;
	}
	if( reply )
	{
		sendMessage( reply_message );
	}
	unlock();

	return true;
}
コード例 #2
0
ファイル: msg.c プロジェクト: bishisht/manrix
/* determine accessibility of a file */
void msg_access(message_t msg)
{
	int ret;

	ret = vfs_access(msg->tid, msg->snd_ptr, msg->w4);
	msg->w1 = ret;
	reply_message(msg->tid, msg);
}
コード例 #3
0
ファイル: msg.c プロジェクト: bishisht/manrix
/*
 * Return value is kept in the same buf.
 */
void msg_exec(message_t msg)
{
	/*
	 * Return value is kept in the same buf.
	 */
	msg->w1 = do_exec(msg->tid, (char *)msg->snd_ptr, (struct vn_object *)msg->rcv_ptr);
	reply_message(msg->tid, msg);
}
コード例 #4
0
ファイル: msg.c プロジェクト: bishisht/manrix
void msg_read(message_t msg)
{
	int ret;

	ret = vfs_read(msg->tid, msg->w2, msg->rcv_ptr, msg->rcv_bufsize);
	msg->w1 = ret;
	reply_message(msg->tid, msg);
}
コード例 #5
0
ファイル: msg.c プロジェクト: bishisht/manrix
void msg_write(message_t msg)
{
	int ret;

	ret = vfs_write(msg->tid, msg->w4, msg->snd_ptr, msg->snd_bufsize);
	msg->w1 = ret;
	reply_message(msg->tid, msg);
}
コード例 #6
0
ファイル: msg.c プロジェクト: bishisht/manrix
/* close the file */
void msg_close(message_t msg)
{
	int ret;

	ret = vfs_close(msg->tid, msg->w4);
	msg->w1 = ret;
	reply_message(msg->tid, msg);

}
コード例 #7
0
ファイル: session.cpp プロジェクト: qtplatz/qtplatz
 void reply_handler( const std::string& method, const std::string& reply ) {
     if ( method == "InitialSetup" ) {
         reply_message( adi::Receiver::STATE_CHANGED, ( reply == "success" ) ? adi::Instrument::eStandBy : adi::Instrument::eOff );
     } else {
         adacquire::EventLog::LogMessage mlog( "%1%", method, "AP240" );
         mlog << reply;
         for ( auto& r: clients_ )
             r.first->log( mlog );
     }
 }
コード例 #8
0
ファイル: msg.c プロジェクト: bishisht/manrix
/* open a file */
void msg_open(message_t msg)
{
	int ret;

	ret = vfs_open(msg->tid, (char *)msg->snd_ptr, (int *)&msg->w4, 0);
	msg->w1 = ret;
//	printf("reply %d ", msg->tid);
//	for(;;);
	reply_message(msg->tid, msg);
}
コード例 #9
0
ファイル: session.cpp プロジェクト: qtplatz/qtplatz
 void reply_handler( const std::string& method, const std::string& reply) {
     if ( method == "InitialSetup" ) {
         reply_message( adacquire::Receiver::STATE_CHANGED
                        , ( reply == "success" )
                        ? adacquire::Instrument::eStandBy
                        : adacquire::Instrument::eNotConnected | adacquire::Instrument::eErrorFlag );
     } else if ( method == "StateChanged" ) {
         if ( reply == "Stopped" )
             reply_message( adacquire::Receiver::STATE_CHANGED, adacquire::Instrument::eStop ); // 9
         else if ( reply == "Running" )
             reply_message( adacquire::Receiver::STATE_CHANGED, adacquire::Instrument::eRunning ); // 8
     } else if ( method == "DarkStarted" ) {
         reply_message( adacquire::Receiver::DARK_STARTED, 1 );
     } else if ( method == "DarkCanceled" ) {
         reply_message( adacquire::Receiver::DARK_CANCELED, 0 );
     } else if ( method == "DarkAcquired" ) {
         reply_message( adacquire::Receiver::DARK_ACQUIRED, 0 );
     } else {
         ADINFO() << "ACQUIRE: " << method << " = " << reply;
     }
 }
コード例 #10
0
ファイル: msg.c プロジェクト: bishisht/manrix
/* Chown */
void msg_chown(message_t msg)
{
	msg->w1 = vfs_chown(msg->tid, msg->snd_ptr, msg->w4, msg->w5);
	reply_message(msg->tid, msg);
}
コード例 #11
0
ファイル: msg.c プロジェクト: bishisht/manrix
void msg_chdir(message_t msg)
{
	msg->w1 = fs_chdir(msg->tid, msg->snd_ptr);
	reply_message(msg->tid, msg);
}
コード例 #12
0
ファイル: msg.c プロジェクト: bishisht/manrix
void msg_data_req(message_t msg)
{
	msg->w1 = data_request(msg->tid, msg->snd_ptr, msg->rcv_ptr);
	reply_message(msg->tid, msg);
}
コード例 #13
0
ファイル: msg.c プロジェクト: bishisht/manrix
/* fstat */
void msg_fstat(message_t msg)
{
	msg->w1 = vfs_fstat(msg->tid, msg->w2, msg->rcv_ptr);
	reply_message(msg->tid, msg);
}
コード例 #14
0
ファイル: msg.c プロジェクト: bishisht/manrix
/* stat */
void msg_stat(message_t msg)
{
	msg->w1 = vfs_chmod(msg->tid, msg->snd_ptr, msg->rcv_ptr);
	reply_message(msg->tid, msg);
}
コード例 #15
0
ファイル: msg.c プロジェクト: bishisht/manrix
/* Chmod */
void msg_chmod(message_t msg)
{
	msg->w1 = vfs_chmod(msg->tid, msg->snd_ptr, msg->w4);
	reply_message(msg->tid, msg);
}