AbstractCommand::AbstractCommand(CmdID* cmdID,
                                 bool noResp,
                                 Meta* meta) {
    initialize();

    setCmdID(cmdID);
    this->noResp  = noResp;
    setMeta(meta);
}
예제 #2
0
/*!
 * Initialize this correlation matrix with a list of gene names, the max cluster
 * size, and a correlation name.
 *
 * @param geneNames
 * @param maxClusterSize
 * @param correlationName
 */
void CorrelationMatrix::initialize(const EMetaArray& geneNames, int maxClusterSize, const QString& correlationName)
{
   EDEBUG_FUNC(this,&geneNames,maxClusterSize,&correlationName);

   // save correlation names to metadata
   EMetaObject metaObject {meta().toObject()};
   metaObject.insert("correlation", correlationName);
   setMeta(metaObject);

   // initialize base class
   Matrix::initialize(geneNames, maxClusterSize, sizeof(float), SUBHEADER_SIZE);
}
예제 #3
0
	void Debugger::onCreate() {
		setDepth(100);
		setMeta(true);
		setPersistent(true);
		cursor_spr = false;
		// Try and load a cursor sprite if one isn't supplied.
		try {
			if (Sprite::getTexture("debug_cursor") == nullptr) {
				Sprite::load("debug_cursor", "images/debug_cursor.png");
			}
			cursor_spr = true;
		} catch (FlexiumException& e) {}
	}
예제 #4
0
파일: Item.cpp 프로젝트: ruphy/kfunambol
/**
* Creates a new Item object.
*
* @param target item target - NULL ALLOWED
* @param source item source - NULL ALLOWED
* @param meta item meta data - NULL ALLOWED
* @param data item data - NULL ALLOWED
*
*/
Item::Item( Target* target,
            Source* source,
            Meta*   meta  ,
            ComplexData* data,
            bool moreData) {
    initialize();
    setTarget(target);
    setSource(source);
    setTargetParent(NULL);
    setSourceParent(NULL);
    setMeta(meta);
    setData(data);
    setMoreData(moreData);

}
예제 #5
0
	USFPlayer(const std::string &fileName) {  	
		usf_state = new usf_loader_state;
		usf_state->emu_state = malloc( usf_get_state_size() );
		usf_clear( usf_state->emu_state );
		sample_rate = 0;
			
		char temp[fileName.length()+1];
		strcpy(temp, fileName.c_str());

		LOGD("Trying to load USF %s", string(temp));
					
		if ( psf_load( temp, &psf_file_system, 0x21, usf_loader, usf_state, usf_info, usf_state, 1 ) < 0 )
			throw player_exception();

		usf_set_hle_audio(usf_state->emu_state, 1);
		
		PSFFile psf { fileName };
		if(psf.valid()) {
			auto &tags = psf.tags();

			int seconds = psf.songLength();

			setMeta("composer", tags["artist"],
				"sub_title", tags["title"],
				"game", tags["game"],
				"format", "Nintendo 64",
				"length", seconds
			);
		}

		usf_set_compare( usf_state->emu_state, usf_state->enable_compare );
		usf_set_fifo_full( usf_state->emu_state, usf_state->enable_fifo_full );

		const char *err = usf_render(usf_state->emu_state, 0, 0, &sample_rate);
		if(err)
			LOGD("ERROR %s", err);
		LOGD("######### RATE %d", sample_rate);
		resampler_init();
		for(auto &r : resampler) {
			r = resampler_create();
			resampler_set_quality(r, RESAMPLER_QUALITY_CUBIC);
			resampler_set_rate(r,  (float)sample_rate / 44100.0);
			//resampler_set_rate(r,  44100.0 / (float)sample_rate);
			resampler_clear(r);
		}
	}
예제 #6
0
	HivelyPlayer(const string &fileName)  {

		tune = hvl_LoadTune(fileName.c_str(), 44100, 0);

		if(!tune)
			throw player_exception();
		string msg;
		for(int i=1; i<tune->ht_InstrumentNr; i++) {
			char *name = tune->ht_Instruments[i].ins_Name;
			msg = msg + utils::utf8_encode(name) + " ";
		}

		setMeta(
			"title", tune->ht_Name,
			"message", msg, 
			"channels", tune->ht_Channels,
			"length", tune->ht_PlayingTime,
			"format", tune->ht_Version == 0xAA ? "AHX" : "Hively"
		);
	}
예제 #7
0
	TEDPlayer(const string &fileName)  {

		LOGD("Trying to play TED music");
		haveSound = false;
		counter = 0;
		audio = new PluginAudio();
		audio->ted = machineInit(44100, 24);
		tedplayMain(fileName.c_str(), audio);
		
		//audio->sleep(300);
		//audio->ted->putKey(1);
		
		setMeta("songs", 10);
			// "game", track0->game,
			// "composer", track0->author,
			// "copyright", track0->copyright,
			// "length", track0->length > 0 ? track0->length / 1000 : 0,
			// "sub_title", track0->song,
			// "format", track0->system,
			// "songs", gme_track_count(emu)
		//);
	}
예제 #8
0
파일: medialib.cpp 프로젝트: mstorsjo/vlc
int MediaLibrary::controlMedia( int query, va_list args )
{
    auto mediaId = va_arg( args, int64_t );
    auto m = m_ml->media( mediaId );
    if ( m == nullptr )
        return VLC_EGENERIC;
    switch( query )
    {
        case VLC_ML_MEDIA_INCREASE_PLAY_COUNT:
            if ( m->increasePlayCount() == false )
                return VLC_EGENERIC;
            return VLC_SUCCESS;
        case VLC_ML_MEDIA_GET_MEDIA_PLAYBACK_PREF:
        {
            auto meta = va_arg( args, int );
            auto res = va_arg( args, char** );
            return getMeta( *m, meta, res );
        }
        case VLC_ML_MEDIA_SET_MEDIA_PLAYBACK_PREF:
        {
            auto meta = va_arg( args, int );
            auto value = va_arg( args, const char* );
            return setMeta( *m, meta, value );
        }
        case VLC_ML_MEDIA_SET_THUMBNAIL:
        {
            auto mrl = va_arg( args, const char* );
            m->setThumbnail( mrl );
            return VLC_SUCCESS;
        }
        case VLC_ML_MEDIA_GENERATE_THUMBNAIL:
        {
            auto res = m_ml->requestThumbnail( m );
            return res == true ? VLC_SUCCESS : VLC_EGENERIC;
        }
        case VLC_ML_MEDIA_ADD_EXTERNAL_MRL:
        {
            auto mrl = va_arg( args, const char* );
            auto type = va_arg( args, int );
            medialibrary::IFile::Type mlType;
            switch ( type )
            {
                case VLC_ML_FILE_TYPE_UNKNOWN:
                // The type can't be main since this is added to an existing media
                // which must already have a file
                case VLC_ML_FILE_TYPE_MAIN:
                case VLC_ML_FILE_TYPE_PLAYLIST:
                    return VLC_EGENERIC;
                case VLC_ML_FILE_TYPE_PART:
                    mlType = medialibrary::IFile::Type::Part;
                    break;
                case VLC_ML_FILE_TYPE_SOUNDTRACK:
                    mlType = medialibrary::IFile::Type::Soundtrack;
                    break;
                case VLC_ML_FILE_TYPE_SUBTITLE:
                    mlType = medialibrary::IFile::Type::Subtitles;
                    break;
                default:
                    vlc_assert_unreachable();
            }
            if ( m->addExternalMrl( mrl, mlType ) == nullptr )
                return VLC_EGENERIC;
            return VLC_SUCCESS;
        }
        default:
            vlc_assert_unreachable();
    }
}
예제 #9
0
파일: server.cpp 프로젝트: mickymuis/voxowl
void 
Server::setPort( uint32_t p ) {
    _portnum =p;
    setMeta( "port", Variant( p ) );
}