void ForelleVisualAppApp::showClusterBar()
{
    bShowClusterBar = !bShowClusterBar;
    clusterBar.isVisible(bShowClusterBar);
    if(bShowClusterBar)
        menueBar.setOptions("Show ClusterBar" , "label='Hide ClusterBar'");
    else
        menueBar.setOptions("Show ClusterBar" , "label='Show ClusterBar'");

}
Esempio n. 2
0
void SpriteSheetGeneratorApp::setup()
{
  mParams = params::InterfaceGl( "SpriteSheet Generator", Vec2i( 200, 200 ) );
  mParams.setOptions( "", "position='50 450'" );
  mParams.addParam( "Preview scaling", &mWindowScaling, "min=0.1 max=2.0 step=0.05");
  mParams.addParam( "Preview offset", &mPreviewOffset.y );
  mParams.addParam( "Output name", &mFilename );
  mParams.addButton( "Save sheet", [this](){ saveSpriteSheet(); } );
}
Esempio n. 3
0
void FolApp::toggleRecording()
{
    if ( mNI.isRecording() )
    {
        mNI.stopRecording();
        mParams.setOptions( "Stop recording", " label='Start recording' " );
    }
    else
    {
        string path = getAppPath().string();
#ifdef CINDER_MAC
        path += "/../";
#endif
        path += "rec-" + timeStamp() + ".oni";
        fs::path oniPath(path);

        mNI.startRecording( oniPath );
        mParams.setOptions( "Start recording", " label='Stop recording' " );
    }
}
void ForelleVisualAppApp::setup()
{
    
    loadSettings();
    
    // Setup the parameters
    clusterBar =  ClusterBar( "Cluster Window", Vec2i( 200, 400 ) );

    //Setup menueBar
    
    menueBar = params::InterfaceGl( "Menue Window", Vec2i(300, 400 ), ColorA(0.5,0.5,0.5,0.1) );
    menueBar.setOptions("", "text=light position='724 0' valueswidth=100 contained=true");
    menueBar.addButton("Clear Scene ", std::bind( &ForelleVisualAppApp::clearScene, this ) );
    menueBar.addButton("Delete Selected Cluster", std::bind( &ForelleVisualAppApp::deleteCluster, this ) );
    menueBar.addParam("Draw Grid" , &drawGrid,"");
    menueBar.addParam("Read Pixel" , &readPixels, "true=reading false='not reading'");
    menueBar.addButton("Refresh ClusterBar", std::bind( &ForelleVisualAppApp::refreshClusterBar, this ) );
    menueBar.addParam("Update Cluster" , &updateCluster,"true=updating false='not updating'");
    menueBar.addParam("Send only Selected Cluster" , &selectedClusterOn,"");


    menueBar.addSeparator();	
    menueBar.addButton("Load Scene ", std::bind( &ForelleVisualAppApp::loadScene, this ) );
    menueBar.addButton("Load Cluster to Universe ", std::bind( &ForelleVisualAppApp::loadClusterToUniverse, this ) );
    menueBar.addParam("    Load to Universe" , &templateUniverse,"min=0 max=3 step=1");
    menueBar.addButton("Save as Cluster", std::bind( &ForelleVisualAppApp::saveAsCluster, this ) );
    menueBar.addButton("Save as Scene", std::bind( &ForelleVisualAppApp::saveAsScene, this ) );
    menueBar.addButton("Save as Standart Scene", std::bind( &ForelleVisualAppApp::saveAsStandartScene, this ) );
    menueBar.addParam("Send Data" , &sendData,"true=sending false='not sending'");
    
    menueBar.addSeparator();	
    menueBar.addSeparator();	
    menueBar.addParam("All On" , &bAllOn,"");
    menueBar.addParam("All Off" , &bAllOff,"");

    menueBar.addButton("Show ClusterBar", std::bind( &ForelleVisualAppApp::showClusterBar, this ) );
    menueBar.show(false);
    for (int i=0; i < Const::MAX_DMX_CHANNELS ; i++) {
        data1[i]= 0;
        data2[i]= 0;
        data3[i]= 0;
        data4[i]= 0;
    }

    //setup boolean variables
    readPixels = true;
    sendData  = true;
    drawGrid = true;
    updateCluster = true;
    bAllOn = false;
    bAllOff = false;
    bShowClusterBar = false;
    selectedClusterOn = false;
    
    //default load out templates to universe 0
    templateUniverse = 0;
 
  
    // set our pointer to the last added cluster
    if(!clusters.empty())
        selectedCluster = clusters.end()-1;
         

    controller.printClusters(clusters);


    
    //Setup Artnetnode
    
    if(ipAdress.empty() )
        ipAdress = "10.0.2.1";  //if it isn´t initalised already
    node = CinderArtnet("Art-Net Test", "LongName", ipAdress);
    node.setNodeTypeAsServer();
    node.setSubnetAdress(0);
    node.enableDMXPortAsInputAndSetAdress(0,1);
    node.enableDMXPortAsInputAndSetAdress(1, 2);
    node.enableDMXPortAsInputAndSetAdress(2, 3);
    node.enableDMXPortAsInputAndSetAdress(3, 4);
    node.printConfig();
    node.startNode();
    
    // initalize start our Syphone Client
    client.setup(Vec2i(60,60));
    pos = Vec2i(0,0);
    scale = 9;
     
    
    
    
 
    mLogo = gl::Texture( loadImage( loadResource(RES_LOGO) ) );
        

}