void DirectoryName<NameControl>::onFilesDropped(FileDropEvent& event) { const auto& files = event.getFiles(); if (files.empty()) return; if (acceptDrop(files, event.getDropPosition(), event.getDropWindow())) { const wxString fileName = event.getFiles()[0]; if (dirExists(toZ(fileName))) setDirectoryName(fileName, &dirpath_, dirpath_, staticText_); else { wxString parentName = beforeLast(fileName, utfCvrtTo<wxString>(FILE_NAME_SEPARATOR)); //returns empty string if ch not found #ifdef ZEN_WIN if (endsWith(parentName, L":")) //volume name parentName += FILE_NAME_SEPARATOR; #endif if (dirExists(toZ(parentName))) setDirectoryName(parentName, &dirpath_, dirpath_, staticText_); else //set original name unconditionally: usecase: inactive mapped network shares setDirectoryName(fileName, &dirpath_, dirpath_, staticText_); } //notify action invoked by user wxCommandEvent dummy(EVENT_ON_DIR_SELECTED); ProcessEvent(dummy); } else event.Skip(); //let other handlers try!!! }
void ShaderToyApp::fileDrop( FileDropEvent event ) { // Send all file requests to the loading thread. size_t count = event.getNumFiles(); for( size_t i = 0; i < count && mRequests->isNotFull(); ++i ) mRequests->pushFront( event.getFile( i ) ); }
void ImageFileBasicApp::fileDrop( FileDropEvent event ) { try { mTexture = gl::Texture::create( loadImage( loadFile( event.getFile( 0 ) ) ) ); } catch( Exception &exc ) { CI_LOG_EXCEPTION( "failed to load image: " << event.getFile( 0 ), exc ); } }
void fileDrop(FileDropEvent event) { if (event.getNumFiles() > 0) { console() << event.getFile(0); ImageSourceRef img = loadImage(event.getFile(0)); updateOfflineImage(img); } }
void StarsApp::fileDrop( FileDropEvent event ) { for(size_t i=0;i<event.getNumFiles();++i) { fs::path file = event.getFile(i); // skip if not a file if( !fs::is_regular_file( file ) ) continue; if( std::find( mMusicExtensions.begin(), mMusicExtensions.end(), file.extension() ) != mMusicExtensions.end() ) playMusic(file); } }
void cinderFFmpegApp::fileDrop( FileDropEvent event ) { for(int i=0; i<event.getFiles().size(); i++) { std::shared_ptr<_2RealFFmpegWrapper::FFmpegWrapper> fileToLoad = std::shared_ptr<_2RealFFmpegWrapper::FFmpegWrapper>(new _2RealFFmpegWrapper::FFmpegWrapper()); if(fileToLoad->open(event.getFile(i).string())) { m_Players.push_back(fileToLoad); m_VideoTextures.push_back(gl::Texture()); m_Players.back()->play(); } } }
void PostProcessingApp::fileDrop( FileDropEvent event ) { // use the last of the dropped files mFile = event.getFile( event.getNumFiles() - 1 ); try { // try loading image file mImage = gl::Texture( loadImage( mFile ) ); } catch(...) { // otherwise, try loading QuickTime video play( mFile ); } }
void SamplePlayerNodeTestApp::fileDrop( FileDropEvent event ) { const fs::path &filePath = event.getFile( 0 ); CI_LOG_V( "File dropped: " << filePath ); setSourceFile( loadFile( filePath ) ); mSamplePlayerNode->seek( 0 ); CI_LOG_V( "output samplerate: " << mSourceFile->getSampleRate() ); auto bufferPlayer = dynamic_pointer_cast<audio::BufferPlayerNode>( mSamplePlayerNode ); if( bufferPlayer ) { bufferPlayer->loadBuffer( mSourceFile ); mWaveformPlot.load( bufferPlayer->getBuffer(), getWindowBounds() ); } else { auto filePlayer = dynamic_pointer_cast<audio::FilePlayerNode>( mSamplePlayerNode ); CI_ASSERT_MSG( filePlayer, "expected sample player to be either BufferPlayerNode or FilePlayerNode" ); filePlayer->setSourceFile( mSourceFile ); } mLoopBeginSlider.mMax = mLoopEndSlider.mMax = (float)mSamplePlayerNode->getNumSeconds(); CI_LOG_V( "loaded and set new source buffer, channels: " << mSourceFile->getNumChannels() << ", frames: " << mSourceFile->getNumFrames() ); PRINT_GRAPH( audio::master() ); }
void ProjectManagerApp::fileDrop(FileDropEvent event) { StringArray drops; for (auto it : event.getFiles()) { std::string path = it.string(); File file(path); if (file.exists()) { drops.addIfNotAlreadyThere(path); } } CI_ASSERT(drops.size() == 1); int count = handler.processCinderRoot(*drops.begin()); if (count < 0) { gui->postWarningMessage("Fatal error! ", "Dropped folder is not Cinder root folder"); } else { String msg = String(count) + " vc2015 projects created!"; gui->postInfoMessage("Done ", msg.toStdString()); } }
void ciApp::fileDrop(FileDropEvent event) { player.reset(); player = qtime::MovieGlHap::create(event.getFile(0)); player->setLoop(); player->play(); }
void DelaunayMeshMaker::fileDrop( FileDropEvent event ){ try { mSurface = loadImage( event.getFile( 0 ) ); int width = mSurface.getWidth(); int height = mSurface.getHeight(); app::setWindowSize( width, height ); mFbo = gl::Fbo( width, height, false ); mBorderPoints.clear(); mBorderPoints.push_back( Vec2f::zero() ); mBorderPoints.push_back( Vec2f( (float)width, 0 ) ); mBorderPoints.push_back( Vec2f( (float)width ,(float)height ) ); mBorderPoints.push_back( Vec2f( 0 ,(float)height ) ); mSteinerPoints.clear(); mMesh.clear(); tesselate(); } catch( ... ) { console() << "unable to load the texture file!" << std::endl; }; }
void AudioObjApp::fileDrop( FileDropEvent event ) { fs::path filepath = event.getFile(0); if ( filepath.extension() == ".obj" ) { loadObject( filepath ); } }
void ImageFileBasicApp::fileDrop( FileDropEvent event ) { try { mTexture = gl::Texture( loadImage( event.getFile( 0 ) ) ); } catch( ... ) { console() << "unable to load the texture file!" << std::endl; }; }
void ArmyDemoApp::fileDrop( FileDropEvent event ) { try { mSkeletalMesh = model::SkeletalMesh::create( model::AssimpLoader( loadFile( event.getFile(0) ) ) ); } catch( ... ) { console() << "unable to load the asset!" << std::endl; }; }
void ImageFileBasicApp::fileDrop( FileDropEvent event ) { try { mTexture = gl::Texture::create( loadImage( event.getFile( 0 ) ) ); } catch( ci::Exception &exc ) { console() << "unable to load the texture file, what: " << exc.what() << endl; } }
void ImageRetargetingApp::fileDrop( FileDropEvent event ) { try { initTextures(event.getFile(0)); resetAllWindowsOriginalSize(); } catch( ... ) { console() << "unable to load the texture file!" << std::endl; }; }
void GeometryApp::fileDrop( FileDropEvent event ) { try { gl::Texture::Format fmt; fmt.setAutoInternalFormat(); fmt.setWrap( GL_REPEAT, GL_REPEAT ); mTexture = gl::Texture2d::create( loadImage( event.getFile( 0 ) ), fmt ); } catch( const std::exception &exc ) { } }
void Genetic_AlgorithmApp::fileDrop(FileDropEvent event) { if (m_captureMode) return; m_imageLoaded.clear(); unsigned int fileCount = event.getNumFiles(); fs::path path; if (fileCount > 0) { for (unsigned int i = 0; i < fileCount; ++i) { try { path = event.getFile(i); m_imageLoaded.push_back(cinder::loadImage(path)); } catch (ci::ImageIoException&) { console() << "Format non supporté pour l'image : " << path.filename() << std::endl; } catch (std::exception&) { console() << "Error occur" << std::endl; } } m_currentImage = m_imageLoaded.front(); m_currentImageLoadedIndex = 0; } setupIHM(); }
void PaintingBeingsApp::fileDrop(FileDropEvent event) { if (_image.loadWithImagePath(event.getFile(0))) { updateInterface(true); _algoGen.setup(_image.getMiniatureSurface()); _imageBeing.setup(_image.getMiniatureSize()); resetCamera(); _launchAlgoGen = true; _showImageBeing = true; setPlay(); } else app::console() << "Erreur lors du chargement de l'image" << std::endl; }
void ReymentaHapPlayerApp::fileDrop(FileDropEvent event) { loadMovieFile(event.getFile(0)); }
void TextRenderingApp::fileDrop( FileDropEvent event ) { if( event.getNumFiles() == 1) { // you dropped 1 file, let's try to load it as a SDFF font file fs::path file = event.getFile(0); if(file.extension() == ".sdff") { try { // create a new font and read the file ph::text::FontRef font( new ph::text::Font() ); font->read( loadFile(file) ); // add font to font manager fonts().addFont( font ); // set the text font mTextBox.setFont( font ); } catch( const std::exception &e ) { console() << e.what() << std::endl; } } else { // try to render the file as a text mTextBox.setText( loadString( loadFile(file) ) ); } } else if( event.getNumFiles() == 2 ) { // you dropped 2 files, let's try to create a new SDFF font file fs::path fileA = event.getFile(0); fs::path fileB = event.getFile(1); if(fileA.extension() == ".txt" && fileB.extension() == ".png") { try { // create a new font from an image and a metrics file ph::text::FontRef font( new ph::text::Font() ); font->create( loadFile(fileB), loadFile(fileA) ); // create a compact SDFF file font->write( writeFile( getAssetPath("") / "fonts" / (font->getFamily() + ".sdff") ) ); // add font to font manager fonts().addFont( font ); // set the text font mTextBox.setFont( font ); } catch( const std::exception &e ) { console() << e.what() << std::endl; } } else if(fileB.extension() == ".txt" && fileA.extension() == ".png") { try { // create a new font from an image and a metrics file ph::text::FontRef font( new ph::text::Font() ); font->create( loadFile(fileA), loadFile(fileB) ); // create a compact SDFF file font->write( writeFile( getAssetPath("") / "fonts" / (font->getFamily() + ".sdff") ) ); // add font to font manager fonts().addFont( font ); // set the text font mTextBox.setFont( font ); } catch( const std::exception &e ) { console() << e.what() << std::endl; } } } updateWindowTitle(); }
void Grove::fileDrop( FileDropEvent evt ) { fs::path path= evt.getFile( 0 ); loadScriptFile(path.string()); }
void QuickTimeSampleApp::fileDrop( FileDropEvent event ) { loadMovieFile( event.getFile( 0 ) ); }
void _TBOX_PREFIX_App::fileDrop( FileDropEvent event ) { loadMovieFile( event.getFile( 0 ) ); }
void ardroneApp::fileDrop( FileDropEvent event ) { loadMovieFile( event.getFile( 0 ) ); }
void MainDialog::onFilesDropped(FileDropEvent& event) { const auto& filePaths = event.getPaths(); if (!filePaths.empty()) loadConfig(utfCvrtTo<Zstring>(filePaths[0])); }
void SphericalStereoApp::fileDrop( FileDropEvent event ) { mPanos.insert( mPanos.begin() + mPanoIndex, Pano{ event.getFile( 0 ) } ); }
void QuickTimePlayer::fileDrop( FileDropEvent event ) { loadMovieFile( event.getFile( 0 ) ); }
void QTimeIterApp::fileDrop( FileDropEvent event ) { loadMovieFile( event.getFile( 0 ) ); }
void EnhanceApp::fileDrop( FileDropEvent event ) { loadMovieFile( event.getFile( 0 ) ); }