Exemplo n.º 1
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)

{
    ui->setupUi(this);
    SamplesList v;
	v.push_back(GeogPixSample(1991,51,106.805015,-20.675571));
	v.push_back(GeogPixSample(776,2730,100.120199,-6.423076));
	v.push_back(GeogPixSample(861,1414,100.578835,-13.555069));
	v.push_back(GeogPixSample(1743,951,105.426127,-15.991936));
    mapPanel = new MapPanel(GPSMapManager("GPSMap.png",v),this);

    QStringList strList = ui->line_lng->text().split(QChar(','));
    mapPanel->mapMagager.setLng(strList[1].toDouble());
    mapPanel->mapMagager.setLat((strList[0].toDouble()*(-1)));

    mapPanel->resize(800,800);
    mapPanel->show();
}
Exemplo n.º 2
0
void SoundManager::loadSamples()
{
    //some path, may be absolute or relative to bin/data
    int numSeasons = 4;
    int numCategories = 5;

    std::string seasons[4] = {"SUM","FAL","WIN","SPR"};
    std::string category[5] = {"DWN","DAY","DSK","EXP","NIG"};
    
    
    for (int i=0; i<numSeasons; i++) 
    {
        for (int j=0; j<numCategories; j++) 
        {
            std::string folderName = seasons[i] + "_" + category[j];
            std::string samplesPath = "sounds/" + folderName;
            std::cout<< m_dateManager->getTime()<<"- SoundManager-> loading samples from \""<<samplesPath<<"/\""<<std::endl;
            ofLogNotice()<< m_dateManager->getTime()<<"- SoundManager->loading samples from \""<<samplesPath<<"/\"";
            ofDirectory dir(samplesPath);
            //only show wav and aiff files
            dir.allowExt("wav");
            dir.allowExt("aiff");
            dir.allowExt("aif");
            //populate the directory object
            if(dir.listDir()==0)
            {
                std::cout <<m_dateManager->getTime()<<"- SoundManager-> No samples found in \""<< samplesPath <<"/\"" << std::endl;
                ofLogNotice() <<m_dateManager->getTime()<<"- SoundManager-> No samples found in \""<< samplesPath <<"/\"";
                //break;
            }
            
            SamplesList sampleList;
            //go through and print out all the paths
            for(int n = 0; n < dir.numFiles(); n++)
            {
                std::string sampleName = this->getSampleName(dir.getPath(n));
                SoundObject* sample = new SoundObject(sampleName);
                sample->loadSound(dir.getPath(n));
                sampleList.push_back(sample);
                std::cout <<m_dateManager->getTime()<<"- SoundManager-> loaded sample \""<< sampleName <<"/\"" << std::endl;
                ofLogNotice() <<m_dateManager->getTime()<<"- SoundManager-> loaded sample \""<< sampleName <<"/\"";
            }
            m_samples[folderName] = sampleList;
         }
    }
    
    m_currentSampleList = m_samples.begin()->second; // m_currentSampleList points to the first element map
    
}